projects/guix·blob mpd-fix-groups · refs

14693 lines · 612.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 © 2025 Zheng Junjie <[email protected]>
25;;;
26;;; This file is part of GNU Guix.
27;;;
28;;; GNU Guix is free software; you can redistribute it and/or modify it
29;;; under the terms of the GNU General Public License as published by
30;;; the Free Software Foundation; either version 3 of the License, or (at
31;;; your option) any later version.
32;;;
33;;; GNU Guix is distributed in the hope that it will be useful, but
34;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36;;; GNU General Public License for more details.
37;;;
38;;; You should have received a copy of the GNU General Public License
39;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41(define-module (gnu packages java)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix hg-download)
46 #:use-module (guix git-download)
47 #:use-module (guix svn-download)
48 #:use-module ((guix build utils) #:select (alist-replace))
49 #:use-module (guix utils)
50 #:use-module (guix gexp)
51 #:use-module (guix build-system ant)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system maven)
55 #:use-module (guix build-system python)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages attr)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bash)
61 #:use-module (gnu packages nss)
62 #:use-module (gnu packages cpio)
63 #:use-module (gnu packages cups)
64 #:use-module (gnu packages compression)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages freedesktop) ; wayland
68 #:use-module (gnu packages gawk)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages gl)
72 #:use-module (gnu packages ghostscript) ;lcms
73 #:use-module (gnu packages gnome)
74 #:use-module (gnu packages groovy)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages guile)
77 #:use-module (gnu packages icu4c)
78 #:use-module (gnu packages image)
79 #:use-module (gnu packages java-bootstrap)
80 #:use-module (gnu packages java-compression)
81 #:use-module (gnu packages java-xml)
82 #:use-module (gnu packages libffi)
83 #:use-module (gnu packages linux) ;alsa
84 #:use-module (gnu packages maths)
85 #:use-module (gnu packages maven)
86 #:use-module (gnu packages maven-parent-pom)
87 #:use-module (gnu packages ncurses)
88 #:use-module (gnu packages nss)
89 #:use-module (gnu packages onc-rpc)
90 #:use-module (gnu packages web)
91 #:use-module (gnu packages wget)
92 #:use-module (gnu packages pkg-config)
93 #:use-module (gnu packages perl)
94 #:use-module (gnu packages popt)
95 #:use-module (gnu packages kerberos)
96 #:use-module (gnu packages security-token)
97 #:use-module (gnu packages xml)
98 #:use-module (gnu packages xdisorg)
99 #:use-module (gnu packages xorg)
100 #:use-module (gnu packages texinfo)
101 #:use-module ((srfi srfi-1) #:select (fold alist-delete))
102 #:use-module (srfi srfi-11)
103 #:use-module (ice-9 match))
104
105(define-public icedtea-7
106 (let* ((version "2.6.13")
107 (drop (lambda* (name hash #:optional (patches '()))
108 (origin
109 (method url-fetch)
110 (uri (string-append
111 "http://icedtea.classpath.org/download/drops"
112 "/icedtea7/" version "/" name ".tar.bz2"))
113 (sha256 (base32 hash))
114 (patches patches)))))
115 (package
116 (name "icedtea")
117 (version version)
118 (source (origin
119 (method url-fetch)
120 (uri (string-append
121 "http://icedtea.wildebeest.org/download/source/icedtea-"
122 version ".tar.xz"))
123 (sha256
124 (base32
125 "1w331rdqx1dcx2xb0fmjmrkdc71xqn20fxsgw8by4xhiblh88khh"))
126 (modules '((guix build utils)))
127 (snippet
128 '(begin
129 (substitute* "Makefile.in"
130 ;; do not leak information about the build host
131 (("DISTRIBUTION_ID=\"\\$\\(DIST_ID\\)\"")
132 "DISTRIBUTION_ID=\"\\\"guix\\\"\""))
133 #t))))
134 (build-system gnu-build-system)
135 (outputs '("out" ; Java Runtime Environment
136 "jdk" ; Java Development Kit
137 "doc")) ; all documentation
138 (arguments
139 `(;; There are many test failures. Some are known to
140 ;; fail upstream, others relate to not having an X
141 ;; server running at test time, yet others are a
142 ;; complete mystery to me.
143
144 ;; hotspot: passed: 241; failed: 45; error: 2
145 ;; langtools: passed: 1,934; failed: 26
146 ;; jdk: unknown
147 #:tests? #f
148
149 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
150 ;; gremlin) doesn't support it yet, so skip this phase.
151 #:validate-runpath? #f
152
153 #:modules ((guix build utils)
154 (guix build gnu-build-system)
155 (ice-9 match)
156 (ice-9 popen)
157 (srfi srfi-19)
158 (srfi srfi-26))
159
160 #:configure-flags
161 ;; TODO: package sctp and add to inputs
162 `("--disable-system-sctp"
163 "--enable-system-pcsc"
164 "--enable-system-lcms"
165 "--enable-bootstrap"
166 "--enable-nss"
167 "--without-rhino"
168 ,(string-append "--with-parallel-jobs="
169 (number->string (parallel-job-count)))
170 "--disable-downloading"
171 "--disable-tests" ;they are run in the check phase instead
172 "--with-openjdk-src-dir=./openjdk.src"
173 ,(string-append "--with-ecj="
174 (assoc-ref %build-inputs "ecj4-javac-wrapper")
175 "/bin/javac")
176 ,(string-append "--with-jdk-home="
177 (assoc-ref %build-inputs "classpath"))
178 ,(string-append "--with-java="
179 (assoc-ref %build-inputs "jamvm")
180 "/bin/jamvm")
181 ,(string-append "--with-jar="
182 (assoc-ref %build-inputs "classpath")
183 "/bin/gjar"))
184 #:phases
185 (modify-phases %standard-phases
186 (replace 'unpack
187 (lambda* (#:key source inputs #:allow-other-keys)
188 (let ((target (string-append "icedtea-" ,version))
189 (unpack (lambda* (name #:optional dir)
190 (let ((dir (or dir
191 (string-drop-right name 5))))
192 (mkdir dir)
193 (invoke "tar" "xvf"
194 (assoc-ref inputs name)
195 "-C" dir
196 "--strip-components=1")))))
197 (mkdir target)
198 (invoke "tar" "xvf" source
199 "-C" target "--strip-components=1")
200 (chdir target)
201 (unpack "openjdk-src" "openjdk.src")
202 (with-directory-excursion "openjdk.src"
203 (for-each unpack
204 (filter (cut string-suffix? "-drop" <>)
205 (map (match-lambda
206 ((name . _) name))
207 inputs)))))))
208 (add-after 'unpack 'use-classpath
209 (lambda* (#:key inputs #:allow-other-keys)
210 (let ((tools (search-input-file inputs "/share/classpath/tools.zip"))
211 (rt.jar (search-input-file inputs "/lib/rt.jar")))
212 ;; GNU Classpath does not provide rt.jar, but jamvm provides
213 ;; Classpath's glibj.zip as rt.jar, so we just use that.
214 (substitute* "Makefile.in"
215 (("\\$\\(SYSTEM_JDK_DIR\\)/jre/lib/rt.jar") rt.jar))
216 ;; Make sure we can find all classes.
217 (setenv "CLASSPATH"
218 (string-append rt.jar ":" tools))
219 (setenv "JAVACFLAGS"
220 (string-append "-cp " rt.jar ":" tools)))))
221 (add-after 'unpack 'patch-bitrot
222 (lambda _
223 (substitute* '("patches/boot/revert-6973616.patch"
224 "openjdk.src/jdk/make/common/shared/Defs-versions.gmk")
225 (("REQUIRED_FREETYPE_VERSION = 2.2.1")
226 "REQUIRED_FREETYPE_VERSION = 2.10.1"))
227 ;; As of attr 2.4.48 this header is no longer
228 ;; included. It is provided by the libc instead.
229 (substitute* '("configure"
230 "openjdk.src/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c")
231 (("attr/xattr.h") "sys/xattr.h"))))
232 (add-after 'unpack 'fix-openjdk
233 (lambda _
234 (substitute* "openjdk.src/jdk/make/common/Defs-linux.gmk"
235 (("CFLAGS_COMMON = -fno-strict-aliasing" all)
236 (string-append all
237 " -fcommon"
238 " -Wno-error=implicit-function-declaration"
239 " -Wno-error=implicit-int"
240 " -Wno-error=incompatible-pointer-types"
241 " -Wno-error=int-conversion")))
242 (substitute*
243 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
244 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
245 (("#include <sys/sysctl.h>")
246 "#include <linux/sysctl.h>"))
247
248 ;; XXX 'ldd' in glibc 2.35 segfaults upon reading
249 ;; openjdk.build-boot/lib/amd64/libnio.so (!).
250 ;; It is only used as a verification step, so ignore it;
251 ;; try removing this substitution for newer versions of glibc.
252 (substitute* "openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
253 (("\\$\\(LDD\\) \\$1 &&")
254 ""))
255
256 ;; It looks like the "h = 31 * h + c" line of the jsum()
257 ;; function gets miscompiled. After a few iterations of the loop
258 ;; the result of "31 * h" is always 0x8000000000000000.
259 ;; Disable optimizations of dump.cpp as a workaround.
260 (substitute* "openjdk.src/hotspot/make/linux/makefiles/gcc.make"
261 (("OPT_CFLAGS/NOOPT.*" all)
262 (string-append all "\n"
263 "OPT_CFLAGS/dump.o += -O0")))))
264 (add-after 'unpack 'fix-x11-extension-include-path
265 (lambda* (#:key inputs #:allow-other-keys)
266 (substitute* "openjdk.src/jdk/make/sun/awt/mawt.gmk"
267 (((string-append "\\$\\(firstword \\$\\(wildcard "
268 "\\$\\(OPENWIN_HOME\\)"
269 "/include/X11/extensions\\).*$"))
270 (string-append (assoc-ref inputs "libxrender")
271 "/include/X11/extensions"
272 " -I" (assoc-ref inputs "libxtst")
273 "/include/X11/extensions"
274 " -I" (assoc-ref inputs "libxinerama")
275 "/include/X11/extensions"))
276 (("\\$\\(wildcard /usr/include/X11/extensions\\)\\)") ""))))
277 (add-after 'unpack 'patch-paths
278 (lambda* (#:key inputs #:allow-other-keys)
279 ;; buildtree.make generates shell scripts, so we need to replace
280 ;; the generated shebang
281 (substitute* '("openjdk.src/hotspot/make/linux/makefiles/buildtree.make")
282 (("/bin/sh") (which "bash")))
283
284 (let ((corebin (string-append
285 (assoc-ref inputs "coreutils") "/bin/"))
286 (binbin (string-append
287 (assoc-ref inputs "binutils") "/bin/"))
288 (grepbin (string-append
289 (assoc-ref inputs "grep") "/bin/")))
290 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-linux.gmk"
291 "openjdk.src/corba/make/common/shared/Defs-linux.gmk")
292 (("UNIXCOMMAND_PATH = /bin/")
293 (string-append "UNIXCOMMAND_PATH = " corebin))
294 (("USRBIN_PATH = /usr/bin/")
295 (string-append "USRBIN_PATH = " corebin))
296 (("DEVTOOLS_PATH *= */usr/bin/")
297 (string-append "DEVTOOLS_PATH = " corebin))
298 (("COMPILER_PATH *= */usr/bin/")
299 (string-append "COMPILER_PATH = "
300 (assoc-ref inputs "gcc") "/bin/"))
301 (("DEF_OBJCOPY *=.*objcopy")
302 (string-append "DEF_OBJCOPY = " (which "objcopy"))))
303
304 ;; fix path to alsa header
305 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
306 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
307 (string-append "ALSA_INCLUDE="
308 (assoc-ref inputs "alsa-lib")
309 "/include/alsa/version.h")))
310
311 ;; fix hard-coded utility paths
312 (substitute* '("openjdk.src/jdk/make/common/shared/Defs-utils.gmk"
313 "openjdk.src/corba/make/common/shared/Defs-utils.gmk")
314 (("ECHO *=.*echo")
315 (string-append "ECHO = " (which "echo")))
316 (("^GREP *=.*grep")
317 (string-append "GREP = " (which "grep")))
318 (("EGREP *=.*egrep")
319 (string-append "EGREP = " (which "egrep")))
320 (("CPIO *=.*cpio")
321 (string-append "CPIO = " (which "cpio")))
322 (("READELF *=.*readelf")
323 (string-append "READELF = " (which "readelf")))
324 (("^ *AR *=.*ar")
325 (string-append "AR = " (which "ar")))
326 (("^ *TAR *=.*tar")
327 (string-append "TAR = " (which "tar")))
328 (("AS *=.*as")
329 (string-append "AS = " (which "as")))
330 (("LD *=.*ld")
331 (string-append "LD = " (which "ld")))
332 (("STRIP *=.*strip")
333 (string-append "STRIP = " (which "strip")))
334 (("NM *=.*nm")
335 (string-append "NM = " (which "nm")))
336 (("^SH *=.*sh")
337 (string-append "SH = " (which "bash")))
338 (("^FIND *=.*find")
339 (string-append "FIND = " (which "find")))
340 (("LDD *=.*ldd")
341 (string-append "LDD = " (which "ldd")))
342 (("NAWK *=.*(n|g)awk")
343 (string-append "NAWK = " (which "gawk")))
344 (("XARGS *=.*xargs")
345 (string-append "XARGS = " (which "xargs")))
346 (("UNZIP *=.*unzip")
347 (string-append "UNZIP = " (which "unzip")))
348 (("ZIPEXE *=.*zip")
349 (string-append "ZIPEXE = " (which "zip")))
350 (("SED *=.*sed")
351 (string-append "SED = " (which "sed"))))
352
353 ;; Some of these timestamps cause problems as they are more than
354 ;; 10 years ago, failing the build process.
355 (substitute*
356 "openjdk.src/jdk/src/share/classes/java/util/CurrencyData.properties"
357 (("AZ=AZM;2005-12-31-20-00-00;AZN") "AZ=AZN")
358 (("MZ=MZM;2006-06-30-22-00-00;MZN") "MZ=MZN")
359 (("RO=ROL;2005-06-30-21-00-00;RON") "RO=RON")
360 (("TR=TRL;2004-12-31-22-00-00;TRY") "TR=TRY")))))
361 (add-before 'configure 'set-additional-paths
362 (lambda* (#:key inputs #:allow-other-keys)
363 (substitute* "openjdk.src/jdk/make/common/shared/Sanity.gmk"
364 (("ALSA_INCLUDE=/usr/include/alsa/version.h")
365 (string-append "ALSA_INCLUDE="
366 (assoc-ref inputs "alsa-lib")
367 "/include/alsa/version.h")))
368 (setenv "CC" "gcc")
369 (setenv "CPATH"
370 (string-append (assoc-ref inputs "libxcomposite")
371 "/include/X11/extensions" ":"
372 (assoc-ref inputs "libxrender")
373 "/include/X11/extensions" ":"
374 (assoc-ref inputs "libxtst")
375 "/include/X11/extensions" ":"
376 (assoc-ref inputs "libxinerama")
377 "/include/X11/extensions" ":"
378 (or (getenv "CPATH") "")))
379 (setenv "ALT_OBJCOPY" (which "objcopy"))
380 (setenv "ALT_CUPS_HEADERS_PATH"
381 (string-append (assoc-ref inputs "cups")
382 "/include"))
383 (setenv "ALT_FREETYPE_HEADERS_PATH"
384 (string-append (assoc-ref inputs "freetype")
385 "/include"))
386 (setenv "ALT_FREETYPE_LIB_PATH"
387 (string-append (assoc-ref inputs "freetype")
388 "/lib"))))
389 (add-before 'build 'disable-os-version-check
390 ;; allow build on linux major version change
391 (lambda _
392 (setenv "DISABLE_HOTSPOT_OS_VERSION_CHECK" "ok")))
393 (add-before 'check 'fix-test-framework
394 (lambda _
395 ;; Fix PATH in test environment
396 (substitute* "test/jtreg/com/sun/javatest/regtest/Main.java"
397 (("PATH=/bin:/usr/bin")
398 (string-append "PATH=" (getenv "PATH"))))
399 (substitute* "test/jtreg/com/sun/javatest/util/SysEnv.java"
400 (("/usr/bin/env") (which "env")))
401 (substitute* "openjdk.src/hotspot/test/test_env.sh"
402 (("/bin/rm") (which "rm"))
403 (("/bin/cp") (which "cp"))
404 (("/bin/mv") (which "mv")))))
405 (add-before 'check 'fix-hotspot-tests
406 (lambda _
407 (with-directory-excursion "openjdk.src/hotspot/test/"
408 (substitute* "jprt.config"
409 (("PATH=\"\\$\\{path4sdk\\}\"")
410 (string-append "PATH=" (getenv "PATH")))
411 (("make=/usr/bin/make")
412 (string-append "make=" (which "make"))))
413 (substitute* '("runtime/6626217/Test6626217.sh"
414 "runtime/7110720/Test7110720.sh")
415 (("/bin/rm") (which "rm"))
416 (("/bin/cp") (which "cp"))
417 (("/bin/mv") (which "mv"))))))
418 (add-before 'check 'fix-jdk-tests
419 (lambda _
420 (with-directory-excursion "openjdk.src/jdk/test/"
421 (substitute* "com/sun/jdi/JdbReadTwiceTest.sh"
422 (("/bin/pwd") (which "pwd")))
423 (substitute* "com/sun/jdi/ShellScaffold.sh"
424 (("/bin/kill") (which "kill")))
425 (substitute* "start-Xvfb.sh"
426 ;;(("/usr/bin/X11/Xvfb") (which "Xvfb"))
427 (("/usr/bin/nohup") (which "nohup")))
428 (substitute* "javax/security/auth/Subject/doAs/Test.sh"
429 (("/bin/rm") (which "rm")))
430 (substitute* "tools/launcher/MultipleJRE.sh"
431 (("echo \"#!/bin/sh\"")
432 (string-append "echo \"#!" (which "rm") "\""))
433 (("/usr/bin/zip") (which "zip")))
434 (substitute* "com/sun/jdi/OnThrowTest.java"
435 (("#!/bin/sh") (string-append "#!" (which "sh"))))
436 (substitute* "java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java"
437 (("/usr/bin/uptime") (which "uptime")))
438 (substitute* "java/lang/ProcessBuilder/Basic.java"
439 (("/usr/bin/env") (which "env"))
440 (("/bin/false") (which "false"))
441 (("/bin/true") (which "true"))
442 (("/bin/cp") (which "cp"))
443 (("/bin/sh") (which "sh")))
444 (substitute* "java/lang/ProcessBuilder/FeelingLucky.java"
445 (("/bin/sh") (which "sh")))
446 (substitute* "java/lang/ProcessBuilder/Zombies.java"
447 (("/usr/bin/perl") (which "perl"))
448 (("/bin/ps") (which "ps"))
449 (("/bin/true") (which "true")))
450 (substitute* "java/lang/Runtime/exec/ConcurrentRead.java"
451 (("/usr/bin/tee") (which "tee")))
452 (substitute* "java/lang/Runtime/exec/ExecWithDir.java"
453 (("/bin/true") (which "true")))
454 (substitute* "java/lang/Runtime/exec/ExecWithInput.java"
455 (("/bin/cat") (which "cat")))
456 (substitute* "java/lang/Runtime/exec/ExitValue.java"
457 (("/bin/sh") (which "sh"))
458 (("/bin/true") (which "true"))
459 (("/bin/kill") (which "kill")))
460 (substitute* "java/lang/Runtime/exec/LotsOfDestroys.java"
461 (("/usr/bin/echo") (which "echo")))
462 (substitute* "java/lang/Runtime/exec/LotsOfOutput.java"
463 (("/usr/bin/cat") (which "cat")))
464 (substitute* "java/lang/Runtime/exec/SleepyCat.java"
465 (("/bin/cat") (which "cat"))
466 (("/bin/sleep") (which "sleep"))
467 (("/bin/sh") (which "sh")))
468 (substitute* "java/lang/Runtime/exec/StreamsSurviveDestroy.java"
469 (("/bin/cat") (which "cat")))
470 (substitute* "java/rmi/activation/CommandEnvironment/SetChildEnv.java"
471 (("/bin/chmod") (which "chmod")))
472 (substitute* "java/util/zip/ZipFile/Assortment.java"
473 (("/bin/sh") (which "sh"))))))
474 (replace 'check
475 (lambda* (#:key tests? #:allow-other-keys)
476 ;; The "make check-*" targets always return zero, so we need to
477 ;; check for errors in the associated log files to determine
478 ;; whether any tests have failed.
479 (when tests?
480 (use-modules (ice-9 rdelim))
481 (let* ((error-pattern (make-regexp "^(Error|FAILED):.*"))
482 (checker (lambda (port)
483 (let loop ()
484 (let ((line (read-line port)))
485 (cond
486 ((eof-object? line) #t)
487 ((regexp-exec error-pattern line)
488 (error "test failed"))
489 (else (loop)))))))
490 (run-test (lambda (test)
491 (invoke "make" test)
492 (call-with-input-file
493 (string-append "test/" test ".log")
494 checker))))
495 (run-test "check-hotspot")
496 (run-test "check-langtools")
497 (run-test "check-jdk")))))
498 (replace 'install
499 (lambda* (#:key outputs #:allow-other-keys)
500 (let ((doc (string-append (assoc-ref outputs "doc")
501 "/share/doc/icedtea"))
502 (jre (assoc-ref outputs "out"))
503 (jdk (assoc-ref outputs "jdk")))
504 (copy-recursively "openjdk.build/docs" doc)
505 (copy-recursively "openjdk.build/j2re-image" jre)
506 (copy-recursively "openjdk.build/j2sdk-image" jdk))))
507 ;; Some of the libraries in the lib/amd64 folder link to libjvm.so.
508 ;; But that shared object is located in the server/ folder, so it
509 ;; cannot be found. This phase creates a symbolic link in the
510 ;; lib/amd64 folder so that the other libraries can find it.
511 ;;
512 ;; See:
513 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
514 ;;
515 ;; FIXME: Find the bug in the build system, so that this symlink is
516 ;; not needed.
517 (add-after 'install 'install-libjvm
518 (lambda* (#:key inputs outputs #:allow-other-keys)
519 (let* ((lib-path (string-append (assoc-ref outputs "out")
520 ;; See 'INSTALL_ARCH_DIR' in
521 ;; 'configure'.
522 ,(match (%current-system)
523 ("i686-linux"
524 "/lib/i386")
525 ("x86_64-linux"
526 "/lib/amd64")
527 ("armhf-linux"
528 "/lib/arm")
529 ("aarch64-linux"
530 "/lib/aarch64")
531 ("powerpc-linux"
532 "/lib/ppc")
533 ;; We need a catch-all, dropping
534 ;; '-linux' works in most cases.
535 (_
536 (string-append
537 "/lib/"
538 (string-drop-right
539 (%current-system) 6)))))))
540 (symlink (string-append lib-path "/server/libjvm.so")
541 (string-append lib-path "/libjvm.so")))))
542 ;; By default IcedTea only generates an empty keystore. In order to
543 ;; be able to use certificates in Java programs we need to generate a
544 ;; keystore from a set of certificates. For convenience we use the
545 ;; certificates from the nss-certs package.
546 (add-after 'install 'install-keystore
547 (lambda* (#:key inputs outputs #:allow-other-keys)
548 (use-modules (ice-9 rdelim))
549 (let* ((keystore "cacerts")
550 (certs-dir (search-input-directory inputs
551 "etc/ssl/certs"))
552 (keytool (string-append (assoc-ref outputs "jdk")
553 "/bin/keytool")))
554 (define (extract-cert file target)
555 (call-with-input-file file
556 (lambda (in)
557 (call-with-output-file target
558 (lambda (out)
559 (let loop ((line (read-line in 'concat))
560 (copying? #f))
561 (cond
562 ((eof-object? line) #t)
563 ((string-prefix? "-----BEGIN" line)
564 (display line out)
565 (loop (read-line in 'concat) #t))
566 ((string-prefix? "-----END" line)
567 (display line out)
568 #t)
569 (else
570 (when copying? (display line out))
571 (loop (read-line in 'concat) copying?)))))))))
572 (define (import-cert cert)
573 (format #t "Importing certificate ~a\n" (basename cert))
574 (let ((temp "tmpcert"))
575 (extract-cert cert temp)
576 (let ((port (open-pipe* OPEN_WRITE keytool
577 "-import"
578 "-alias" (basename cert)
579 "-keystore" keystore
580 "-storepass" "changeit"
581 "-file" temp)))
582 (display "yes\n" port)
583 (when (not (zero? (status:exit-val (close-pipe port))))
584 (format #t "failed to import ~a\n" cert)))
585 (delete-file temp)))
586
587 ;; This is necessary because the certificate directory contains
588 ;; files with non-ASCII characters in their names.
589 (setlocale LC_ALL "C.UTF-8")
590 (setenv "LC_ALL" "C.UTF-8")
591
592 (for-each import-cert (find-files certs-dir "\\.pem$"))
593 (mkdir-p (string-append (assoc-ref outputs "out")
594 "/lib/security"))
595 (mkdir-p (string-append (assoc-ref outputs "jdk")
596 "/jre/lib/security"))
597
598 ;; The cacerts files we are going to overwrite are chmod'ed as
599 ;; read-only (444) in icedtea-8 (which derives from this
600 ;; package). We have to change this so we can overwrite them.
601 (chmod (string-append (assoc-ref outputs "out")
602 "/lib/security/" keystore) #o644)
603 (chmod (string-append (assoc-ref outputs "jdk")
604 "/jre/lib/security/" keystore) #o644)
605
606 (install-file keystore
607 (string-append (assoc-ref outputs "out")
608 "/lib/security"))
609 (install-file keystore
610 (string-append (assoc-ref outputs "jdk")
611 "/jre/lib/security"))))))))
612 (native-inputs
613 ;; XXX: Compiling with gcc-14 will encounter the following error:
614 ;; BUILD FAILED:
615 ;; /tmp/guix-build-icedtea-2.6.13.drv-0/icedtea-2.6.13/openjdk/langtools/
616 ;; make/build.xml:452: The following error occurred while executing this
617 ;; line:
618 ;; java.lang.AbstractMethodError: java.lang.Throwable.toString()Ljava/lang/String;
619 `(("gcc" ,gcc-13)
620 ("openjdk-src"
621 ,(drop "openjdk"
622 "0l34ikyf62hbzlf9032alzkkqvf7bpmckz4gvirvph755w7gka8l"))
623 ("corba-drop"
624 ,(drop "corba"
625 "050gv2jbg1pi6qkn8w18bwpbklfa5b0kymjvan9pncddbj8m84fz"))
626 ("jaxp-drop"
627 ,(drop "jaxp"
628 "1k6yldwnxfzdg5926r1nlfv8d1r1j7rlp2nkz6gqh05vgyamnfhl"))
629 ("jaxws-drop"
630 ,(drop "jaxws"
631 "110j7jlz47x2gg6f7653x12mssan5kvj9l9h1m1c8c92drfxbqyk"))
632 ("jdk-drop"
633 ,(drop "jdk"
634 "0d1mca38ksxvdskp9im3pp7fdijhj1n3lwq9w13r9s4v3qyskgdd"
635 (search-patches "jdk-currency-time-bomb.patch")))
636 ("langtools-drop"
637 ,(drop "langtools"
638 "0nq5236fzxn3p6x8cgncl56mzcmsj07q9gymysnws4c8byc6n0qj"))
639 ("hotspot-drop"
640 ,(origin
641 (method url-fetch)
642 (uri (string-append
643 "http://icedtea.classpath.org/downloads/drops"
644 "/icedtea7/" version "/hotspot.tar.bz2"))
645 (sha256
646 (base32
647 "17bdv39n4lh8l5737c96f3xgamx4y305m067p01cywgp7zaddqws"))
648 (patches (search-patches
649 "icedtea-7-hotspot-aarch64-use-c++98.patch"
650 "icedtea-7-hotspot-pointer-comparison.patch"))))
651 ("ant" ,ant-bootstrap)
652 ("attr" ,attr)
653 ("classpath" ,classpath-devel)
654 ("coreutils" ,coreutils)
655 ("diffutils" ,diffutils) ;for tests
656 ("ecj4-javac-wrapper" ,ecj4-javac-wrapper)
657 ("fastjar" ,fastjar) ;only for the configure phase; we actually use gjar
658 ("gawk" ,gawk)
659 ("grep" ,grep)
660 ("jamvm" ,jamvm-with-ecj4)
661 ("libtool" ,libtool)
662 ("pkg-config" ,pkg-config)
663 ("wget" ,wget)
664 ("which" ,which)
665 ("cpio" ,cpio)
666 ("zip" ,zip)
667 ("unzip" ,unzip)
668 ("libxslt" ,libxslt) ;for xsltproc
669 ("nss-certs" ,nss-certs)
670 ("perl" ,perl)
671 ("procps" ,procps))) ;for "free", even though I'm not sure we should use it
672 (inputs
673 (list alsa-lib
674 cups
675 fontconfig
676 freetype
677 giflib
678 gtk+-2
679 lcms
680 libjpeg-turbo
681 libpng
682 libx11
683 libxcomposite
684 libxi
685 libxinerama
686 libxrender
687 libxt
688 libxtst
689 mit-krb5
690 nss
691 pcsc-lite
692 zlib))
693 (home-page "https://icedtea.classpath.org")
694 (synopsis "Java development kit")
695 (description
696 "This package provides the Java development kit OpenJDK built with the
697IcedTea build harness.")
698
699 ;; 'configure' lists "mips" and "mipsel", but not "mips64el'.
700 (supported-systems (delete "mips64el-linux" %supported-systems))
701
702 ;; IcedTea is released under the GPL2 + Classpath exception, which is the
703 ;; same license as both GNU Classpath and OpenJDK.
704 (license license:gpl2+))))
705
706(define-public icedtea-8
707 (let* ((version "3.19.0")
708 (drop (lambda* (name hash #:optional (patches '()))
709 (origin
710 (method url-fetch)
711 (uri (string-append
712 "http://icedtea.classpath.org/download/drops"
713 "/icedtea8/" version "/" name ".tar.xz"))
714 (sha256 (base32 hash))
715 (patches patches)))))
716 (package (inherit icedtea-7)
717 (version "3.19.0")
718 (source (origin
719 (method url-fetch)
720 (uri (string-append
721 "http://icedtea.wildebeest.org/download/source/icedtea-"
722 version ".tar.xz"))
723 (sha256
724 (base32
725 "1cmms7cb2sav3ywc36ynqmybzx73sl279rm6j8i5nqrmp98ixmpf"))
726 (modules '((guix build utils)))
727 (snippet
728 '(substitute* '("configure"
729 "acinclude.m4")
730 ;; Do not embed build time
731 (("(DIST_ID=\"Custom build).*$" _ prefix)
732 (string-append prefix "\"\n"))
733 ;; Do not leak information about the build host
734 (("DIST_NAME=\"\\$build_os\"")
735 "DIST_NAME=\"guix\"")))))
736 (arguments
737 `(#:imported-modules
738 ((guix build ant-build-system)
739 ,@%default-gnu-imported-modules)
740
741 #:disallowed-references ,(list (gexp-input icedtea-7 "jdk"))
742
743 ,@(substitute-keyword-arguments (package-arguments icedtea-7)
744 ((#:modules modules)
745 `((guix build utils)
746 (guix build gnu-build-system)
747 ((guix build ant-build-system) #:prefix ant:)
748 (ice-9 match)
749 (ice-9 popen)
750 (srfi srfi-19)
751 (srfi srfi-26)))
752 ((#:configure-flags flags)
753 `(let ((jdk (assoc-ref %build-inputs "jdk")))
754 `(,(string-append "CFLAGS=-fcommon"
755 " -Wno-error=implicit-function-declaration"
756 " -Wno-error=implicit-int"
757 " -Wno-error=incompatible-pointer-types"
758 " -Wno-error=int-conversion")
759 "CXXFLAGS=-fcommon"
760 "--enable-bootstrap"
761 "--enable-nss"
762 ,(string-append "--with-parallel-jobs="
763 (number->string (parallel-job-count)))
764 ;; Java Flight Recorder isn't supported on some architectures.
765 ,@(if ,(target-ppc32?)
766 `("--enable-jfr=no")
767 '())
768 "--disable-docs" ; This phase can take hours on slow machines.
769 "--disable-downloading"
770 "--disable-system-pcsc"
771 "--disable-system-sctp"
772 "--disable-tests" ;they are run in the check phase instead
773 "--with-openjdk-src-dir=./openjdk.src"
774 ,(string-append "--with-jdk-home=" jdk))))
775 ((#:phases phases)
776 `(modify-phases ,phases
777 (delete 'fix-x11-extension-include-path)
778 (delete 'patch-paths)
779 (delete 'set-additional-paths)
780 (delete 'patch-patches)
781 (delete 'patch-bitrot)
782 (delete 'use-classpath)
783 ;; Prevent passing -j (parallel-job-count) to make
784 (replace 'build
785 (lambda* (#:key (make-flags '()) #:allow-other-keys)
786 (apply invoke "make" make-flags)))
787 ;; Prevent the keytool from recording the current time when
788 ;; adding certificates at build time.
789 (add-after 'unpack 'patch-keystore
790 (lambda _
791 (substitute* "openjdk.src/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java"
792 (("date = new Date\\(\\);")
793 "\
794date = (System.getenv(\"SOURCE_DATE_EPOCH\") != null) ?\
795new Date(Long.parseLong(System.getenv(\"SOURCE_DATE_EPOCH\"))) :\
796new Date();"))
797 #t))
798 (add-after 'unpack 'patch-jni-libs
799 ;; Hardcode dynamically loaded libraries.
800 (lambda _
801 (define remove
802 (@ (srfi srfi-1) remove))
803
804 (define (icedtea-or-openjdk? path)
805 (or (string-contains path "openjdk")
806 (string-contains path "icedtea")))
807
808 (let* ((library-path (remove icedtea-or-openjdk?
809 (search-path-as-string->list
810 (getenv "LIBRARY_PATH"))))
811 (find-library (lambda (name)
812 (or (search-path
813 library-path
814 (string-append "lib" name ".so"))
815 (string-append "lib" name ".so")))))
816 (for-each
817 (lambda (file)
818 (catch 'decoding-error
819 (lambda ()
820 (substitute* file
821 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
822 _ name version)
823 (string-append "\"" (find-library name) "\""))
824 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
825 (string-append "\"" (find-library name) "\""))))
826 (lambda _
827 ;; Those are safe to skip.
828 (format (current-error-port)
829 "warning: failed to substitute: ~a~%"
830 file))))
831 (find-files "openjdk.src/jdk/src/solaris/native"
832 "\\.c|\\.h")))))
833 (replace 'fix-openjdk
834 (lambda _
835 (substitute*
836 '("openjdk.src/jdk/src/solaris/native/java/net/PlainSocketImpl.c"
837 "openjdk.src/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c")
838 (("#include <sys/sysctl.h>")
839 "#include <linux/sysctl.h>"))))
840 (replace 'install
841 (lambda* (#:key outputs #:allow-other-keys)
842 (let ((doc (string-append (assoc-ref outputs "doc")
843 "/share/doc/icedtea"))
844 (jre (assoc-ref outputs "out"))
845 (jdk (assoc-ref outputs "jdk")))
846 (copy-recursively "openjdk.build/docs" doc)
847 (copy-recursively "openjdk.build/images/j2re-image" jre)
848 (copy-recursively "openjdk.build/images/j2sdk-image" jdk)
849 ;; Install the nss.cfg file to JRE to enable SSL/TLS
850 ;; support via NSS.
851 (copy-file (string-append jdk "/jre/lib/security/nss.cfg")
852 (string-append jre "/lib/security/nss.cfg")))))
853 (add-after 'install 'strip-jar-timestamps
854 (assoc-ref ant:%standard-phases 'strip-jar-timestamps)))))))
855 (native-inputs
856 `(("jdk" ,icedtea-7 "jdk")
857 ("openjdk-src"
858 ,(drop "openjdk"
859 "1l3bzmd3s38scxpwamfhnwbv7vndgjq6hz3bl58437fgl9kgbl69"))
860 ("aarch32-drop"
861 ,(drop "aarch32"
862 "0k4dwpi3x3lj41rj32xyxbn76r7cb2g2whh44r1z4iwhw1xd2lpq"))
863 ("corba-drop"
864 ,(drop "corba"
865 "0xhh6gf5gh5c6vf1607xcy49wnp5prch2rim13x14wvsn817xf0r"))
866 ("jaxp-drop"
867 ,(drop "jaxp"
868 "043g335rgi5ipl8dp3q2cc3gcfhxk77ipxs43sv344z71bn8xmxr"))
869 ("jaxws-drop"
870 ,(drop "jaxws"
871 "1pc0pv4v2mn2mjc0vp19d94v2150xigyhxsmckqasy647zcm6w0r"))
872 ("jdk-drop"
873 ,(drop "jdk"
874 "1742lcm55l8zhi522x83v65ccr0rd6511q9rj7crw44x3ymdrhrv"
875 (search-patches "jdk-currency-time-bomb2.patch")))
876 ("langtools-drop"
877 ,(drop "langtools"
878 "08iz7p2xcddlphipf6gahyabr5cawlnydap12p1n4f0md069b50b"))
879 ("hotspot-drop"
880 ,(drop "hotspot"
881 "1ffaxfnb3yn1i7crivqigc1r1q0z6cp044i6nfring4z6c8pfhd2"))
882 ("nashorn-drop"
883 ,(drop "nashorn"
884 "15fn7cpm2i1npa88h57njxg0f8qkrqhrc30pb54d3hxlx5zyjl94"))
885 ("shenandoah-drop"
886 ,(drop "shenandoah"
887 "1jjzjjx1ykyhbc4llh8249dlr8j5g1ki6r7g9baj2mxyb9whc5nq"))
888 ,@(fold alist-delete (package-native-inputs icedtea-7)
889 '("openjdk-src" "corba-drop" "jaxp-drop" "jaxws-drop"
890 "jdk-drop" "langtools-drop" "hotspot-drop"
891 "classpath" "ecj4-javac-wrapper" "jamvm" "fastjar")))))))
892
893(define-public icedtea icedtea-8)
894
895(define-public openjdk9
896 (package
897 (name "openjdk")
898 (version "9.181")
899 (source (origin
900 (method hg-fetch)
901 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
902 (changeset "jdk-9+181")))
903 (file-name (hg-file-name name version))
904 (modules '((guix build utils)))
905 (snippet '(for-each delete-file
906 (find-files "." ".*.(bin|exe|jar)$")))
907 (sha256
908 (base32
909 "1v92nzdqx07c35x945awzir4yk0fk22vky6fpp8mq9js930sxsz0"))
910 (patches
911 (search-patches "openjdk-9-pointer-comparison.patch"
912 "openjdk-9-classlist-reproducibility.patch"
913 "openjdk-currency-time-bomb.patch"
914 "openjdk-9-jar-reproducibility.patch"
915 "openjdk-9-module-reproducibility.patch"
916 "openjdk-9-module2-reproducibility.patch"
917 "openjdk-9-module3-reproducibility.patch"
918 "openjdk-9-idlj-reproducibility.patch"
919 "openjdk-9-setsignalhandler.patch"))))
920 (build-system gnu-build-system)
921 (outputs '("out" "jdk" "doc"))
922 (arguments
923 `(#:imported-modules
924 ((guix build ant-build-system)
925 ,@%default-gnu-imported-modules)
926 #:modules
927 ((guix build utils)
928 (guix build gnu-build-system)
929 (ice-9 popen))
930 #:tests? #f ; require jtreg
931 #:make-flags '("all")
932 #:disallowed-references ,(list (gexp-input icedtea-8)
933 (gexp-input icedtea-8 "jdk"))
934
935 #:phases
936 (modify-phases %standard-phases
937 ,@(if (target-aarch64?)
938 `((add-after 'unpack 'patch-for-aarch64
939 (lambda _
940 (substitute* "hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp"
941 ;; This line is duplicated, so remove both occurrences,
942 ;; then add back one occurrence by substituting a
943 ;; comment that occurs once.
944 (("using MacroAssembler::call_VM_leaf_base;") "")
945 (("Interpreter specific version of call_VM_base")
946 "Interpreter specific version of call_VM_base
947 using MacroAssembler::call_VM_leaf_base;")))))
948 '())
949 (add-after 'patch-source-shebangs 'fix-java-shebangs
950 (lambda _
951 ;; This file was "fixed" by patch-source-shebangs, but it requires
952 ;; this exact first line.
953 (substitute* "jdk/make/data/blacklistedcertsconverter/blacklisted.certs.pem"
954 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
955 (replace 'configure
956 (lambda* (#:key inputs outputs #:allow-other-keys)
957 ;; TODO: unbundle libpng and lcms
958 (invoke "bash" "./configure"
959 ;; Add flags for compilation with gcc >= 10
960 ,(string-append "--with-extra-cflags=-fcommon"
961 " -fno-delete-null-pointer-checks"
962 " -fno-lifetime-dse"
963 ;; flags for compilation with gcc >= 14.
964 " -Wno-error=int-conversion")
965 (string-append "--with-freetype="
966 (assoc-ref inputs "freetype"))
967 "--disable-freetype-bundling"
968 "--disable-warnings-as-errors"
969 "--disable-hotspot-gtest"
970 "--with-giflib=system"
971 "--with-libjpeg=system"
972 (string-append "--prefix=" (assoc-ref outputs "out")))))
973 (add-before 'build 'write-source-revision-file
974 (lambda _
975 (with-output-to-file ".src-rev"
976 (lambda _
977 (display ,version)))))
978 (replace 'build
979 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
980 (apply invoke "make"
981 `(,@(if parallel-build?
982 (list (string-append "JOBS="
983 (number->string (parallel-job-count))))
984 '("JOBS=1"))
985 ,@make-flags))))
986 (add-after 'unpack 'patch-jni-libs
987 ;; Hardcode dynamically loaded libraries.
988 (lambda _
989 (define remove
990 (@ (srfi srfi-1) remove))
991
992 (define (icedtea-or-openjdk? path)
993 (or (string-contains path "openjdk")
994 (string-contains path "icedtea")))
995
996 (let* ((library-path (remove icedtea-or-openjdk?
997 (search-path-as-string->list
998 (getenv "LIBRARY_PATH"))))
999 (find-library (lambda (name)
1000 (or (search-path
1001 library-path
1002 (string-append "lib" name ".so"))
1003 (string-append "lib" name ".so")))))
1004 (for-each
1005 (lambda (file)
1006 (catch 'decoding-error
1007 (lambda ()
1008 (substitute* file
1009 (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", \"(.*)\"\\)"
1010 _ name version)
1011 (string-append "\"" (find-library name) "\""))
1012 (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name)
1013 (string-append "\"" (find-library name) "\""))))
1014 (lambda _
1015 ;; Those are safe to skip.
1016 (format (current-error-port)
1017 "warning: failed to substitute: ~a~%"
1018 file))))
1019 (find-files "."
1020 "\\.c$|\\.h$")))))
1021 ;; By default OpenJDK only generates an empty keystore. In order to
1022 ;; be able to use certificates in Java programs we need to generate a
1023 ;; keystore from a set of certificates. For convenience we use the
1024 ;; certificates from the nss-certs package.
1025 (add-after 'install 'install-keystore
1026 (lambda* (#:key inputs outputs #:allow-other-keys)
1027 (use-modules (ice-9 rdelim))
1028 (let* ((keystore "cacerts")
1029 (certs-dir (search-input-directory inputs
1030 "etc/ssl/certs"))
1031 (keytool (string-append (assoc-ref outputs "jdk")
1032 "/bin/keytool")))
1033 (define (extract-cert file target)
1034 (call-with-input-file file
1035 (lambda (in)
1036 (call-with-output-file target
1037 (lambda (out)
1038 (let loop ((line (read-line in 'concat))
1039 (copying? #f))
1040 (cond
1041 ((eof-object? line) #t)
1042 ((string-prefix? "-----BEGIN" line)
1043 (display line out)
1044 (loop (read-line in 'concat) #t))
1045 ((string-prefix? "-----END" line)
1046 (display line out)
1047 #t)
1048 (else
1049 (when copying? (display line out))
1050 (loop (read-line in 'concat) copying?)))))))))
1051 (define (import-cert cert)
1052 (format #t "Importing certificate ~a\n" (basename cert))
1053 (let ((temp "tmpcert"))
1054 (extract-cert cert temp)
1055 (let ((port (open-pipe* OPEN_WRITE keytool
1056 "-import"
1057 "-alias" (basename cert)
1058 "-keystore" keystore
1059 "-storepass" "changeit"
1060 "-file" temp)))
1061 (display "yes\n" port)
1062 (when (not (zero? (status:exit-val (close-pipe port))))
1063 (format #t "failed to import ~a\n" cert)))
1064 (delete-file temp)))
1065
1066 ;; This is necessary because the certificate directory contains
1067 ;; files with non-ASCII characters in their names.
1068 (setlocale LC_ALL "C.UTF-8")
1069 (setenv "LC_ALL" "C.UTF-8")
1070
1071 (copy-file (string-append (assoc-ref outputs "out")
1072 "/lib/security/cacerts")
1073 keystore)
1074 (chmod keystore #o644)
1075 (for-each import-cert (find-files certs-dir "\\.pem$"))
1076 (mkdir-p (string-append (assoc-ref outputs "out")
1077 "/lib/security"))
1078 (mkdir-p (string-append (assoc-ref outputs "jdk")
1079 "/lib/security"))
1080
1081 ;; The cacerts files we are going to overwrite are chmod'ed as
1082 ;; read-only (444) in icedtea-8 (which derives from this
1083 ;; package). We have to change this so we can overwrite them.
1084 (chmod (string-append (assoc-ref outputs "out")
1085 "/lib/security/" keystore) #o644)
1086 (chmod (string-append (assoc-ref outputs "jdk")
1087 "/lib/security/" keystore) #o644)
1088
1089 (install-file keystore
1090 (string-append (assoc-ref outputs "out")
1091 "/lib/security"))
1092 (install-file keystore
1093 (string-append (assoc-ref outputs "jdk")
1094 "/lib/security")))))
1095 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1096 ;; But that shared object is located in the server/ folder, so it
1097 ;; cannot be found. This phase creates a symbolic link in the
1098 ;; lib/ folder so that the other libraries can find it.
1099 ;;
1100 ;; See:
1101 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1102 ;;
1103 ;; FIXME: Find the bug in the build system, so that this symlink is
1104 ;; not needed.
1105 (add-after 'install 'install-libjvm
1106 (lambda* (#:key inputs outputs #:allow-other-keys)
1107 (let* ((lib-out (string-append (assoc-ref outputs "out")
1108 "/lib"))
1109 (lib-jdk (string-append (assoc-ref outputs "jdk")
1110 "/lib")))
1111 (symlink (string-append lib-jdk "/server/libjvm.so")
1112 (string-append lib-jdk "/libjvm.so"))
1113 (symlink (string-append lib-out "/server/libjvm.so")
1114 (string-append lib-out "/libjvm.so")))))
1115 (replace 'install
1116 (lambda* (#:key outputs #:allow-other-keys)
1117 (let ((out (assoc-ref outputs "out"))
1118 (jdk (assoc-ref outputs "jdk"))
1119 (doc (assoc-ref outputs "doc"))
1120 (images (car (find-files "build" ".*-server-release"
1121 #:directories? #t))))
1122 (copy-recursively (string-append images "/images/jdk") jdk)
1123 (copy-recursively (string-append images "/images/jre") out)
1124 (copy-recursively (string-append images "/images/docs") doc))))
1125 (add-after 'install 'strip-zip-timestamps
1126 (lambda* (#:key outputs #:allow-other-keys)
1127 (for-each
1128 (lambda (zip)
1129 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1130 (with-directory-excursion dir
1131 ;; This is an exact copy of the implementation of invoke,
1132 ;; but this accepts exit code 1 as OK.
1133 (let ((code (system* "unzip" "--" zip)))
1134 ;; jmod files are zip files with an extra header in
1135 ;; front. unzip will warn about that -- but otherwise
1136 ;; work.
1137 (when (> (status:exit-val code) 1) ; 1 is just a warning
1138 (raise
1139 (condition
1140 (&invoke-error
1141 (program "unzip")
1142 (arguments (list "--" zip))
1143 (exit-status (status:exit-val code))
1144 (term-signal (status:term-sig code))
1145 (stop-signal (status:stop-sig code))))))))
1146 (delete-file zip)
1147 (for-each (lambda (file)
1148 (let ((s (lstat file)))
1149 (format #t "reset ~a~%" file)
1150 (utime file 1 1 0 0
1151 AT_SYMLINK_NOFOLLOW)))
1152 (find-files dir #:directories? #t))
1153 (with-directory-excursion dir
1154 (let ((files (cons "./META-INF/MANIFEST.MF"
1155 (append
1156 (find-files "./META-INF" ".*")
1157 ;; for jmod:
1158 (list "./classes/module-info.class")
1159 (find-files "." ".*")))))
1160 (apply invoke "zip" "--symlinks" "-0" "-X" zip files)
1161 (when (string-suffix? ".jmod" zip)
1162 (let ((new-zip (string-append zip "n"))
1163 (contents (call-with-input-file zip
1164 (@ (ice-9 binary-ports)
1165 get-bytevector-all))))
1166 (call-with-output-file new-zip
1167 (lambda (output-port)
1168 ((@ (ice-9 binary-ports) put-bytevector)
1169 output-port
1170 #vu8(#x4a #x4d #x01 #x00)) ; JM
1171 ((@ (ice-9 binary-ports) put-bytevector)
1172 output-port
1173 contents)))
1174 (rename-file new-zip zip)))))))
1175 (append (find-files (string-append
1176 (assoc-ref outputs "doc")
1177 "/api")
1178 "\\.zip$")
1179 (find-files (assoc-ref outputs "doc") "src\\.zip$")
1180 (find-files (assoc-ref outputs "jdk") "src\\.zip$")
1181 (find-files (assoc-ref outputs "jdk") "\\.jmod$")
1182 (find-files (assoc-ref outputs "jdk") "\\.diz$")
1183 (find-files (assoc-ref outputs "out") "\\.diz$")
1184
1185 (list (string-append (assoc-ref outputs "jdk")
1186 "/lib/jrt-fs.jar"))
1187 (find-files (string-append (assoc-ref outputs "jdk")
1188 "/demo")
1189 "\\.jar$"))))))))
1190 (inputs
1191 (list alsa-lib
1192 cups
1193 fontconfig
1194 freetype
1195 giflib
1196 lcms
1197 elfutils
1198 libjpeg-turbo
1199 libice
1200 libpng
1201 libx11
1202 libxcomposite
1203 libxi
1204 libxinerama
1205 libxrender
1206 libxt
1207 libxtst))
1208 (native-inputs
1209 (list icedtea-8
1210 `(,icedtea-8 "jdk")
1211 ;; XXX: The build system fails with newer versions of GNU Make.
1212 gnu-make-4.2
1213 nss-certs
1214 unzip
1215 which
1216 zip))
1217 (home-page "https://openjdk.org/projects/jdk9/")
1218 (synopsis "Java development kit")
1219 (description
1220 "This package provides the Java development kit OpenJDK.")
1221 (license license:gpl2+)))
1222
1223(define-public openjdk10
1224 (package
1225 (inherit openjdk9)
1226 (name "openjdk")
1227 (version "10.46")
1228 (source (origin
1229 (method hg-fetch)
1230 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk")
1231 (changeset "jdk-10+46")))
1232 (file-name (hg-file-name name version))
1233 (modules '((guix build utils)))
1234 (snippet `(begin
1235 (for-each delete-file
1236 (find-files "." ".*.(bin|exe|jar)$"))))
1237 (sha256
1238 (base32
1239 "0i47ar8lxzjrkkiwbzybfxs473390h4jq9ahm3xqdvy5zpchxy3y"))
1240 (patches (search-patches
1241 "openjdk-10-char-reproducibility.patch"
1242 "openjdk-10-classlist-reproducibility.patch"
1243 "openjdk-10-corba-reproducibility.patch"
1244 "openjdk-10-idlj-reproducibility.patch"
1245 "openjdk-10-module-reproducibility.patch"
1246 "openjdk-10-module3-reproducibility.patch"
1247 "openjdk-10-module4-reproducibility.patch"
1248 "openjdk-10-jar-reproducibility.patch"
1249 "openjdk-10-jtask-reproducibility.patch"
1250 "openjdk-10-pointer-comparison.patch"
1251 "openjdk-10-setsignalhandler.patch"
1252 "openjdk-currency-time-bomb2.patch"))))
1253 (arguments
1254 (substitute-keyword-arguments (package-arguments openjdk9)
1255 ((#:phases phases)
1256 `(modify-phases ,phases
1257 ,@(if (target-aarch64?)
1258 `((replace 'patch-for-aarch64
1259 (lambda _
1260 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1261 ;; This line is duplicated, so remove both occurrences,
1262 ;; then add back one occurrence by substituting a
1263 ;; comment that occurs once.
1264 (("using MacroAssembler::call_VM_leaf_base;") "")
1265 (("Interpreter specific version of call_VM_base")
1266 (string-append "Interpreter specific version of call_VM_base\n"
1267 " using MacroAssembler::call_VM_leaf_base;"))))))
1268 '())
1269 (replace 'fix-java-shebangs
1270 (lambda _
1271 ;; This file was "fixed" by patch-source-shebangs, but it requires
1272 ;; this exact first line.
1273 (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
1274 (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))))
1275 (add-after 'unpack 'remove-timestamping
1276 (lambda _
1277 (substitute* "./src/hotspot/share/runtime/vm_version.cpp"
1278 (("__DATE__") "")
1279 (("__TIME__") ""))))
1280 (replace 'configure
1281 (lambda* (#:key inputs outputs #:allow-other-keys)
1282 (invoke "bash" "./configure"
1283 ;; Add flags for compilation with gcc >= 10
1284 ,(string-append "--with-extra-cflags=-fcommon"
1285 " -fno-delete-null-pointer-checks"
1286 " -fno-lifetime-dse"
1287 ;; flags for compilation with gcc >= 14.
1288 " -Wno-error=int-conversion")
1289 (string-append "--with-freetype="
1290 (assoc-ref inputs "freetype"))
1291 "--disable-freetype-bundling"
1292 "--disable-warnings-as-errors"
1293 "--disable-hotspot-gtest"
1294 "--with-giflib=system"
1295 "--with-libjpeg=system"
1296 "--with-native-debug-symbols=zipped"
1297 (string-append "--prefix=" (assoc-ref outputs "out")))))
1298 (add-after 'unpack 'disable-warnings-as-errors
1299 (lambda _
1300 ;; It looks like the "--disable-warnings-as-errors" option of
1301 ;; the 'configure' phase is not working.
1302 (substitute* "make/autoconf/generated-configure.sh"
1303 (("-Werror") ""))))))
1304 ((#:disallowed-references _ '())
1305 `(,(gexp-input openjdk9)
1306 ,(gexp-input openjdk9 "jdk")))))
1307 (native-inputs
1308 `(("openjdk9" ,openjdk9)
1309 ("openjdk9:jdk" ,openjdk9 "jdk")
1310 ("[email protected]" ,gnu-make-4.2)
1311 ("nss-certs" ,nss-certs)
1312 ("unzip" ,unzip)
1313 ("which" ,which)
1314 ("zip" ,zip)))))
1315
1316(define-public openjdk11
1317 (package
1318 (name "openjdk")
1319 (version "11.0.22")
1320 (source (origin
1321 (method url-fetch)
1322 (uri (string-append "https://openjdk-sources.osci.io/openjdk11/openjdk-"
1323 version "-ga.tar.xz"))
1324 (file-name (string-append name "-" version ".tar.xz"))
1325 (sha256
1326 (base32
1327 "18ca4syp9xlrqjgyjkb1sp9835riy6aym5xs81r8byrz6jlb2473"))
1328 (modules '((guix build utils)))
1329 (snippet
1330 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1331 (patches
1332 (search-patches "openjdk-10-module3-reproducibility.patch"
1333 "openjdk-10-module4-reproducibility.patch"
1334 "openjdk-10-char-reproducibility.patch"
1335 "openjdk-11-classlist-reproducibility.patch"
1336 "openjdk-10-jar-reproducibility.patch"
1337 "openjdk-10-jtask-reproducibility.patch"
1338 "openjdk-currency-time-bomb2.patch"))))
1339 (build-system gnu-build-system)
1340 (outputs '("out" "jdk" "doc"))
1341 (arguments
1342 (list
1343 ;; Prevent a java.util.ConcurrentModificationException.
1344 #:parallel-build? #f
1345 #:modules `((guix build gnu-build-system)
1346 (guix build utils)
1347 (ice-9 match)
1348 (ice-9 popen)
1349 (srfi srfi-1)
1350 (srfi srfi-26))
1351 #:disallowed-references (list (gexp-input openjdk10)
1352 (gexp-input openjdk10 "jdk"))
1353
1354 #:tests? #f ; requires jtreg
1355 ;; TODO package jtreg
1356 #:configure-flags
1357 #~(list
1358 ;; Add flags for compilation with gcc >= 10.
1359 #$(string-append "--with-extra-cflags=-fcommon"
1360 " -fno-delete-null-pointer-checks"
1361 " -fno-lifetime-dse"
1362 ;; flags for compilation with gcc >= 14.
1363 " -Wno-error=int-conversion")
1364 ;; Otherwise, the '--enable-fast-install' causes an error.
1365 "--disable-option-checking"
1366 "--disable-warnings-as-errors"
1367 ;; Make validate-runpath pass (see:
1368 ;; http://issues.guix.info/issue/32894).
1369 "--with-native-debug-symbols=zipped"
1370 ;; Do not use the bundled libraries.
1371 "--with-giflib=system"
1372 "--with-lcms=system"
1373 "--with-libjpeg=system"
1374 "--with-libpng=system"
1375 "--with-version-pre="
1376 ;; Should be set by SOURCE_DATE_EPOCH handler, but isn't being
1377 ;; set; do it manually.
1378 "--with-hotspot-build-time=1970-01-01T00:00:01"
1379 "--enable-reproducible-build" ; to be sure
1380 ;; Allow the build system to locate the system freetype.
1381 (string-append "--with-freetype-include="
1382 #$(this-package-input "freetype") "/include")
1383 (string-append "--with-freetype-lib="
1384 #$(this-package-input "freetype") "/lib"))
1385 #:phases
1386 #~(modify-phases %standard-phases
1387 (add-after 'patch-source-shebangs 'fix-java-shebangs
1388 (lambda _
1389 ;; This file was "fixed" by patch-source-shebangs, but it requires
1390 ;; this exact first line.
1391 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1392 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1393 (add-after 'unpack 'remove-timestamping
1394 (lambda _
1395 (substitute* "src/hotspot/share/runtime/abstract_vm_version.cpp"
1396 (("__DATE__") "")
1397 (("__TIME__") ""))))
1398 (add-after 'unpack 'patch-jni-libs
1399 ;; Hardcode dynamically loaded libraries.
1400 (lambda _
1401 (define remove
1402 (@ (srfi srfi-1) remove))
1403
1404 (define (icedtea-or-openjdk? path)
1405 (or (string-contains path "openjdk")
1406 (string-contains path "icedtea")))
1407
1408 (let* ((library-path (remove icedtea-or-openjdk?
1409 (search-path-as-string->list
1410 (getenv "LIBRARY_PATH"))))
1411 (find-library (lambda (name)
1412 (or (search-path
1413 library-path
1414 (string-append "lib" name ".so"))
1415 (string-append "lib" name ".so")))))
1416 (for-each
1417 (lambda (file)
1418 (catch 'decoding-error
1419 (lambda ()
1420 (substitute* file
1421 (("VERSIONED_JNI_LIB_NAME\\(\"([^\"]*)\", \"([^\"]*)\"\\)"
1422 _ name version)
1423 (string-append "\"" (find-library name) "\""))
1424 (("JNI_LIB_NAME\\(\"([^\"]*)\"\\)" _ name)
1425 (string-append "\"" (find-library name) "\""))))
1426 (lambda _
1427 ;; Those are safe to skip.
1428 (format (current-error-port)
1429 "warning: failed to substitute: ~a~%"
1430 file))))
1431 (find-files "." "\\.c$|\\.h$")))))
1432 (add-before 'build 'write-source-revision-file
1433 (lambda _
1434 (with-output-to-file ".src-rev"
1435 (lambda _
1436 (display #$version)))))
1437 (replace 'build
1438 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1439 (apply invoke "make" "all"
1440 `(,@(if parallel-build?
1441 (list (string-append "JOBS="
1442 (number->string (parallel-job-count))))
1443 '("JOBS=1"))
1444 ,@make-flags))))
1445 ;; jdk 11 does not build jre by default any more; so explicitly build
1446 ;; it (see:
1447 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1448 (add-after 'build 'build-jre
1449 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1450 (apply invoke "make" "legacy-jre-image"
1451 `(,@(if parallel-build?
1452 (list (string-append "JOBS="
1453 (number->string (parallel-job-count))))
1454 '("JOBS=1"))
1455 ,@make-flags))))
1456 (replace 'install
1457 (lambda _
1458 (let ((images (car (find-files "build" "-server-release"
1459 #:directories? #t))))
1460 (copy-recursively (string-append images "/images/jdk")
1461 #$output:jdk)
1462 (copy-recursively (string-append images "/images/jre")
1463 #$output)
1464 (copy-recursively (string-append images "/images/docs")
1465 #$output:doc))))
1466 ;; Some of the libraries in the lib/ folder link to libjvm.so.
1467 ;; But that shared object is located in the server/ folder, so it
1468 ;; cannot be found. This phase creates a symbolic link in the
1469 ;; lib/ folder so that the other libraries can find it.
1470 ;;
1471 ;; See:
1472 ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
1473 ;;
1474 ;; FIXME: Find the bug in the build system, so that this symlink is
1475 ;; not needed.
1476 (add-after 'install 'install-libjvm
1477 (lambda _
1478 (let ((lib-out (string-append #$output "/lib"))
1479 (lib-jdk (string-append #$output:jdk "/lib")))
1480 (symlink (string-append lib-jdk "/server/libjvm.so")
1481 (string-append lib-jdk "/libjvm.so"))
1482 (symlink (string-append lib-out "/server/libjvm.so")
1483 (string-append lib-out "/libjvm.so")))))
1484 (add-after 'install 'strip-character-data-timestamps
1485 (lambda _
1486 (let ((archive (string-append #$output:jdk "/lib/src.zip"))
1487 (dir (mkdtemp "zip-contents.XXXXXX")))
1488 (with-directory-excursion dir
1489 (invoke "unzip" archive))
1490 (delete-file archive)
1491 (with-directory-excursion dir
1492 (let ((char-data-files (find-files "." "CharacterData")))
1493 (for-each (lambda (file)
1494 (substitute* file
1495 (((string-append "This file was generated "
1496 "AUTOMATICALLY from a template "
1497 "file.*"))
1498 (string-append "This file was generated "
1499 "AUTOMATICALLY from a template "
1500 "file"))))
1501 char-data-files)))
1502 (with-directory-excursion dir
1503 (let ((files (find-files "." #:directories? #t)))
1504 (apply invoke "zip" "-0" "-X" archive files))))))
1505 (add-after 'strip-character-data-timestamps 'remove-extraneous-files
1506 (lambda* (#:key outputs #:allow-other-keys)
1507 ;; Remove the *.diz and src.zip files for space considerations.
1508 ;; The former are compressed debuginfo files not typically
1509 ;; shipped with Java distributions, while the later corresponds
1510 ;; to Java core API source files.
1511 (for-each delete-file
1512 (append-map (cut find-files <> "(^src\\.zip|\\.diz)$")
1513 (map (match-lambda
1514 ((name . dir)
1515 dir))
1516 outputs)))))
1517 (add-after 'remove-extraneous-files 'strip-archive-timestamps
1518 (lambda _
1519 (use-modules (ice-9 binary-ports)
1520 (rnrs bytevectors))
1521 (letrec ((repack-archive
1522 (lambda (archive)
1523 (let ((dir (mkdtemp "zip-contents.XXXXXX")))
1524 (with-directory-excursion dir
1525 (invoke "unzip" archive))
1526 (delete-file archive)
1527 (for-each (compose repack-archive canonicalize-path)
1528 (find-files dir "(ct\\.sym|\\.jar)$"))
1529 (let ((reset-file-timestamp
1530 (lambda (file)
1531 (let ((s (lstat file)))
1532 (unless (eq? (stat:type s) 'symlink)
1533 (format #t "reset ~a~%" file)
1534 (utime file 0 0 0 0))))))
1535 (for-each reset-file-timestamp
1536 (find-files dir #:directories? #t)))
1537 (with-directory-excursion dir
1538 (let ((files (find-files "." #:directories? #t)))
1539 (apply invoke "zip" "-0" "-X" archive files)))))))
1540 (for-each repack-archive
1541 (find-files #$output:doc "\\.zip$"))
1542 (for-each repack-archive
1543 (find-files #$output:jdk "\\.(zip|jar)$"))
1544 (repack-archive (string-append #$output:jdk "/lib/ct.sym"))
1545 (let ((repack-jmod
1546 (lambda (file-name)
1547 (call-with-input-file file-name
1548 (lambda (file)
1549 (let ((header #vu8(#x4a #x4d #x01 #x00)))
1550 (if (equal? (get-bytevector-n
1551 file (bytevector-length header))
1552 header)
1553 (let* ((header-length (bytevector-length header))
1554 (temp-file (mkstemp!
1555 (string-copy
1556 "temp-file.XXXXXX")))
1557 (temp-filename (port-filename temp-file))
1558 (content-length
1559 (- (stat:size (stat file))
1560 header-length)))
1561 (sendfile temp-file file content-length header-length)
1562 (delete-file file-name)
1563 (close-port temp-file)
1564 (repack-archive (canonicalize-path temp-filename))
1565 (call-with-output-file file-name
1566 (lambda (file)
1567 (put-bytevector file header)
1568 (call-with-input-file temp-filename
1569 (lambda (temp-file)
1570 (sendfile
1571 file temp-file
1572 (stat:size (stat temp-file)) 0)))))))))))))
1573 (for-each repack-jmod
1574 (find-files #$output:jdk "\\.jmod$"))))))
1575 (add-after 'install 'remove-timestamp-from-api-summary
1576 (lambda _
1577 (substitute* (string-append #$output:doc
1578 "/api/overview-summary.html")
1579 (("Generated by javadoc \\(11-internal\\).*$")
1580 "Generated by javadoc (11-internal) -->\n")))))))
1581 (inputs
1582 (list alsa-lib
1583 cups
1584 fontconfig
1585 freetype
1586 giflib
1587 lcms
1588 libjpeg-turbo
1589 libpng
1590 libx11
1591 libxext
1592 libxrandr
1593 libxrender
1594 libxt
1595 libxtst))
1596 (native-inputs
1597 (list autoconf
1598 bash ; not bash-minimal, needs ulimit
1599 openjdk10
1600 `(,openjdk10 "jdk")
1601 gnu-make-4.2
1602 nss-certs
1603 pkg-config
1604 unzip
1605 which
1606 zip))
1607 (home-page "https://openjdk.org/projects/jdk/11/")
1608 (synopsis "Java development kit")
1609 (description
1610 "This package provides the Java development kit OpenJDK.")
1611 (license license:gpl2+)))
1612
1613(define-syntax make-openjdk
1614 ;; Return an OpenJDK package at VERSION with checksum HASH, using BOOTSTRAP,
1615 ;; the bootstrap package. One or more FIELD can be provided to further
1616 ;; refine the package definition; for convenience, the BASE, NAME and
1617 ;; VERSION are defined in their scope.
1618 (lambda (x)
1619 (syntax-case x ()
1620 ((_ bootstrap version* hash field ...)
1621 (with-syntax ((base (datum->syntax x 'base))
1622 (name (datum->syntax x 'name))
1623 (version (datum->syntax x 'version)))
1624 #'(let ((base (package
1625 (inherit bootstrap)
1626 (name "openjdk")
1627 (version version*)
1628 (source
1629 (origin
1630 (inherit (package-source bootstrap))
1631 (method git-fetch)
1632 (uri (git-reference
1633 (url (format
1634 #f "https://github.com/openjdk/jdk~au"
1635 (version-major version*)))
1636 (commit (string-append "jdk-" version*
1637 "-ga"))))
1638 (file-name (git-file-name name version))
1639 (sha256 (base32 hash))))
1640 (native-inputs
1641 (modify-inputs (package-native-inputs bootstrap)
1642 (replace "openjdk" bootstrap)))
1643 (home-page (string-append
1644 "https://openjdk.java.net/projects/jdk/"
1645 (version-major version)))))
1646 (name "openjdk")
1647 (version version*))
1648 (package
1649 (inherit base)
1650 field
1651 ...)))))))
1652
1653(define-public openjdk12
1654 (make-openjdk
1655 openjdk11 "12.33" "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"
1656 (source
1657 (origin
1658 (method url-fetch)
1659 (uri "http://hg.openjdk.java.net/jdk/jdk/archive/0276cba45aac.tar.bz2")
1660 (file-name (string-append name "-" version ".tar.bz2"))
1661 (sha256
1662 (base32
1663 "0pi2gwib3j2imi4l623iaywrmvfh9rqzh82lj2gxqbrmg55swvjf"))
1664 (modules '((guix build utils)))
1665 (snippet
1666 '(for-each delete-file (find-files "." "\\.(bin|exe|jar)$")))
1667 (patches (search-patches "openjdk-10-setsignalhandler.patch"))))
1668 (arguments
1669 (substitute-keyword-arguments (package-arguments openjdk11)
1670 ;; Re-enable parallel build.
1671 ((#:parallel-build? _ #t) #t)
1672 ((#:phases phases)
1673 #~(modify-phases #$phases
1674 #$@(if (target-aarch64?)
1675 #~((add-after 'unpack 'patch-for-aarch64
1676 (lambda _
1677 (substitute* "src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp"
1678 ;; This line is duplicated, so remove both occurrences,
1679 ;; then add back one occurrence by substituting a
1680 ;; comment that occurs once.
1681 (("using MacroAssembler::call_VM_leaf_base;") "")
1682 (("Interpreter specific version of call_VM_base")
1683 (string-append "Interpreter specific version of call_VM_base\n"
1684 " using MacroAssembler::call_VM_leaf_base;"))))))
1685 #~())
1686 (replace 'remove-timestamping
1687 (lambda _
1688 (substitute* "src/hotspot/share/runtime/vm_version.cpp"
1689 (("__DATE__") "")
1690 (("__TIME__") ""))))
1691 (replace 'fix-java-shebangs
1692 (lambda _
1693 ;; 'blocked' was renamed to 'blacklisted' in this version for
1694 ;; some reason.
1695 (substitute* "make/data/blacklistedcertsconverter/\
1696blacklisted.certs.pem"
1697 (("^#!.*")
1698 "#! java BlacklistedCertsConverter SHA-256\n"))))))))))
1699
1700(define-public openjdk13
1701 (make-openjdk openjdk12 "13.0.14"
1702 "1v92i5rhahqkjw8mz09c9qasnxqc67ygy0y266kdmm534z0da755"
1703 (source (origin
1704 (inherit (package-source base))
1705 (patches (search-patches "openjdk-13-classlist-reproducibility.patch"
1706 "openjdk-10-jtask-reproducibility.patch"))))
1707 (arguments
1708 (substitute-keyword-arguments (package-arguments openjdk12)
1709 ((#:phases phases)
1710 #~(modify-phases #$phases
1711 (replace 'remove-timestamping
1712 (lambda _
1713 (substitute*
1714 "src/hotspot/share/runtime/abstract_vm_version.cpp"
1715 (("__DATE__") "")
1716 (("__TIME__") ""))))))))))
1717
1718(define-public openjdk14
1719 (make-openjdk
1720 openjdk13 "14.0.2"
1721 "07k9bsbxwyf2z2n50z96nvhsdai916mxdxcr5lm44jz7f6xrwfq6"
1722 (source (origin
1723 (inherit (package-source base))
1724 (snippet ;override snippet
1725 '(begin
1726 ;; The m4 macro uses 'help' to search for builtins, which is
1727 ;; not available in bash-minimal
1728 (substitute* "make/autoconf/basics.m4"
1729 (("if help") "if command -v"))
1730 (for-each delete-file (find-files "." "\\.(bin|exe|jar)$"))))
1731 (patches (search-patches "openjdk-10-setsignalhandler.patch"
1732 "openjdk-10-jtask-reproducibility.patch"
1733 "openjdk-13-classlist-reproducibility.patch"))))))
1734
1735(define-public openjdk15
1736 (make-openjdk
1737 openjdk14 "15.0.10"
1738 "0hdllv348bws6m992bh73jik18x0sv0k2m9l817b3zb7q802sp7x"
1739 (source (origin
1740 (inherit (package-source base))
1741 (modules '())
1742 (snippet #f)
1743 (patches
1744 (search-patches "openjdk-15-jtask-reproducibility.patch"
1745 "openjdk-15-xcursor-no-dynamic.patch"))))
1746 (inputs
1747 (modify-inputs (package-inputs base)
1748 (append libxcursor))) ;for our patch to work
1749 (native-inputs
1750 (modify-inputs (package-native-inputs base)
1751 (delete "make" ;remove old gnu-make-4.2
1752 "openjdk") ;to remove non-jdk output
1753 (append `(,openjdk14 "jdk"))))))
1754
1755(define-public openjdk16
1756 (make-openjdk openjdk15 "16.0.2"
1757 "0587px2qbz07g3xi4a3ya6m630p72dvkxcn0bj1813pxnwvcgigz"
1758 (source (origin
1759 (inherit (package-source base))
1760 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"
1761 "openjdk-10-setsignalhandler.patch"))))))
1762
1763(define-public openjdk17
1764 (make-openjdk
1765 openjdk16 "17.0.10"
1766 "1bq1rqnipz6wdr05s20gm8nlpb3328ljxckzvc5ag0gf7fzlhn5f"
1767 (source (origin
1768 (inherit (package-source base))
1769 (patches (search-patches "openjdk-15-xcursor-no-dynamic.patch"))))
1770 (arguments
1771 (substitute-keyword-arguments (package-arguments openjdk16)
1772 ((#:phases phases)
1773 #~(modify-phases #$phases
1774 (replace 'fix-java-shebangs
1775 (lambda _
1776 ;; 'blacklisted' was renamed back to 'blocked'.
1777 (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
1778 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1779
1780(define-public openjdk18
1781 (make-openjdk openjdk17 "18.0.2.1"
1782 "0zxanjzz4p3psqahlidh55vx1ldanq70c2ygk3gcfn9a94vnr9rg"))
1783
1784(define-public openjdk19
1785 (make-openjdk openjdk18 "19.0.2"
1786 "08kvx7n8qhhfl25pig966881j5h4x7y0pf4brq16x0283fc0f4d4"
1787 (arguments
1788 (substitute-keyword-arguments (package-arguments openjdk18)
1789 ((#:phases phases)
1790 #~(modify-phases #$phases
1791 (replace 'fix-java-shebangs
1792 (lambda _
1793 ;; Update file path.
1794 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1795 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))
1796 (add-before 'configure 'define-java-environment-variables
1797 (lambda* (#:key inputs #:allow-other-keys)
1798 ;; Fix for "valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z".
1799 (setenv "SOURCE_DATE_EPOCH" "1234567890")))))))))
1800
1801(define-public openjdk20
1802 (make-openjdk openjdk19 "20.0.2"
1803 "1af1v2c3d8x4c6shzl6cv9qwq7a4hn5map5pjh9vjcky0hkzd489"))
1804
1805(define-public openjdk21
1806 (make-openjdk openjdk20 "21.0.2"
1807 "0d1g3wnzr5whjpq8gvxq0h7kd7lxd3xgc6bh3kg8vzz096asn0kj"
1808 (source (origin
1809 (inherit (package-source base))
1810 (patches (search-patches "openjdk-21-fix-rpath.patch"
1811 "openjdk-15-xcursor-no-dynamic.patch"))))
1812 (arguments
1813 (substitute-keyword-arguments (package-arguments base)
1814 ((#:phases phases)
1815 #~(modify-phases #$phases
1816 (replace 'fix-java-shebangs
1817 (lambda _
1818 ;; 'blacklisted' was renamed back to 'blocked'.
1819 (substitute* "src/java.base/share/data/blockedcertsconverter/blocked.certs.pem"
1820 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))))))))))
1821
1822(define-public openjdk22
1823 (make-openjdk
1824 openjdk21 "22.0.2"
1825 "1nj414yj6v9qrlm48yv5llr4jmgj9g20v6zsd39xrdx4x4x4p3b6"
1826 (arguments
1827 (substitute-keyword-arguments (package-arguments base)
1828 ((#:phases phases)
1829 #~(modify-phases #$phases
1830 (add-after 'unpack 'do-not-disable-new-dtags
1831 (lambda _
1832 ;; Our validate-runpath phases checks for RUNPATH, not RPATH.
1833 (substitute* "make/autoconf/flags-cflags.m4"
1834 ((" -Wl,--disable-new-dtags") ""))))))))))
1835
1836(define-public openjdk23
1837 (make-openjdk
1838 openjdk22 "23.0.2"
1839 "0kxllznzhgqfn8b97krg2yp1ag41g4phmgqahrvzafd2bq6zclnf"
1840 (source (origin
1841 (inherit (package-source base))
1842 ;; The 'openjdk-21-fix-rpath.patch' no longer applies, and it
1843 ;; appears not needed anymore. The
1844 ;; 'openjdk-15-xcursor-no-dynamic.patch' doesn't apply anymore;
1845 ;; the fix should be pursued in libx11 (see:
1846 ;; https://issues.guix.gnu.org/54654)
1847 (patches '())))))
1848
1849(define-public openjdk24
1850 (make-openjdk
1851 openjdk23 "24.0.1"
1852 "0h6sbzbjyqg85iml41pswdh2z3d7h2hhb0sd5yll37r1mj5lsxmx"))
1853
1854;;; Convenience alias to point to the latest version of OpenJDK.
1855(define-public openjdk openjdk24)
1856
1857
1858;; This version of JBR is here in order to be able to build custom
1859;; IntelliJ plugins. Those usually need both jbr11 and jbr17 for
1860;; tests.
1861(define-public jbr11
1862 (package
1863 (inherit openjdk11)
1864 (name "jbr")
1865 (version "11_0_16-b2248")
1866 (source (origin
1867 (method git-fetch)
1868 (uri (git-reference
1869 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1870 (commit (string-append "jb" version))))
1871 (file-name (string-append name "-" version "-checkout"))
1872 (sha256
1873 (base32
1874 "1fnrdx0wb21ghm6jczjzk7b9fz9hbdzd62512xhwpzvca57v2z09"))))
1875 (arguments
1876 (substitute-keyword-arguments (package-arguments openjdk11)
1877 ((#:configure-flags configure-flags)
1878 #~(append #$configure-flags
1879 (list "--with-jvm-features=shenandoahgc"
1880 "--enable-cds=yes"
1881 "--with-vendor-name=JetBrains s.r.o"
1882 "--with-vendor-url=https://www.jetbrains.com/"
1883 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1884 (synopsis "JetBrains Java Runtime")
1885 (description "This package provides a Java runtime environment for
1886and Java development kit. It supports enhanced class redefinition (DCEVM),
1887includes a number of improvements in font rendering, keyboards support,
1888windowing/focus subsystems, HiDPI, accessibility, and performance,
1889provides better desktop integration and bugfixes not yet present in
1890OpenJDK.")
1891 (home-page "https://www.jetbrains.com/")
1892 (license license:gpl2+)))
1893
1894(define-public jbr17
1895 (package
1896 (inherit openjdk17)
1897 (name "jbr")
1898 (version "17.0.11b1207.30")
1899 (source (origin
1900 (method git-fetch)
1901 (uri (git-reference
1902 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1903 (commit (string-append "jbr-release-" version))))
1904 (file-name (string-append name "-" version "-checkout"))
1905 (sha256
1906 (base32
1907 "5bbf5z8faf9sdkig2fwkj06hb7hs9s3bpzzvbqn2i75lbwqk3bln"))
1908 (patches (search-patches "jbr-17-xcursor-no-dynamic.patch"))))
1909 (arguments
1910 (substitute-keyword-arguments (package-arguments openjdk17)
1911 ((#:configure-flags configure-flags)
1912 #~(append #$configure-flags
1913 (list "--with-jvm-features=shenandoahgc"
1914 "--enable-cds=yes"
1915 "--with-vendor-name=JetBrains s.r.o"
1916 "--with-vendor-url=https://www.jetbrains.com/"
1917 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1918 (synopsis "JetBrains Java Runtime")
1919 (description "This package provides a Java runtime environment for
1920and Java development kit. It supports enhanced class redefinition (DCEVM),
1921includes a number of improvements in font rendering, keyboards support,
1922windowing/focus subsystems, HiDPI, accessibility, and performance,
1923provides better desktop integration and bugfixes not yet present in
1924OpenJDK.")
1925 (home-page "https://www.jetbrains.com/")
1926 (license license:gpl2+)))
1927
1928(define-public jbr21
1929 (package
1930 (inherit openjdk21)
1931 (name "jbr")
1932 (version "21.0.3b509.11")
1933 (source (origin
1934 (method git-fetch)
1935 (uri (git-reference
1936 (url "https://github.com/JetBrains/JetBrainsRuntime.git")
1937 (commit (string-append "jbr-release-" version))))
1938 (file-name (string-append name "-" version "-checkout"))
1939 (sha256
1940 (base32
1941 "03xkghbp0b1czc2ags9n8ilprf9sy4bhsma0wf8xfapqn6d2sfyd"))
1942 (patches (search-patches "openjdk-21-fix-rpath.patch"
1943 "jbr-17-xcursor-no-dynamic.patch"))))
1944 (inputs
1945 `(("wayland" ,wayland)
1946 ("libxkbcommon" ,libxkbcommon) ; for wayland
1947 ,@(package-inputs openjdk21)))
1948 (arguments
1949 (substitute-keyword-arguments (package-arguments openjdk21)
1950 ((#:configure-flags configure-flags)
1951 #~(append #$configure-flags
1952 (list "--with-jvm-features=shenandoahgc"
1953 "--enable-cds=yes"
1954 "--with-vendor-name=JetBrains s.r.o"
1955 "--with-vendor-url=https://www.jetbrains.com/"
1956 "--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR")))))
1957 (synopsis "JetBrains Java Runtime")
1958 (description "This package provides a Java runtime environment for
1959and Java development kit. It supports enhanced class redefinition (DCEVM),
1960includes a number of improvements in font rendering, keyboards support,
1961windowing/focus subsystems, HiDPI, accessibility, and performance,
1962provides better desktop integration and bugfixes not yet present in
1963OpenJDK.")
1964 (home-page "https://www.jetbrains.com/")
1965 (license license:gpl2+)))
1966
1967
1968(define-public ant/java8
1969 (package
1970 (name "ant")
1971 (version "1.10.15")
1972 (source (origin
1973 (method url-fetch)
1974 (uri (string-append "mirror://apache/ant/source/apache-ant-"
1975 version "-src.tar.gz"))
1976 (sha256
1977 (base32
1978 "1ccr852dxg5affdqafg04gi3l89q5c6l9lqrz50jhj05kidljax2"))
1979 (modules '((guix build utils)))
1980 (snippet
1981 '(begin
1982 (for-each delete-file
1983 (find-files "lib/optional" "\\.jar$"))
1984 #t))))
1985 (build-system gnu-build-system)
1986 (arguments
1987 (list
1988 #:modules '((srfi srfi-1)
1989 (guix build gnu-build-system)
1990 (guix build utils))
1991 #:tests? #f ;no "check" target
1992 #:phases
1993 #~(modify-phases %standard-phases
1994 (add-after 'unpack 'remove-scripts
1995 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
1996 ;; wrappers.
1997 (lambda _
1998 (for-each delete-file
1999 (find-files "src/script"
2000 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))))
2001 (delete 'bootstrap)
2002 (delete 'configure)
2003 (replace 'build
2004 (lambda* (#:key inputs #:allow-other-keys)
2005 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2006
2007 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2008 ;; Ant to build. This is necessary in addition to disabling the
2009 ;; "check" phase, because the dependency on "test-jar" would always
2010 ;; result in the tests to be run.
2011 (substitute* "build.xml"
2012 (("depends=\"jars,test-jar") "depends=\"jars"))
2013 (invoke "bash" "bootstrap.sh"
2014 (string-append "-Ddist.dir=" #$output))))
2015 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2016 (lambda _
2017 (define (repack-archive jar)
2018 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2019 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2020 (with-directory-excursion dir
2021 (invoke "unzip" jar))
2022 (delete-file jar)
2023 ;; XXX: copied from (gnu build install)
2024 (for-each (lambda (file)
2025 (let ((s (lstat file)))
2026 (unless (eq? (stat:type s) 'symlink)
2027 (utime file 0 0 0 0))))
2028 (find-files dir #:directories? #t))
2029 ;; It is important that the manifest appears first.
2030 (with-directory-excursion dir
2031 (let* ((files (find-files "." ".*" #:directories? #t))
2032 ;; To ensure that the reference scanner can
2033 ;; detect all store references in the jars
2034 ;; we disable compression with the "-0" option.
2035 (command (if (file-exists? manifest)
2036 `("zip" "-0" "-X" ,jar ,manifest
2037 ,@files)
2038 `("zip" "-0" "-X" ,jar ,@files))))
2039 (apply invoke command)))))
2040 (for-each repack-archive
2041 (find-files
2042 (string-append #$output "/lib")
2043 "\\.jar$"))))
2044 (delete 'install))))
2045 (native-inputs
2046 `(("jdk" ,icedtea-8 "jdk")
2047 ("zip" ,zip)
2048 ("unzip" ,unzip)))
2049 (home-page "https://ant.apache.org")
2050 (synopsis "Build tool for Java")
2051 (description
2052 "Ant is a platform-independent build tool for Java. It is similar to
2053make but is implemented using the Java language, requires the Java platform,
2054and is best suited to building Java projects. Ant uses XML to describe the
2055build process and its dependencies, whereas Make uses Makefile format.")
2056 (license license:asl2.0)))
2057
2058;; The 1.9.x series is the last that can be built with GCJ. The 1.10.x series
2059;; requires Java 8.
2060(define-public ant
2061 (package (inherit ant/java8)
2062 (version "1.9.15")
2063 (source (origin
2064 (method url-fetch)
2065 (uri (string-append "mirror://apache/ant/source/apache-ant-"
2066 version "-src.tar.gz"))
2067 (sha256
2068 (base32
2069 "1xy30f1w5gaqk6g3f0vw7ygix4rb6032qkcw42y4z8wd9jihgygd"))))
2070 ;; XXX: we do this to avoid a rebuild. This mess will be cleaned up
2071 ;; later.
2072 (arguments
2073 (substitute-keyword-arguments
2074 `(#:modules ((srfi srfi-1)
2075 (guix build gnu-build-system)
2076 (guix build utils))
2077 #:tests? #f ; no "check" target
2078 #:phases
2079 (modify-phases %standard-phases
2080 (delete 'bootstrap)
2081 (delete 'configure)
2082 (add-before 'build 'define-java-environment-variables
2083 (lambda* (#:key inputs #:allow-other-keys)
2084 ;; First, set environment variables (eases debugging on -K).
2085 (setenv "JAVA_HOME" (assoc-ref inputs "jamvm"))
2086 (setenv "JAVACMD" (search-input-file inputs "/bin/jamvm"))
2087 (setenv "JAVAC" (search-input-file inputs "/bin/jikes"))
2088 (setenv "CLASSPATH" (search-input-file inputs "/lib/rt.jar"))))
2089 (replace 'build
2090 (lambda* (#:key inputs outputs #:allow-other-keys)
2091 ;; Ant complains if this file doesn't exist.
2092 (setenv "HOME" "/tmp")
2093 (with-output-to-file "/tmp/.ant.properties"
2094 (lambda _ (display "")))
2095
2096 ;; Use jikes instead of javac for <javac ...> tags in build.xml
2097 (setenv "ANT_OPTS" "-Dbuild.compiler=jikes")
2098
2099 ;; jikes produces lots of warnings, but they are not very
2100 ;; interesting, so we silence them.
2101 (setenv "$BOOTJAVAC_OPTS" "-nowarn")
2102
2103 ;; Without these JamVM options the build may freeze.
2104 (substitute* "bootstrap.sh"
2105 (("^\"\\$\\{JAVACMD\\}\" " m)
2106 ,@(if (string-prefix? "armhf" (or (%current-system)
2107 (%current-target-system)))
2108 `((string-append m "-Xnocompact "))
2109 `((string-append m "-Xnocompact -Xnoinlining ")))))
2110
2111 ;; Disable tests because we are bootstrapping and thus don't have
2112 ;; any of the dependencies required to build and run the tests.
2113 (substitute* "build.xml"
2114 (("depends=\"jars,test-jar\"") "depends=\"jars\""))
2115 (invoke "bash" "bootstrap.sh"
2116 (string-append "-Ddist.dir="
2117 (assoc-ref outputs "out")))))
2118 (add-after 'build 'strip-jar-timestamps ;based on ant-build-system
2119 (lambda* (#:key outputs #:allow-other-keys)
2120 (define (repack-archive jar)
2121 (let* ((dir (mkdtemp "jar-contents.XXXXXX"))
2122 (manifest (string-append dir "/META-INF/MANIFESTS.MF")))
2123 (with-directory-excursion dir
2124 (invoke "unzip" jar))
2125 (delete-file jar)
2126 ;; XXX: copied from (gnu build install)
2127 (for-each (lambda (file)
2128 (let ((s (lstat file)))
2129 (unless (eq? (stat:type s) 'symlink)
2130 (utime file 0 0 0 0))))
2131 (find-files dir #:directories? #t))
2132 ;; It is important that the manifest appears first.
2133 (with-directory-excursion dir
2134 (let* ((files (find-files "." ".*" #:directories? #t))
2135 ;; To ensure that the reference scanner can
2136 ;; detect all store references in the jars
2137 ;; we disable compression with the "-0" option.
2138 (command (if (file-exists? manifest)
2139 `("zip" "-0" "-X" ,jar ,manifest
2140 ,@files)
2141 `("zip" "-0" "-X" ,jar ,@files))))
2142 (apply invoke command)))))
2143 (for-each repack-archive
2144 (find-files
2145 (string-append (assoc-ref %outputs "out") "/lib")
2146 "\\.jar$"))))
2147 (delete 'install)))
2148 ((#:phases phases)
2149 `(modify-phases ,phases
2150 (delete 'define-java-environment-variables)
2151 (add-after 'unpack 'remove-scripts
2152 ;; Remove bat / cmd scripts for DOS as well as the antRun and runant
2153 ;; wrappers.
2154 (lambda _
2155 (for-each delete-file
2156 (find-files "src/script"
2157 "(.*\\.(bat|cmd)|runant.*|antRun.*)"))
2158 #t))
2159 (replace 'build
2160 (lambda* (#:key inputs outputs #:allow-other-keys)
2161 (setenv "JAVA_HOME" (assoc-ref inputs "jdk"))
2162
2163 ;; Disable tests to avoid dependency on hamcrest-core, which needs
2164 ;; Ant to build. This is necessary in addition to disabling the
2165 ;; "check" phase, because the dependency on "test-jar" would always
2166 ;; result in the tests to be run.
2167 (substitute* "build.xml"
2168 (("depends=\"jars,test-jar") "depends=\"jars"))
2169 (invoke "bash" "bootstrap.sh"
2170 (string-append "-Ddist.dir="
2171 (assoc-ref outputs "out")))))))))
2172 (native-inputs
2173 `(("jdk" ,icedtea-7 "jdk")
2174 ("zip" ,zip)
2175 ("unzip" ,unzip)))))
2176
2177(define-public ant-apache-bcel
2178 (package
2179 (inherit ant/java8)
2180 (name "ant-apache-bcel")
2181 (arguments
2182 (substitute-keyword-arguments (package-arguments ant/java8)
2183 ((#:phases phases)
2184 #~(modify-phases #$phases
2185 (add-after 'unpack 'link-bcel
2186 (lambda* (#:key inputs #:allow-other-keys)
2187 (for-each (lambda (file)
2188 (symlink file
2189 (string-append "lib/optional/"
2190 (basename file))))
2191 (find-files (assoc-ref inputs "java-commons-bcel")
2192 "\\.jar$"))))
2193 (add-after 'build 'install
2194 (lambda _
2195 (let ((share (string-append #$output "/share/java"))
2196 (bin (string-append #$output "/bin"))
2197 (lib (string-append #$output "/lib")))
2198 (mkdir-p share)
2199 (install-file (string-append lib "/ant-apache-bcel.jar") share)
2200 (delete-file-recursively bin)
2201 (delete-file-recursively lib))))))))
2202 (inputs
2203 (modify-inputs (package-inputs ant/java8)
2204 (prepend java-commons-bcel)))))
2205
2206(define-public ant-junit
2207 (package
2208 (inherit ant/java8)
2209 (name "ant-junit")
2210 (arguments
2211 (substitute-keyword-arguments (package-arguments ant/java8)
2212 ((#:phases phases)
2213 #~(modify-phases #$phases
2214 (add-after 'unpack 'link-junit
2215 (lambda* (#:key inputs #:allow-other-keys)
2216 (for-each (lambda (file)
2217 (symlink file
2218 (string-append "lib/optional/"
2219 (basename file))))
2220 (find-files (assoc-ref inputs "java-junit")
2221 "\\.jar$"))))
2222 (add-after 'build 'install
2223 (lambda _
2224 (let ((share (string-append #$output "/share/java"))
2225 (bin (string-append #$output "/bin"))
2226 (lib (string-append #$output "/lib")))
2227 (mkdir-p share)
2228 (install-file (string-append lib "/ant-junit.jar") share)
2229 (delete-file-recursively bin)
2230 (delete-file-recursively lib))))))))
2231 (inputs
2232 (modify-inputs (package-inputs ant/java8)
2233 (prepend java-junit)))))
2234
2235(define-public libantlr3c
2236 (package
2237 (name "libantlr3c")
2238 (version "3.4")
2239 (source
2240 (origin
2241 (method url-fetch)
2242 (uri
2243 (string-append "https://www.antlr3.org/download/C/"
2244 name "-" version ".tar.gz"))
2245 (sha256
2246 (base32 "0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa"))))
2247 (build-system gnu-build-system)
2248 (arguments
2249 (list #:configure-flags
2250 #~(list "--enable-debuginfo"
2251 "--disable-static"
2252 #$@(if (target-64bit?)
2253 #~("--enable-64bit")
2254 #~())
2255 #$@(if (target-riscv64?)
2256 #~("--disable-abiflags")
2257 #~()))))
2258 (synopsis "ANTLR C Library")
2259 (description "LIBANTLR3C provides run-time C libraries for ANTLR3 (ANother
2260Tool for Language Recognition v3).")
2261 (home-page "https://www.antlr3.org/")
2262 (license license:bsd-3)))
2263
2264(define-public drip
2265 ;; Last release is from 2014, with a few important commits afterwards.
2266 (let ((commit "a4bd00df0199e78243847f06cc04ecaea31f8f08"))
2267 (package
2268 (name "drip")
2269 (version (git-version "0.2.4" "1" commit))
2270 (source (origin
2271 (method git-fetch)
2272 (uri (git-reference
2273 (url "https://github.com/ninjudd/drip")
2274 (commit commit)))
2275 (file-name (git-file-name name version))
2276 (sha256
2277 (base32
2278 "0wzmjwfyldr3jn49517xd8yn7dgdk8h88qkga3kjyg1zc375ylg2"))))
2279 (build-system gnu-build-system)
2280 (native-inputs
2281 `(("jdk" ,icedtea "jdk")))
2282 (arguments
2283 (list #:tests? #f ; No tests.
2284 #:phases
2285 #~(modify-phases %standard-phases
2286 (delete 'configure)
2287 (add-before 'build 'relax-gcc-14-strictness
2288 (lambda _
2289 (substitute* "Makefile"
2290 ((" gcc(.*)$" all options)
2291 (string-append
2292 " gcc"
2293 " -Wno-error=incompatible-pointer-types"
2294 " -Wno-error=implicit-function-declaration"
2295 options)))))
2296 (add-before 'install 'fix-wrapper
2297 (lambda* (#:key inputs #:allow-other-keys)
2298 (let ((jps (search-input-file inputs "/bin/jps")))
2299 (substitute* "bin/drip"
2300 (("jps") jps)
2301 (("brew update && brew upgrade drip") "guix pull && guix install drip")
2302 ;; No need to make:
2303 (("\\(cd -- \"\\$drip_dir\" && make -s\\) \\|\\| exit 1") "")
2304 ;; No need to include source:
2305 (("\\[\\[ -r \\$drip_dir/src/org/flatland/drip/Main\\.java \\]\\]")
2306 "true")))))
2307 (replace 'install
2308 (lambda* (#:key outputs #:allow-other-keys)
2309 (let* ((bin (string-append #$output "/bin"))
2310 (share (string-append #$output "/share/drip")))
2311 (mkdir-p bin)
2312 (for-each
2313 (lambda (file)
2314 (install-file (string-append "bin/" file) bin))
2315 '("drip" "drip_daemon" "drip_proxy"))
2316 (install-file "drip.jar" share)
2317 (substitute* (string-append bin "/drip")
2318 (("drip_dir=\\$bin_dir/..")
2319 (string-append "drip_dir=" share)))))))))
2320 (home-page "https://github.com/ninjudd/drip")
2321 (synopsis "Faster Java Virtual Machine launching")
2322 (description "Drip is a launcher for the Java Virtual Machine that
2323provides much faster startup times than the @command{java} command. The @command{drip}
2324script is intended to be a drop-in replacement for the @command{java} command,
2325only faster.")
2326 (license license:epl1.0))))
2327
2328(define-public java-openjfx-build
2329 (package
2330 (name "java-openjfx-build")
2331 ;; This is a java-8 version
2332 (version "8.202")
2333 (source (origin
2334 (method hg-fetch)
2335 (uri (hg-reference
2336 (url "http://hg.openjdk.java.net/openjfx/8u-dev/rt")
2337 (changeset (string-append
2338 (string-join (string-split version #\.) "u")
2339 "-ga"))))
2340 (file-name (string-append name "-" version "-checkout"))
2341 (modules '((guix build utils)))
2342 (snippet
2343 '(begin
2344 ;; Delete included gradle jar
2345 (delete-file-recursively "gradle/wrapper")
2346 #t))
2347 (sha256
2348 (base32
2349 "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
2350 (patches (search-patches "java-openjfx-build-jdk_version.patch"))))
2351 (build-system ant-build-system)
2352 (arguments
2353 `(#:jar-name "java-openjfx.jar"
2354 #:source-dir "buildSrc/src/main/java"
2355 #:test-dir "buildSrc/src/test"
2356 #:phases
2357 (modify-phases %standard-phases
2358 (add-before 'configure 'generate-jsl-parser
2359 (lambda _
2360 (invoke "antlr3" "-o"
2361 "buildSrc/src/main/java/com/sun/scenario/effect/compiler"
2362 "buildSrc/src/main/antlr/JSL.g"))))))
2363 (inputs
2364 (list antlr3 java-stringtemplate))
2365 (native-inputs
2366 (list java-junit java-hamcrest-core))
2367 (home-page "https://openjfx.io")
2368 (synopsis "Graphical application toolkit in Java")
2369 (description "OpenJFX is a client application platform for desktop,
2370mobile and embedded systems built on Java. Its goal is to produce a
2371modern, efficient, and fully featured toolkit for developing rich client
2372applications. This package contains base classes for the OpenJFX
2373distribution and helper classes for building other parts of the
2374distribution.")
2375 (license license:gpl2))) ;gpl2 only, with classpath exception
2376
2377(define-public java-openjfx-base
2378 (package (inherit java-openjfx-build)
2379 (name "java-openjfx-base")
2380 (arguments
2381 `(#:jar-name "java-openjfx-base.jar"
2382 #:source-dir "modules/base/src/main/java:modules/base/src/main/java8:modules/base/src/main/version-info"
2383 #:test-dir "modules/base/src/test"
2384 #:phases
2385 (modify-phases %standard-phases
2386 (add-before 'check 'remove-empty-file
2387 (lambda _
2388 (with-directory-excursion "modules/base/src/test/java"
2389 ;; These files are completely commented, but junit expects them to
2390 ;; contain a class, so tests fail.
2391 (delete-file
2392 "com/sun/javafx/property/adapter/PropertyDescriptorTest.java")
2393 (delete-file
2394 "com/sun/javafx/property/adapter/ReadOnlyPropertyDescriptorTest.java")
2395 (delete-file "javafx/beans/property/PropertiesTest.java")
2396 (delete-file
2397 "javafx/beans/property/adapter/ReadOnlyJavaBeanPropertyBuilder_General_Test.java")
2398 ;; This one fails
2399 (delete-file "com/sun/javafx/runtime/VersionInfoTest.java"))
2400 #t)))))
2401 (propagated-inputs
2402 (list java-openjfx-build))
2403 (description "OpenJFX is a client application platform for desktop,
2404mobile and embedded systems built on Java. Its goal is to produce a
2405modern, efficient, and fully featured toolkit for developing rich client
2406applications. This package contains base classes for the OpenJFX
2407distribution.")))
2408
2409(define-public java-openjfx-graphics
2410 (package (inherit java-openjfx-build)
2411 (name "java-openjfx-graphics")
2412 (arguments
2413 `(#:jar-name "java-openjfx-graphics.jar"
2414 #:source-dir "modules/graphics/src/main/java"
2415 #:tests? #f; require X
2416 #:test-dir "modules/graphics/src/test"
2417 #:phases
2418 (modify-phases %standard-phases
2419 (add-after 'unpack 'copy-missing-file
2420 (lambda* (#:key inputs #:allow-other-keys)
2421 (let ((target "modules/graphics/src/main/native-prism-sw/JNativeSurface.c"))
2422 (copy-file (assoc-ref inputs "JNativeSurface.c") target)
2423 ;; XXX: looks like the missing file we found isn't *quite*
2424 ;; compatible...
2425 (substitute* target
2426 (("case TYPE_INT_ARGB:") "")))))
2427 (add-after 'build 'build-native
2428 (lambda* (#:key inputs outputs #:allow-other-keys)
2429 (let ((jdk (assoc-ref inputs "jdk"))
2430 (class-file->class-name
2431 (lambda (class-file)
2432 (string-map (lambda (c)
2433 (if (char=? c #\/) #\. c))
2434 (string-drop-right class-file
2435 (string-length ".class"))))))
2436 (setenv "CPPFLAGS"
2437 (string-append "-DINLINE=inline "
2438 "-DLINUX "
2439 "-I" jdk "/include "
2440 "-I" jdk "/include/linux "
2441 "-I " (getcwd) "/build/classes/include "
2442 "-I " (getcwd) "/modules/graphics/src/main/native-prism-sw"))
2443
2444 ;; Instructions have been adapted from buildSrc/linux.gradle
2445 (with-directory-excursion "build/classes"
2446 ;; Build prism
2447 (mkdir-p "include")
2448
2449 ;; Generate headers for prism
2450 (apply invoke "javah" "-d" "include" "-cp" "."
2451 (map class-file->class-name
2452 (append (find-files "com/sun/prism/impl" "\\.class$")
2453 (find-files "com/sun/prism" "PresentableState.*\\.class$"))))
2454
2455 ;; ...then for prism_sw
2456 (apply invoke "javah" "-d" "include" "-cp" "."
2457 (map class-file->class-name
2458 (find-files "com/sun/pisces" "\\.class$")))
2459
2460 ;; ...and for prism_es2
2461 (apply invoke "javah" "-d" "include" "-cp" "."
2462 (map class-file->class-name
2463 (find-files "com/sun/prism/es2" "\\.class$")))))
2464
2465 (with-directory-excursion "netbeans/native-prism"
2466 (invoke "make" "CONF=Release"))
2467 (with-directory-excursion "netbeans/native-prism-sw"
2468 (invoke "make" "CONF=Release"))
2469 ;; TODO: This fails due to unknown EGL procedure names
2470 #;
2471 (with-directory-excursion "netbeans/native-prism-es2"
2472 (invoke "make" "CONF=Release"))
2473
2474 (let* ((out (assoc-ref outputs "out"))
2475 (dir ,(match (%current-system)
2476 ("i686-linux"
2477 "i386")
2478 ((or "armhf-linux" "aarch64-linux")
2479 "arm")
2480 ((or "x86_64-linux")
2481 "amd64")
2482 (_ "unknown")))
2483 (target (string-append out "/share/" dir "/")))
2484 (mkdir-p target)
2485 (for-each (lambda (file)
2486 (let ((new-name
2487 (string-append "lib"
2488 (string-map
2489 (lambda (c)
2490 (if (char=? c #\-) #\_ c))
2491 (string-drop (basename file)
2492 (string-length "libnative-"))))))
2493 (copy-file file
2494 (string-append target new-name))))
2495 (find-files "netbeans" "\\.so$"))))))))
2496 (propagated-inputs
2497 (list java-openjfx-base))
2498 (inputs
2499 (list java-swt))
2500 ;; XXX: for unknown reasons
2501 ;; modules/graphics/src/main/native-prism-sw/JNativeSurface.c is missing
2502 ;; in this revision.
2503 (native-inputs
2504 `(("JNativeSurface.c"
2505 ,(origin
2506 (method url-fetch)
2507 (uri "https://raw.githubusercontent.com/openjdk/jfx/8u20-b02\
2508/modules/graphics/src/main/native-prism-sw/JNativeSurface.c")
2509 (sha256
2510 (base32
2511 "1kp15wbnd6rn0nciczp5ibq0ikby2yysvx1gnz5fa05vl2mm8mbm"))))))
2512 (description "OpenJFX is a client application platform for desktop,
2513mobile and embedded systems built on Java. Its goal is to produce a
2514modern, efficient, and fully featured toolkit for developing rich client
2515applications. This package contains graphics-related classes for the
2516OpenJFX distribution.")))
2517
2518(define-public java-openjfx-media
2519 (package (inherit java-openjfx-build)
2520 (name "java-openjfx-media")
2521 (propagated-inputs
2522 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2523 (arguments
2524 `(#:jar-name "java-openjfx-media.jar"
2525 #:source-dir "modules/media/src/main/java"
2526 #:tests? #f)); no tests
2527 (description "OpenJFX is a client application platform for desktop,
2528mobile and embedded systems built on Java. Its goal is to produce a
2529modern, efficient, and fully featured toolkit for developing rich client
2530applications. This package contains media-related classes for the
2531OpenJFX distribution.")))
2532
2533(define-public java-openjfx-controls
2534 (package (inherit java-openjfx-build)
2535 (name "java-openjfx-controls")
2536 (propagated-inputs
2537 `(("java-openjxf-graphics" ,java-openjfx-graphics)))
2538 (arguments
2539 `(#:jar-name "java-openjfx-controls.jar"
2540 #:source-dir "modules/controls/src/main/java"
2541 #:test-dir "modules/controls/src/test"
2542 ;; TODO: tests require com.sun.javafx.pgstub,
2543 ;; javafx.collections.MockSetObserver, and
2544 ;; com.sun.javafx.binding.ExpressionHelperUtility
2545 #:tests? #false
2546 #:phases
2547 (modify-phases %standard-phases
2548 (add-after 'unpack 'copy-resources
2549 (lambda _
2550 (copy-recursively "modules/controls/src/test/resources"
2551 "build/test-classes")
2552 (copy-recursively "modules/controls/src/main/resources"
2553 "build/classes"))))))
2554 (description "OpenJFX is a client application platform for desktop,
2555mobile and embedded systems built on Java. Its goal is to produce a
2556modern, efficient, and fully featured toolkit for developing rich client
2557applications. This package contains UI control classes for the
2558OpenJFX distribution.")))
2559
2560(define-public javacc-4
2561 (package
2562 (name "javacc")
2563 (version "4.1")
2564 (source (origin
2565 (method git-fetch)
2566 (uri (git-reference
2567 (url "https://github.com/javacc/javacc")
2568 (commit "release_41")))
2569 (file-name (string-append "javacc-" version "-checkout"))
2570 (sha256
2571 (base32
2572 "07ysav7j8r1c6h8qxrgqk6lwdp74ly0ad1935lragxml0qqc3ka0"))
2573 (modules '((guix build utils)))
2574 ;; delete bundled jars
2575 (snippet '(begin (delete-file-recursively "lib") #t))))
2576 (build-system ant-build-system)
2577 ;; Tests fail with
2578 ;; /tmp/guix-build-javacc-4.1.drv-0/source/test/javacodeLA/build.xml:60:
2579 ;; JAVACODE failed
2580 (arguments
2581 `(#:tests? #f
2582 #:phases
2583 (modify-phases %standard-phases
2584 ;; Delete tests to avoid build failure (we don't run them anyway).
2585 (add-after 'unpack 'delete-tests
2586 (lambda _
2587 (for-each delete-file
2588 '("src/org/javacc/JavaCCTestCase.java"
2589 "src/org/javacc/parser/ExpansionTest.java"
2590 "src/org/javacc/parser/OptionsTest.java"
2591 "src/org/javacc/jjtree/JJTreeOptionsTest.java"))
2592 (for-each delete-file-recursively
2593 '("src/org/javacc/parser/test"
2594 "src/org/javacc/jjdoc/test"))
2595 #t))
2596 (replace 'install (install-jars "bin/lib")))))
2597 (home-page "https://javacc.org/")
2598 (synopsis "Java parser generator")
2599 (description "Java Compiler Compiler (JavaCC) is the most popular parser
2600generator for use with Java applications. A parser generator is a tool that
2601reads a grammar specification and converts it to a Java program that can
2602recognize matches to the grammar. In addition to the parser generator itself,
2603JavaCC provides other standard capabilities related to parser generation such
2604as tree building (via a tool called JJTree included with JavaCC), actions,
2605debugging, etc.")
2606 (license license:bsd-3)))
2607
2608;; javacc-3, as javacc-4 is not properly bootstrapped: is contains a javacc.jar
2609;; in the bootstrap/ directory.
2610(define-public javacc-3
2611 (package
2612 (inherit javacc-4)
2613 (version "3.2")
2614 (source (origin
2615 (method git-fetch)
2616 (uri (git-reference
2617 (url "https://github.com/javacc/javacc")
2618 (commit "release_32")))
2619 (file-name (string-append "javacc-" version "-checkout"))
2620 (sha256
2621 (base32
2622 "1pyf1xyh8gk83nxqn2v2mdws32l68ydznha41cxa4l2kkbq1v1g3"))))
2623 (arguments
2624 `(#:tests? #f
2625 #:phases
2626 (modify-phases %standard-phases
2627 (add-before 'build 'set-java-version
2628 (lambda _
2629 (for-each
2630 (lambda (file)
2631 (substitute* file
2632 (("debug=") "source=\"1.4\" debug=")))
2633 (find-files "." "build.xml"))
2634 #t))
2635 (replace 'install (install-jars "bin/lib")))))))
2636
2637(define-public javacc
2638 (package
2639 (inherit javacc-4)
2640 (version "7.0.4")
2641 (source
2642 (origin
2643 (method git-fetch)
2644 (uri (git-reference
2645 (url "https://github.com/javacc/javacc")
2646 (commit version)))
2647 (file-name (git-file-name "javacc" version))
2648 (sha256
2649 (base32 "18kkak3gda93gr25jrgy6q00g0jr8i24ri2wk4kybz1v234fxx9i"))
2650 (modules '((guix build utils)))
2651 ;; Delete bundled jars.
2652 (snippet '(begin (for-each delete-file-recursively
2653 '("bootstrap" "lib"))))))
2654 (arguments
2655 `(#:make-flags ; bootstrap from javacc-4
2656 ,#~(list (string-append "-Dbootstrap-jar="
2657 #$(this-package-native-input "javacc")
2658 "/share/java/javacc.jar"))
2659 #:test-target "test"
2660 #:phases
2661 (modify-phases %standard-phases
2662 (replace 'install (install-jars "target"))
2663 (add-after 'install 'install-bin
2664 (lambda* (#:key outputs inputs #:allow-other-keys)
2665 (let* ((out (assoc-ref outputs "out"))
2666 (dir (string-append out "/share/java"))
2667 (bin (string-append out "/bin"))
2668 (javacc (string-append bin "/javacc")))
2669 (mkdir-p bin)
2670 (with-output-to-file javacc
2671 (lambda _
2672 (display
2673 (string-append "#!/bin/sh\n"
2674 (assoc-ref inputs "icedtea") "/bin/java"
2675 " -cp " dir "/javacc.jar" " `basename $0`" " $*"))))
2676 (chmod javacc #o755)
2677 ;; symlink to different names to affect the first argument and
2678 ;; change the behavior of the jar file.
2679 (symlink javacc (string-append bin "/jjdoc"))
2680 (symlink javacc (string-append bin "/jjtree"))))))))
2681 (native-inputs
2682 (list javacc-4))
2683 (inputs (list icedtea-8))))
2684
2685(define-public java-ecj
2686 (package
2687 (name "java-ecj")
2688 (version "4.6.3")
2689 (source
2690 (origin
2691 (method url-fetch)
2692 (uri (string-append "http://archive.eclipse.org/eclipse/"
2693 "downloads/drops4/R-" version "-201703010400/"
2694 "ecjsrc-" version ".jar"))
2695 (sha256
2696 (base32
2697 "11cfgsdgznja1pvlxkjbqykxd7pcd5655vkm7s44xmahmap15gpl"))))
2698 (build-system ant-build-system)
2699 (arguments
2700 `(#:tests? #f ; none included
2701 #:build-target "build"
2702 #:phases
2703 (modify-phases %standard-phases
2704 (add-after 'unpack 'fix-build.xml
2705 (lambda _
2706 (substitute* "src/build.xml"
2707 (("^.*MANIFEST.*$")
2708 "")
2709 (("^.*properties.*$")
2710 "<include name=\"**/*.properties\"/>
2711 <include name=\"**/*.props\"/>"))))
2712 (add-before 'build 'chdir
2713 (lambda _ (chdir "src")))
2714 (replace 'install (install-jars ".")))))
2715 (home-page "https://eclipse.org")
2716 (synopsis "Eclipse Java development tools core batch compiler")
2717 (description "This package provides the Eclipse Java core batch compiler.")
2718 (license license:epl1.0)))
2719
2720(define-public java-cisd-base
2721 (let ((revision 38938)
2722 (base-version "14.12.0"))
2723 (package
2724 (name "java-cisd-base")
2725 (version (string-append base-version "-" (number->string revision)))
2726 (source (origin
2727 (method svn-fetch)
2728 (uri (svn-reference
2729 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2730 "base/tags/release/"
2731 (version-major+minor base-version)
2732 ".x/" base-version "/base/"))
2733 (revision revision)))
2734 (file-name (string-append "java-cisd-base-" version "-checkout"))
2735 (sha256
2736 (base32
2737 "1i5adyf7nzclb0wydgwa1az04qliid8035vpahaandmkmigbnxiy"))
2738 (modules '((guix build utils)))
2739 (snippet
2740 '(begin
2741 ;; Delete included gradle jar
2742 (delete-file-recursively "gradle/wrapper")
2743 ;; Delete pre-built native libraries
2744 (delete-file-recursively "libs")
2745 #t))))
2746 (build-system ant-build-system)
2747 (arguments
2748 `(#:make-flags '("-file" "build/build.xml")
2749 #:test-target "jar-test"
2750 #:jdk ,icedtea-8
2751 #:phases
2752 (modify-phases %standard-phases
2753 (add-after 'unpack 'unpack-build-resources
2754 (lambda* (#:key inputs #:allow-other-keys)
2755 (copy-recursively (assoc-ref inputs "build-resources")
2756 "../build_resources")
2757 #t))
2758 (add-after 'unpack-build-resources 'fix-dependencies
2759 (lambda* (#:key inputs #:allow-other-keys)
2760 (substitute* "build/build.xml"
2761 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
2762 (search-input-file inputs
2763 "/share/java/java-testng.jar"))
2764 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
2765 (search-input-file inputs
2766 (string-append
2767 "/share/java/commons-lang-"
2768 ,(package-version java-commons-lang)
2769 ".jar")))
2770 (("\\$\\{lib\\}/commons-io/commons-io.jar")
2771 (search-input-file inputs
2772 (string-append
2773 "/lib/m2/commons-io/commons-io/"
2774 ,(package-version java-commons-io)
2775 "/commons-io-"
2776 ,(package-version java-commons-io)
2777 ".jar")))
2778 ;; Remove dependency on svn
2779 (("<build-info.*") "")
2780 (("\\$\\{revision.number\\}")
2781 ,(number->string revision))
2782 (("\\$\\{version.number\\}") ,base-version))
2783 ;; Remove dependency on classycle
2784 (substitute* "../build_resources/ant/build-common.xml"
2785 (("<taskdef name=\"dependency-checker.*") "")
2786 (("classname=\"classycle.*") "")
2787 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
2788 #t))
2789 ;; A few tests fail because of the lack of a proper /etc/groups and
2790 ;; /etc/passwd file in the build container.
2791 (add-after 'unpack 'disable-broken-tests
2792 (lambda _
2793 (substitute* "sourceTest/java/ch/systemsx/cisd/base/AllTests.java"
2794 (("Unix.isOperational\\(\\)") "false"))
2795 #t))
2796 ;; These decorators are almost useless and pull in an unpackaged
2797 ;; dependency.
2798 (add-after 'unpack 'remove-useless-decorators
2799 (lambda _
2800 (substitute* "source/java/ch/systemsx/cisd/base/unix/Unix.java"
2801 (("@Private") "")
2802 (("import ch.rinn.restrictions.Private;") ""))
2803 (substitute* "sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java"
2804 (("@Friend.*") "")
2805 (("import ch.rinn.restrictions.Friend;") ""))
2806 #t))
2807 (add-before 'configure 'build-native-code
2808 (lambda* (#:key inputs #:allow-other-keys)
2809 (let ((jdk (assoc-ref inputs "jdk"))
2810 (dir ,(match (%current-system)
2811 ("i686-linux"
2812 "i386-Linux")
2813 ((or "armhf-linux" "aarch64-linux")
2814 "arm-Linux")
2815 ((or "x86_64-linux")
2816 "amd64-Linux")
2817 (_ "unknown-Linux"))))
2818 (with-directory-excursion "source/c"
2819 (invoke "gcc" "-shared" "-O3" "-fPIC" "unix.c"
2820 (string-append "-I" jdk "/include")
2821 (string-append "-I" jdk "/include/linux")
2822 "-o" "libunix.so")
2823 (invoke "gcc" "-shared" "-O3" "-fPIC"
2824 "-DMACHINE_BYTE_ORDER=1"
2825 "copyCommon.c"
2826 "copyByteChar.c"
2827 "copyByteDouble.c"
2828 "copyByteFloat.c"
2829 "copyByteInt.c"
2830 "copyByteLong.c"
2831 "copyByteShort.c"
2832 (string-append "-I" jdk "/include")
2833 (string-append "-I" jdk "/include/linux")
2834 "-o" "libnativedata.so"))
2835 (install-file "source/c/libunix.so"
2836 (string-append "libs/native/unix/" dir))
2837 (install-file "source/c/libnativedata.so"
2838 (string-append "libs/native/nativedata/" dir))
2839 #t)))
2840 ;; In the "check" phase we only build the test executable.
2841 (add-after 'check 'run-tests
2842 (lambda _
2843 (invoke "java" "-jar" "targets/dist/sis-base-test.jar")
2844 (delete-file "targets/dist/sis-base-test.jar")
2845 #t))
2846 (replace 'install (install-jars "targets/dist")))))
2847 (native-inputs
2848 `(("jdk" ,icedtea-8)
2849 ("java-commons-lang" ,java-commons-lang)
2850 ("java-commons-io" ,java-commons-io)
2851 ("java-testng" ,java-testng)
2852 ("build-resources"
2853 ,(origin
2854 (method svn-fetch)
2855 (uri (svn-reference
2856 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2857 "base/tags/release/"
2858 (version-major+minor base-version)
2859 ".x/" base-version
2860 "/build_resources/"))
2861 (revision revision)))
2862 (sha256
2863 (base32
2864 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
2865 (home-page "https://svnsis.ethz.ch")
2866 (synopsis "Utility classes for libraries from ETH Zurich")
2867 (description "This library supplies some utility classes needed for
2868libraries from the SIS division at ETH Zurich like jHDF5.")
2869 ;; The C sources are under a non-copyleft license, which looks like a
2870 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
2871 (license (list license:asl2.0
2872 (license:non-copyleft "file://source/c/COPYING"))))))
2873
2874(define-public java-cisd-args4j
2875 (let ((revision 39162)
2876 (base-version "9.11.2"))
2877 (package
2878 (name "java-cisd-args4j")
2879 (version (string-append base-version "-" (number->string revision)))
2880 (source (origin
2881 (method svn-fetch)
2882 (uri (svn-reference
2883 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2884 "args4j/tags/release/"
2885 (version-major+minor base-version)
2886 ".x/" base-version "/args4j/"))
2887 (revision revision)))
2888 (file-name (string-append "java-cisd-args4j-" version "-checkout"))
2889 (sha256
2890 (base32
2891 "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2"))))
2892 (build-system ant-build-system)
2893 (arguments
2894 `(#:make-flags '("-file" "build/build.xml")
2895 #:tests? #f ; there are no tests
2896 #:modules ((guix build ant-build-system)
2897 (guix build utils)
2898 (guix build java-utils)
2899 (sxml simple)
2900 (sxml transform)
2901 (sxml xpath))
2902 #:phases
2903 (modify-phases %standard-phases
2904 (add-after 'unpack 'unpack-build-resources
2905 (lambda* (#:key inputs #:allow-other-keys)
2906 (mkdir-p "../build_resources")
2907 (copy-recursively (assoc-ref inputs "build-resources")
2908 "../build_resources")
2909 (mkdir-p "../build_resources/lib")))
2910 (add-after 'unpack-build-resources 'fix-dependencies
2911 (lambda* (#:key inputs #:allow-other-keys)
2912 ;; FIXME: There should be a more convenient abstraction for
2913 ;; editing XML files.
2914 (with-directory-excursion "../build_resources/ant/"
2915 (chmod "build-common.xml" #o664)
2916 (call-with-output-file "build-common.xml.new"
2917 (lambda (port)
2918 (sxml->xml
2919 (pre-post-order
2920 (with-input-from-file "build-common.xml"
2921 (lambda _ (xml->sxml #:trim-whitespace? #t)))
2922 `(;; Remove dependency on classycle and custom ant tasks
2923 (taskdef . ,(lambda (tag . kids)
2924 (let ((name ((sxpath '(name *text*)) kids)))
2925 (if (or (member "build-info" name)
2926 (member "dependency-checker" name)
2927 (member "build-java-subprojects" name)
2928 (member "project-classpath" name))
2929 '() ; skip
2930 `(,tag ,@kids)))))
2931 (typedef . ,(lambda (tag . kids)
2932 (let ((name ((sxpath '(name *text*)) kids)))
2933 (if (member "recursive-jar" name)
2934 '() ; skip
2935 `(,tag ,@kids)))))
2936 (build-java-subprojects . ,(lambda _ '()))
2937 ;; Ignore everything else
2938 (*default* . ,(lambda (tag . kids) `(,tag ,@kids)))
2939 (*text* . ,(lambda (_ txt) txt))))
2940 port)))
2941 (rename-file "build-common.xml.new" "build-common.xml"))
2942 (substitute* "build/build.xml"
2943 (("\\$\\{lib\\}/cisd-base/cisd-base.jar")
2944 (search-input-file inputs "/share/java/sis-base.jar"))
2945 ;; Remove dependency on svn
2946 (("<build-info.*") "")
2947 (("\\$\\{revision.number\\}")
2948 ,(number->string revision))
2949 (("\\$\\{version.number\\}") ,base-version)
2950 ;; Don't use custom ant tasks.
2951 (("recursive-jar") "jar")
2952 (("<project-classpath.*") ""))))
2953 (replace 'install (install-jars "targets/dist")))))
2954 (inputs
2955 (list java-cisd-base))
2956 (native-inputs
2957 `(("ecj" ,java-ecj)
2958 ("build-resources"
2959 ,(origin
2960 (method svn-fetch)
2961 (uri (svn-reference
2962 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2963 "args4j/tags/release/"
2964 (version-major+minor base-version)
2965 ".x/" base-version
2966 "/build_resources/"))
2967 (revision revision)))
2968 (sha256
2969 (base32
2970 "056cam4k8pll7ass31sy6gwn8g8719njc41yf4l02b0342nilkyf"))
2971 (modules '((guix build utils)))
2972 ;; Delete bundled pre-built jars.
2973 (snippet
2974 '(begin (delete-file-recursively "lib/") #t))))))
2975 (home-page "https://svnsis.ethz.ch")
2976 (synopsis "Command line parser library")
2977 (description "This package provides a parser for command line arguments.")
2978 (license license:asl2.0))))
2979
2980(define-public java-cisd-jhdf5
2981 (let ((revision 39162)
2982 (base-version "14.12.6"))
2983 (package
2984 (name "java-cisd-jhdf5")
2985 (version (string-append base-version "-" (number->string revision)))
2986 (source (origin
2987 (method svn-fetch)
2988 (uri (svn-reference
2989 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
2990 "jhdf5/tags/release/"
2991 (version-major+minor base-version)
2992 ".x/" base-version "/jhdf5/"))
2993 (revision revision)))
2994 (file-name (string-append "java-cisd-jhdf5-" version "-checkout"))
2995 (sha256
2996 (base32
2997 "13i17s2hn0q9drdqvp8csy7770p3hdbh9rp30ihln2ldkfawdmz0"))
2998 (modules '((guix build utils)))
2999 (snippet
3000 '(begin
3001 ;; Delete included gradle jar
3002 (delete-file-recursively "gradle/wrapper")
3003 ;; Delete pre-built native libraries
3004 (delete-file-recursively "libs")))))
3005 (build-system ant-build-system)
3006 (arguments
3007 `(#:make-flags '("-file" "build/build.xml")
3008 #:build-target "jar-all"
3009 #:test-target "jar-test"
3010 #:phases
3011 (modify-phases %standard-phases
3012 ;; FIXME: this build phase fails.
3013 (delete 'generate-jar-indices)
3014 ;; Don't erase results from the build phase when building tests.
3015 (add-after 'unpack 'separate-test-target-from-clean
3016 (lambda _
3017 (substitute* "build/build.xml"
3018 (("\"jar-test\" depends=\"clean, ")
3019 "\"jar-test\" depends=\""))))
3020 (add-after 'unpack 'unpack-build-resources
3021 (lambda* (#:key inputs #:allow-other-keys)
3022 (copy-recursively (assoc-ref inputs "build-resources")
3023 "../build_resources")
3024 (delete-file-recursively "../build_resources/lib/")
3025 (mkdir-p "../build_resources/lib")
3026 ;; Remove dependency on classycle
3027 (substitute* "../build_resources/ant/build-common.xml"
3028 (("<taskdef name=\"dependency-checker.*") "")
3029 (("classname=\"classycle.*") "")
3030 (("classpath=\"\\$\\{lib\\}/classycle.*") ""))
3031 ;; Remove dependency on svn
3032 (substitute* "build/build.xml"
3033 (("<build-info.*") "")
3034 (("\\$\\{revision.number\\}")
3035 ,(number->string revision))
3036 (("\\$\\{version.number\\}") ,base-version))))
3037 (add-after 'unpack-build-resources 'fix-dependencies
3038 (lambda* (#:key inputs #:allow-other-keys)
3039 (substitute* "../build_resources/ant/build-common.xml"
3040 (("../libraries/testng/testng-jdk15.jar")
3041 (search-input-file inputs
3042 "/share/java/java-testng.jar")))
3043 (substitute* "build/build.xml"
3044 (("\\$\\{lib\\}/sis-base/sis-base.jar")
3045 (search-input-file inputs
3046 "/share/java/sis-base.jar"))
3047 (("\\$\\{lib\\}/cisd-args4j/cisd-args4j.jar")
3048 (search-input-file inputs
3049 "/share/java/cisd-args4j.jar"))
3050 (("\\$\\{lib\\}/commons-lang/commons-lang.jar")
3051 (search-input-file inputs
3052 (string-append
3053 "/share/java/commons-lang-"
3054 ,(package-version java-commons-lang)
3055 ".jar")))
3056 (("\\$\\{lib\\}/commons-io/commons-io.jar")
3057 (search-input-file inputs
3058 (string-append
3059 "/lib/m2/commons-io/commons-io/"
3060 ,(package-version java-commons-io)
3061 "/commons-io-"
3062 ,(package-version java-commons-io)
3063 ".jar")))
3064 (("\\$\\{lib\\}/testng/testng-jdk15.jar")
3065 (search-input-file inputs
3066 "/share/java/java-testng.jar"))
3067 (("\\$\\{lib\\}/junit4/junit.jar")
3068 (car (find-files (assoc-ref inputs "java-junit") "jar$")))
3069 (("\\$\\{lib\\}/jmock/hamcrest/hamcrest-core.jar")
3070 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3071 "jar$"))))
3072 ;; Remove dependency on ch.rinn.restrictions
3073 (with-directory-excursion "source/java/ch/systemsx/cisd/hdf5/"
3074 (substitute* '("BitSetConversionUtils.java"
3075 "HDF5Utils.java")
3076 (("import ch.rinn.restrictions.Private;") "")
3077 (("@Private") "")))
3078 (with-directory-excursion "sourceTest/java/ch/systemsx/cisd/hdf5/"
3079 (substitute* '("BitSetConversionTest.java"
3080 "h5ar/HDF5ArchiverTest.java")
3081 (("import ch.rinn.restrictions.Friend;") "")
3082 (("@Friend.*") ""))
3083 ;; Remove leftovers from removing @Friend
3084 (substitute* "h5ar/HDF5ArchiverTest.java"
3085 (("\\{ HDF5Archiver.class, IdCache.class, LinkRecord.class \\}\\)")
3086 "")))))
3087 (add-before 'configure 'build-native-library
3088 (lambda* (#:key inputs #:allow-other-keys)
3089 (let ((jdk (assoc-ref inputs "jdk"))
3090 (hdf5 (assoc-ref inputs "hdf5"))
3091 (dir ,(match (%current-system)
3092 ("i686-linux"
3093 "i386-Linux")
3094 ((or "armhf-linux" "aarch64-linux")
3095 "arm-Linux")
3096 ((or "x86_64-linux")
3097 "amd64-Linux")
3098 (_ "unknown-Linux"))))
3099 (with-directory-excursion "source/c"
3100 (apply invoke `("gcc" "-shared" "-O3"
3101 "-fPIC"
3102 "-Wl,--exclude-libs,ALL"
3103 "-Wno-error=implicit-function-declaration"
3104 ,@(find-files "jhdf5" "\\.c$")
3105 ,@(find-files "hdf-java" "\\.c$")
3106 ,(string-append "-I" hdf5 "/include")
3107 ,(string-append "-I" jdk "/include")
3108 ,(string-append "-I" jdk "/include/linux")
3109 ,(string-append hdf5 "/lib/libhdf5.a")
3110 "-o" "libjhdf5.so" "-lz")))
3111 (install-file "source/c/libjhdf5.so"
3112 (string-append "libs/native/jhdf5/" dir)))))
3113 ;; In the "check" phase we only build the test executable.
3114 (add-after 'check 'run-tests
3115 (lambda _
3116 (invoke "java" "-jar" "targets/dist/sis-jhdf5-test.jar")
3117 (delete-file "targets/dist/sis-jhdf5-test.jar")))
3118 (replace 'install
3119 (install-jars "targets/dist")))))
3120 (inputs
3121 (list java-cisd-base
3122 java-cisd-args4j
3123 java-commons-lang
3124 java-commons-io
3125 hdf5-1.8
3126 zlib))
3127 (native-inputs
3128 `(("jdk" ,icedtea-8)
3129 ("java-testng" ,java-testng)
3130 ("java-junit" ,java-junit)
3131 ("java-jmock" ,java-jmock)
3132 ("java-hamcrest-core" ,java-hamcrest-core)
3133 ("build-resources"
3134 ,(origin
3135 (method svn-fetch)
3136 (uri (svn-reference
3137 (url (string-append "http://svnsis.ethz.ch/repos/cisd/"
3138 "jhdf5/tags/release/"
3139 (version-major+minor base-version)
3140 ".x/" base-version
3141 "/build_resources/"))
3142 (revision revision)))
3143 (sha256
3144 (base32
3145 "0b6335gkm4x895rac6kfg9d3rpq0sy19ph4zpg2gyw6asfsisjhk"))))))
3146 (home-page "https://wiki-bsse.ethz.ch/display/JHDF5/")
3147 (synopsis "Java binding for HDF5")
3148 (description "JHDF5 is a high-level API in Java for reading and writing
3149HDF5 files, building on the libraries provided by the HDF Group.")
3150 ;; The C sources are under a non-copyleft license, which looks like a
3151 ;; variant of the BSD licenses. The whole package is under the ASL2.0.
3152 (license (list license:asl2.0
3153 (license:non-copyleft "file://source/c/COPYING"))))))
3154
3155(define-public java-classpathx-servletapi
3156 (package
3157 (name "java-classpathx-servletapi")
3158 (version "3.0.1")
3159 (source (origin
3160 (method url-fetch)
3161 (uri (string-append "mirror://gnu/classpathx/servletapi/"
3162 "servletapi-" version ".tar.gz"))
3163 (sha256
3164 (base32
3165 "07d8h051siga2f33fra72hk12sbq1bxa4jifjg0qj0vfazjjff0x"))))
3166 (build-system ant-build-system)
3167 (arguments
3168 `(#:tests? #f ; there is no test target
3169 #:build-target "compile"
3170 #:make-flags
3171 ,#~(list "-Dbuild.compiler=javac1.8"
3172 (string-append "-Ddist=" #$output))
3173 #:phases
3174 (modify-phases %standard-phases
3175 (replace 'install
3176 (lambda* (#:key make-flags #:allow-other-keys)
3177 (apply invoke `("ant" "dist" ,@make-flags)))))))
3178 (home-page "https://www.gnu.org/software/classpathx/")
3179 (synopsis "Java servlet API implementation")
3180 (description "This is the GNU servlet API distribution, part of the
3181ClasspathX project. It provides implementations of version 3.0 of the servlet
3182API and version 2.1 of the Java ServerPages API.")
3183 (license license:gpl3+)))
3184
3185(define-public java-javaee-servletapi
3186 (package
3187 (name "java-javaee-servletapi")
3188 (version "3.1.0")
3189 (source (origin
3190 (method git-fetch)
3191 (uri (git-reference
3192 (url "https://github.com/javaee/servlet-spec")
3193 (commit version)))
3194 (file-name (git-file-name name version))
3195 (sha256
3196 (base32
3197 "0s03lj8w5an70lkqbjycgfrfk0kc07vbfav91jzk87gh3awf9ksl"))))
3198 (build-system ant-build-system)
3199 (arguments
3200 `(#:jar-name "javax-servletapi.jar"
3201 ;; no tests
3202 #:tests? #f
3203 #:source-dir "src/main/java"
3204 #:phases
3205 (modify-phases %standard-phases
3206 (add-before 'build 'copy-resources
3207 (lambda _
3208 (mkdir-p "build/classes/javax/servlet/http")
3209 (let ((from-prefix "src/main/java/javax/servlet/")
3210 (to-prefix "build/classes/javax/servlet/"))
3211 (for-each (lambda (f)
3212 (copy-file (string-append from-prefix f)
3213 (string-append to-prefix f)))
3214 (list "LocalStrings_ja.properties"
3215 "LocalStrings.properties"
3216 "LocalStrings_fr.properties"
3217 "http/LocalStrings_es.properties"
3218 "http/LocalStrings_ja.properties"
3219 "http/LocalStrings.properties"
3220 "http/LocalStrings_fr.properties")))
3221 #t)))))
3222 (native-inputs
3223 (list unzip))
3224 (home-page "https://javaee.github.io/servlet-spec/")
3225 (synopsis "Java servlet API")
3226 (description "Java Servlet is the foundation web specification in the
3227Java Enterprise Platform. Developers can build web applications using the
3228Servlet API to interact with the request/response workflow. This project
3229provides information on the continued development of the Java Servlet
3230specification.")
3231 ;; Main code is dual-licensed by Oracle under either GLP2 or CDDL 1.1.
3232 ;; Some files are licensed under ASL 2.0.
3233 (license (list license:asl2.0 license:gpl2 license:cddl1.1))))
3234
3235(define-public java-swt
3236 (package
3237 (name "java-swt")
3238 (version "4.7.1a")
3239 (source
3240 ;; The types of many variables and procedures differ in the sources
3241 ;; dependent on whether the target architecture is a 32-bit system or a
3242 ;; 64-bit system. Instead of patching the sources on demand in a build
3243 ;; phase we download either the 32-bit archive (which mostly uses "int"
3244 ;; types) or the 64-bit archive (which mostly uses "long" types).
3245 (let ((hash32 "09q0cbh90d90q3a7dx9430kc4m6bijrkr4lajrmzzvi0jjdpq4v9")
3246 (hash64 "17k5hs75a87ssmc5xhwdfdm2gn4zba0r837l2455za01krnkaa2q")
3247 (file32 "x86")
3248 (file64 "x86_64"))
3249 (let-values (((hash file)
3250 (match (or (%current-target-system) (%current-system))
3251 ("x86_64-linux" (values hash64 file64))
3252 (_ (values hash32 file32)))))
3253 (origin
3254 (method url-fetch)
3255 (uri (string-append
3256 "https://archive.eclipse.org/eclipse/downloads/drops4/"
3257 "R-" version "-201710090410/swt-" version
3258 "-gtk-linux-" file ".zip"))
3259 (sha256 (base32 hash))))))
3260 (build-system ant-build-system)
3261 (arguments
3262 `(#:jar-name "swt.jar"
3263 #:jdk ,icedtea-8
3264 #:tests? #f ; no "check" target
3265 #:phases
3266 (modify-phases %standard-phases
3267 (replace 'unpack
3268 (lambda* (#:key source #:allow-other-keys)
3269 (mkdir "swt")
3270 (invoke "unzip" source "-d" "swt")
3271 (chdir "swt")
3272 (mkdir "src")
3273 (invoke "unzip" "src.zip" "-d" "src")))
3274 ;; The classpath contains invalid icecat jars. Since we don't need
3275 ;; anything other than the JDK on the classpath, we can simply unset
3276 ;; it.
3277 (add-after 'configure 'unset-classpath
3278 (lambda _ (unsetenv "CLASSPATH") #t))
3279 (add-before 'build 'build-native
3280 (lambda* (#:key inputs outputs #:allow-other-keys)
3281 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3282 ;; Build shared libraries. Users of SWT have to set the system
3283 ;; property swt.library.path to the "lib" directory of this
3284 ;; package output.
3285 (mkdir-p lib)
3286 (setenv "OUTPUT_DIR" lib)
3287 (setenv "CC" ,(cc-for-target))
3288 (with-directory-excursion "src"
3289 (invoke "bash" "build.sh")))))
3290 (add-after 'install 'install-native
3291 (lambda* (#:key outputs #:allow-other-keys)
3292 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3293 (for-each (lambda (file)
3294 (install-file file lib))
3295 (find-files "." "\\.so$"))
3296 #t))))))
3297 (inputs
3298 `(("gtk" ,gtk+-2)
3299 ("libxtst" ,libxtst)
3300 ("libxt" ,libxt)
3301 ("mesa" ,mesa)
3302 ("glu" ,glu)))
3303 (native-inputs
3304 (list pkg-config unzip))
3305 (home-page "https://www.eclipse.org/swt/")
3306 (synopsis "Widget toolkit for Java")
3307 (description
3308 "SWT is a widget toolkit for Java designed to provide efficient, portable
3309access to the user-interface facilities of the operating systems on which it
3310is implemented.")
3311 ;; SWT code is licensed under EPL1.0
3312 ;; Gnome and Gtk+ bindings contain code licensed under LGPLv2.1
3313 ;; Cairo bindings contain code under MPL1.1
3314 ;; XULRunner 1.9 bindings contain code under MPL2.0
3315 (license (list
3316 license:epl1.0
3317 license:mpl1.1
3318 license:mpl2.0
3319 license:lgpl2.1+))))
3320
3321;; java-hamcrest-core uses qdox version 1.12. We package this version instead
3322;; of the latest release.
3323(define-public java-qdox-1.12
3324 (package
3325 (name "java-qdox")
3326 (version "1.12.1")
3327 (source (origin
3328 (method url-fetch)
3329 (uri (string-append "https://repo1.maven.org/maven2/"
3330 "com/thoughtworks/qdox/qdox/" version
3331 "/qdox-" version "-sources.jar"))
3332 (sha256
3333 (base32
3334 "0hlfbqq2avf5s26wxkksqmkdyk6zp9ggqn37c468m96mjv0n9xfl"))))
3335 (build-system ant-build-system)
3336 (arguments
3337 `(;; Tests require junit
3338 #:tests? #f
3339 #:jar-name "qdox.jar"
3340 #:phases
3341 (modify-phases %standard-phases
3342 (replace 'unpack
3343 (lambda* (#:key source #:allow-other-keys)
3344 (mkdir "src")
3345 (with-directory-excursion "src"
3346 (invoke "jar" "-xf" source))))
3347 ;; At this point we don't have junit, so we must remove the API
3348 ;; tests.
3349 (add-after 'unpack 'delete-tests
3350 (lambda _
3351 (delete-file-recursively "src/com/thoughtworks/qdox/junit")
3352 #t)))))
3353 (home-page "https://github.com/codehaus/qdox")
3354 (synopsis "Parse definitions from Java source files")
3355 (description
3356 "QDox is a high speed, small footprint parser for extracting
3357class/interface/method definitions from source files complete with JavaDoc
3358@code{@@tags}. It is designed to be used by active code generators or
3359documentation tools.")
3360 (license license:asl2.0)))
3361
3362(define-public java-qdox
3363 (package
3364 (name "java-qdox")
3365 ; Newer version exists, but this version is required by java-plexus-component-metadata
3366 (version "2.0-M2")
3367 (source (origin
3368 (method url-fetch)
3369 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3370 ;; Older releases at https://github.com/codehaus/qdox/
3371 ;; Note: The release at maven is pre-generated. The release at
3372 ;; github requires jflex.
3373 (uri (string-append "https://repo1.maven.org/maven2/"
3374 "com/thoughtworks/qdox/qdox/" version
3375 "/qdox-" version "-sources.jar"))
3376 (sha256
3377 (base32
3378 "10xxrcaicq6axszcr2jpygisa4ch4sinyx5q7kqqxv4lknrmxp5x"))))
3379 (build-system ant-build-system)
3380 (arguments
3381 `(#:jar-name "qdox.jar"
3382 #:tests? #f; no tests
3383 #:phases
3384 (modify-phases %standard-phases
3385 (add-before 'install 'create-pom
3386 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3387 #:name "QDox"))
3388 (replace 'install
3389 (install-from-pom "pom.xml")))))
3390 (home-page "https://github.com/codehaus/qdox")
3391 (synopsis "Parse definitions from Java source files")
3392 (description "QDox is a high speed, small footprint parser for extracting
3393class/interface/method definitions from source files complete with JavaDoc
3394@code{@@tags}. It is designed to be used by active code generators or
3395documentation tools.")
3396 (license license:asl2.0)))
3397
3398(define-public java-qdox-2-M9
3399 (package
3400 (inherit java-qdox)
3401 (version "2.0-M9"); required by plexus-java
3402 (source (origin
3403 (method url-fetch)
3404 ;; 2.0-M4, -M5 at https://github.com/paul-hammant/qdox
3405 ;; Older releases at https://github.com/codehaus/qdox/
3406 ;; Note: The release at maven is pre-generated. The release at
3407 ;; github requires jflex.
3408 (uri (string-append "https://repo1.maven.org/maven2/"
3409 "com/thoughtworks/qdox/qdox/" version
3410 "/qdox-" version "-sources.jar"))
3411 (sha256
3412 (base32
3413 "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg"))))
3414 (arguments
3415 (substitute-keyword-arguments (package-arguments java-qdox)
3416 ((#:phases phases)
3417 `(modify-phases ,phases
3418 (replace 'create-pom
3419 (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version
3420 #:name "QDox"))))))))
3421
3422(define-public java-jarjar
3423 (package
3424 (name "java-jarjar")
3425 (version "1.4")
3426 (source (origin
3427 (method url-fetch)
3428 (uri (string-append
3429 "https://storage.googleapis.com/google-code-archive-downloads/v2/"
3430 "code.google.com/jarjar/jarjar-src-" version ".zip"))
3431 (sha256
3432 (base32
3433 "1v8irhni9cndcw1l1wxqgry013s2kpj0qqn57lj2ji28xjq8ndjl"))
3434 (modules '((guix build utils)))
3435 (snippet
3436 '(begin
3437 ;; Delete bundled thirds-party jar archives.
3438 (delete-file-recursively "lib")
3439 (delete-file "src/test/enumtest.jar")
3440 ;; the CLASSPATH needs this directory, create an empty one
3441 (mkdir-p "lib")
3442 #t))))
3443 (build-system ant-build-system)
3444 (arguments
3445 `(;; Tests require junit, which ultimately depends on this package.
3446 #:tests? #f
3447 #:build-target "jar"
3448 #:phases
3449 (modify-phases %standard-phases
3450 (add-before 'build 'do-not-use-bundled-asm
3451 (lambda* (#:key inputs #:allow-other-keys)
3452 (substitute* "build.xml"
3453 (("<path id=\"path.build\">")
3454 (string-append "<path id=\"path.build\"><fileset dir=\""
3455 (assoc-ref inputs "java-asm-bootstrap")
3456 "/lib/m2\" includes=\"**/*.jar\"/>"))
3457 (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "")
3458 (("lib/asm-commons-4.0.jar")
3459 (car (find-files (assoc-ref inputs "java-asm-bootstrap")
3460 "asm-6.0.jar")))
3461 (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>")
3462 (string-append "<include name=\"org/objectweb/asm/"
3463 "commons/Remap*.class\"/>"
3464 "<include name=\"org/objectweb/asm/*.class\"/>"
3465 "<include name=\"org/objectweb/asm/"
3466 "signature/*.class\"/>"
3467 "<include name=\"org/objectweb/asm/"
3468 "commons/SignatureRemapper.class\"/>")))
3469 #t))
3470 (add-before 'build 'remove-maven-dependency
3471 (lambda _
3472 ;; We do not need to build jarjar as a maven plugin just yet, so
3473 ;; remove this file. Maven requires jarjar (but not that plugin),
3474 ;; so removing it improves the bootstrap.
3475 (delete-file "src/main/com/tonicsystems/jarjar/JarJarMojo.java")
3476 #t))
3477 (replace 'install
3478 (lambda* (#:key outputs #:allow-other-keys)
3479 (let ((target (string-append (assoc-ref outputs "out")
3480 "/share/java")))
3481 (install-file (string-append "dist/jarjar-" ,version ".jar")
3482 target))
3483 #t)))))
3484 (inputs
3485 (list java-asm-bootstrap))
3486 (native-inputs
3487 (list unzip))
3488 (home-page "https://code.google.com/archive/p/jarjar/")
3489 (synopsis "Repackage Java libraries")
3490 (description
3491 "Jar Jar Links is a utility that makes it easy to repackage Java
3492libraries and embed them into your own distribution. Jar Jar Links includes
3493an Ant task that extends the built-in @code{jar} task.")
3494 (license license:asl2.0)))
3495
3496(define-public java-hamcrest-core
3497 (package
3498 (name "java-hamcrest-core")
3499 (version "1.3")
3500 (source (origin
3501 (method git-fetch)
3502 (uri (git-reference
3503 (url "https://github.com/hamcrest/JavaHamcrest/")
3504 (commit (string-append "hamcrest-java-" version))))
3505 (file-name (git-file-name name version))
3506 (sha256
3507 (base32
3508 "16fxxkrd31ahqvcaby30jgh3z1i0zxh51m24hxgz0z2agxj6bc63"))
3509 (modules '((guix build utils)))
3510 (snippet
3511 '(begin
3512 ;; Delete bundled thirds-party jar archives.
3513 (delete-file-recursively "lib")
3514 #t))))
3515 (build-system ant-build-system)
3516 (arguments
3517 `(#:tests? #f ; Tests require junit
3518 #:modules ((guix build ant-build-system)
3519 (guix build java-utils)
3520 (guix build utils)
3521 (srfi srfi-1))
3522 #:make-flags (list (string-append "-Dversion=" ,version))
3523 #:test-target "unit-test"
3524 #:build-target "core"
3525 #:phases
3526 (modify-phases %standard-phases
3527 ;; Disable unit tests, because they require junit, which requires
3528 ;; hamcrest-core. We also give a fixed value to the "Built-Date"
3529 ;; attribute from the manifest for reproducibility.
3530 (add-before 'configure 'patch-build.xml
3531 (lambda _
3532 (substitute* "build.xml"
3533 (("unit-test, ") "")
3534 (("\\$\\{build.timestamp\\}") "guix"))
3535 #t))
3536 ;; Java's "getMethods()" returns methods in an unpredictable order.
3537 ;; To make the output of the generated code deterministic we must
3538 ;; sort the array of methods.
3539 (add-after 'unpack 'make-method-order-deterministic
3540 (lambda _
3541 (substitute* "hamcrest-generator/src/main/java/org/hamcrest/generator/ReflectiveFactoryReader.java"
3542 (("import java\\.util\\.Iterator;" line)
3543 (string-append line "\n"
3544 "import java.util.Arrays; import java.util.Comparator;"))
3545 (("allMethods = cls\\.getMethods\\(\\);" line)
3546 (string-append "_" line
3547 "
3548private Method[] getSortedMethods() {
3549 Arrays.sort(_allMethods, new Comparator<Method>() {
3550 @Override
3551 public int compare(Method a, Method b) {
3552 return a.toString().compareTo(b.toString());
3553 }
3554 });
3555 return _allMethods;
3556}
3557
3558private Method[] allMethods = getSortedMethods();")))
3559 #t))
3560 (add-before 'build 'do-not-use-bundled-qdox
3561 (lambda* (#:key inputs #:allow-other-keys)
3562 (substitute* "build.xml"
3563 (("lib/generator/qdox-1.12.jar")
3564 (string-append (assoc-ref inputs "java-qdox-1.12")
3565 "/share/java/qdox.jar")))
3566 #t))
3567 ;; build.xml searches for .jar files in this directoy, which
3568 ;; we remove from the source archive.
3569 (add-before 'build 'create-dummy-directories
3570 (lambda _
3571 (mkdir-p "lib/integration")
3572 #t))
3573 (add-before 'build 'create-pom
3574 (lambda _
3575 (substitute* "pom/hamcrest-core.pom"
3576 (("@VERSION@") ,version))
3577 #t))
3578 (replace 'install
3579 (install-from-pom "pom/hamcrest-core.pom")))))
3580 (native-inputs
3581 `(("java-qdox-1.12" ,java-qdox-1.12)
3582 ("java-jarjar" ,java-jarjar)))
3583 (propagated-inputs
3584 (list java-hamcrest-parent-pom))
3585 (home-page "https://hamcrest.org/")
3586 (synopsis "Library of matchers for building test expressions")
3587 (description
3588 "This package provides a library of matcher objects (also known as
3589constraints or predicates) allowing @code{match} rules to be defined
3590declaratively, to be used in other frameworks. Typical scenarios include
3591testing frameworks, mocking libraries and UI validation rules.")
3592 (license license:bsd-2)))
3593
3594(define-public java-hamcrest-parent-pom
3595 (package
3596 (inherit java-hamcrest-core)
3597 (properties '((hidden? . #t)))
3598 (name "java-hamcrest-parent-pom")
3599 (propagated-inputs '())
3600 (native-inputs '())
3601 (arguments
3602 `(#:tests? #f
3603 #:phases
3604 (modify-phases %standard-phases
3605 (delete 'configure)
3606 (replace 'build
3607 (lambda _
3608 (substitute* "pom/hamcrest-parent.pom"
3609 (("@VERSION@") ,(package-version java-hamcrest-core)))
3610 #t))
3611 (replace 'install
3612 (install-pom-file "pom/hamcrest-parent.pom")))))))
3613
3614(define-public java-hamcrest-library
3615 (package
3616 (inherit java-hamcrest-core)
3617 (name "java-hamcrest-library")
3618 (arguments
3619 (substitute-keyword-arguments (package-arguments java-hamcrest-core)
3620 ((#:build-target _) "library")
3621 ((#:phases phases)
3622 `(modify-phases ,phases
3623 (add-after 'unpack 'patch-classpath-for-integration
3624 (lambda* (#:key inputs #:allow-other-keys)
3625 (substitute* "build.xml"
3626 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
3627 (car (find-files (assoc-ref inputs "java-hamcrest-core")
3628 "jar$"))))
3629 #t))
3630 (replace 'create-pom
3631 (lambda _
3632 (substitute* "pom/hamcrest-library.pom"
3633 (("@VERSION@") ,(package-version java-hamcrest-core)))
3634 #t))
3635 (replace 'install
3636 (install-from-pom "pom/hamcrest-library.pom"))))))
3637 (propagated-inputs
3638 (list java-hamcrest-core java-hamcrest-parent-pom))))
3639
3640(define-public java-junit
3641 (package
3642 (name "java-junit")
3643 (version "4.12")
3644 (source (origin
3645 (method git-fetch)
3646 (uri (git-reference
3647 (url "https://github.com/junit-team/junit/")
3648 (commit (string-append "r" version))))
3649 (file-name (git-file-name name version))
3650 (sha256
3651 (base32
3652 "1j8avi91px1z8rjc89cfikwrvfifdmmsarwiyrcnr59ynvpz0v8h"))
3653 (modules '((guix build utils)))
3654 (snippet
3655 '(begin
3656 ;; Delete bundled jar archives.
3657 (delete-file-recursively "lib")
3658 #t))))
3659 (build-system ant-build-system)
3660 (arguments
3661 `(#:jar-name "junit.jar"
3662 #:source-dir "src/main/java"
3663 #:test-dir "src/test"
3664 #:test-exclude (list "**/SimpleTest.java" "**/StackTracesTest.java"
3665 "**/RuleChainTest.java" "**/TestWatchmanTest.java")
3666 #:phases
3667 (modify-phases %standard-phases
3668 (add-before 'check 'copy-test-resources
3669 (lambda _
3670 (copy-recursively "src/test/resources" "build/test-classes")
3671 #t))
3672 (replace 'install
3673 (install-from-pom "pom.xml")))))
3674 (propagated-inputs
3675 (list java-hamcrest-core))
3676 (native-inputs
3677 (list java-hamcrest-library))
3678 (home-page "https://junit.org/junit4/")
3679 (synopsis "Test framework for Java")
3680 (description
3681 "JUnit is a simple framework to write repeatable tests for Java projects.
3682JUnit provides assertions for testing expected results, test fixtures for
3683sharing common test data, and test runners for running tests.")
3684 (license license:epl1.0)))
3685
3686(define-public java-junitparams
3687 (package
3688 (name "java-junitparams")
3689 (version "1.1.1")
3690 (source (origin
3691 (method git-fetch)
3692 (uri (git-reference
3693 (url "https://github.com/Pragmatists/JUnitParams")
3694 (commit (string-append "JUnitParams-" version))))
3695 (file-name (git-file-name name version))
3696 (sha256
3697 (base32
3698 "0rb52xdfp99invyjrras3w0bf0a81cz30yd47rkkiyqcqj0y1q9b"))))
3699 (build-system ant-build-system)
3700 (arguments
3701 `(#:jar-name "junitparams.jar"
3702 #:source-dir "src/main/java"
3703 #:test-dir "src/test"
3704 #:test-exclude (list "**/SuperclassTest.java")))
3705 (inputs
3706 (list java-junit))
3707 (native-inputs
3708 (list java-junit java-hamcrest-core java-assertj))
3709 (home-page "https://github.com/Pragmatists/JUnitParams")
3710 (synopsis "Parameterised test support for JUnit")
3711 (description "The JUnitParams project adds a new runner to JUnit and
3712provides much easier and readable parametrised tests for JUnit.")
3713 (license license:asl2.0)))
3714
3715(define-public java-plexus-utils
3716 (package
3717 (name "java-plexus-utils")
3718 (version "3.3.0")
3719 (source (origin
3720 (method git-fetch)
3721 (uri (git-reference
3722 (url "https://github.com/codehaus-plexus/plexus-utils")
3723 (commit (string-append "plexus-utils-" version))))
3724 (file-name (git-file-name name version))
3725 (sha256
3726 (base32
3727 "0d0fq21rzjy0j55kcp8w9k1rbq9rwr0r7cc8239p9jbz54vihp0g"))))
3728 (build-system ant-build-system)
3729 ;; FIXME: The default build.xml does not include a target to install
3730 ;; javadoc files.
3731 (arguments
3732 `(#:jar-name "plexus-utils.jar"
3733 #:source-dir "src/main"
3734 #:phases
3735 (modify-phases %standard-phases
3736 (add-after 'unpack 'fix-reference-to-/bin-and-/usr
3737 (lambda _
3738 (substitute* "src/main/java/org/codehaus/plexus/util/\
3739cli/shell/BourneShell.java"
3740 (("/bin/sh") (which "sh"))
3741 (("/usr/") (getcwd)))
3742 #t))
3743 (add-after 'unpack 'fix-or-disable-broken-tests
3744 (lambda _
3745 (with-directory-excursion "src/test/java/org/codehaus/plexus/util"
3746 (substitute* '("cli/CommandlineTest.java"
3747 "cli/shell/BourneShellTest.java")
3748 (("/bin/sh") (which "sh"))
3749 (("/bin/echo") (which "echo")))
3750
3751 ;; This test depends on MavenProjectStub, but we don't have
3752 ;; a package for Maven.
3753 (delete-file "introspection/ReflectionValueExtractorTest.java")
3754
3755 ;; FIXME: The command line tests fail, maybe because they use
3756 ;; absolute paths.
3757 (delete-file "cli/CommandlineTest.java")
3758
3759 ;; These tests require openjdk jmh, which is not packaged yet
3760 (for-each delete-file (find-files "." "PerfTest.java$")))
3761 #t))
3762 (add-before 'build 'copy-resources
3763 (lambda _
3764 (copy-recursively "src/main/resources" "build/classes")
3765 #t))
3766 (replace 'install (install-from-pom "pom.xml")))))
3767 (native-inputs
3768 (list java-hamcrest-core java-junit))
3769 (propagated-inputs
3770 (list plexus-parent-pom-5.1))
3771 (home-page "https://codehaus-plexus.github.io/plexus-utils/")
3772 (synopsis "Common utilities for the Plexus framework")
3773 (description "This package provides various Java utility classes for the
3774Plexus framework to ease working with strings, files, command lines, XML and
3775more.")
3776 (license license:asl2.0)))
3777
3778(define-public java-plexus-utils-3.2.1
3779 (package
3780 (inherit java-plexus-utils)
3781 ;; plexus-build-api needs this version, later versions don't work
3782 (version "3.2.1")
3783 (source (origin
3784 (method git-fetch)
3785 (uri (git-reference
3786 (url "https://github.com/codehaus-plexus/plexus-utils")
3787 (commit (string-append "plexus-utils-" version))))
3788 (file-name (git-file-name "java-plexus-utils" version))
3789 (sha256
3790 (base32
3791 "1w169glixyk94jbczj8jzg897lsab46jihiaa3dhw0p06g35va8b"))))))
3792
3793(define-public java-plexus-interpolation
3794 (package
3795 (name "java-plexus-interpolation")
3796 (version "1.26")
3797 (source (origin
3798 (method git-fetch)
3799 (uri (git-reference
3800 (url "https://github.com/codehaus-plexus/plexus-interpolation")
3801 (commit (string-append "plexus-interpolation-" version))))
3802 (file-name (git-file-name name version))
3803 (sha256
3804 (base32
3805 "1rahjmhywf6d5m32qzlc9izawyvcd71abfm9k03f13rs2xmfxzlh"))))
3806 (build-system ant-build-system)
3807 (arguments
3808 `(#:jar-name "plexus-interpolation.jar"
3809 #:source-dir "src/main"
3810 #:phases
3811 (modify-phases %standard-phases
3812 (replace 'install (install-from-pom "pom.xml")))))
3813 (propagated-inputs
3814 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3815 (native-inputs
3816 (list java-junit java-hamcrest-core))
3817 (home-page "https://codehaus-plexus.github.io/plexus-interpolation/")
3818 (synopsis "Java components for interpolating ${} strings and the like")
3819 (description "Plexus interpolator is a modular, flexible interpolation
3820framework for the expression language style commonly seen in Maven, Plexus,
3821and other related projects.
3822
3823It has its foundation in the @code{org.codehaus.plexus.utils.interpolation}
3824package within @code{plexus-utils}, but has been separated in order to allow
3825these two libraries to vary independently of one another.")
3826 (license license:asl2.0)))
3827
3828(define-public java-plexus-classworlds
3829 (package
3830 (name "java-plexus-classworlds")
3831 (version "2.6.0")
3832 (source (origin
3833 (method git-fetch)
3834 (uri (git-reference
3835 (url "https://github.com/codehaus-plexus/plexus-classworlds")
3836 (commit (string-append "plexus-classworlds-" version))))
3837 (file-name (git-file-name name version))
3838 (sha256
3839 (base32
3840 "034k2hgvj1saalwbnzrbg4n0zgzwcpz1lhlb8q4kgglsp9pmm03s"))))
3841 (build-system ant-build-system)
3842 (arguments
3843 `(#:jar-name "plexus-classworlds.jar"
3844 #:source-dir "src/main"
3845 #:tests? #f;; FIXME: we need to generate some resources as in pom.xml
3846 #:phases
3847 (modify-phases %standard-phases
3848 (replace 'install (install-from-pom "pom.xml")))))
3849 (propagated-inputs
3850 `(("plexus-parent-pom-5.1" ,plexus-parent-pom-5.1)))
3851 (native-inputs
3852 (list java-junit))
3853 (home-page "https://codehaus-plexus.github.io/plexus-classworlds/")
3854 (synopsis "Java class loader framework")
3855 (description "Plexus classworlds replaces the native @code{ClassLoader}
3856mechanism of Java. It is especially useful for dynamic loading of application
3857components.")
3858 (license license:asl2.0)))
3859
3860(define java-plexus-container-default-bootstrap
3861 (package
3862 (name "java-plexus-container-default-bootstrap")
3863 (version "2.1.0")
3864 (source (origin
3865 (method git-fetch)
3866 (uri (git-reference
3867 (url "https://github.com/codehaus-plexus/plexus-containers")
3868 (commit (string-append "plexus-containers-" version))))
3869 (file-name (git-file-name name version))
3870 (sha256
3871 (base32
3872 "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1"))))
3873 (build-system ant-build-system)
3874 (arguments
3875 `(#:jar-name "container-default.jar"
3876 #:source-dir "plexus-container-default/src/main/java"
3877 #:test-dir "plexus-container-default/src/test"
3878 #:tests? #f; requires plexus-archiver, which depends on this package
3879 #:phases
3880 (modify-phases %standard-phases
3881 (add-before 'build 'fix-google-collections
3882 (lambda _
3883 ;; Google collections are now replaced with guava
3884 (substitute* "plexus-container-default/pom.xml"
3885 (("google-collections") "guava")
3886 (("com.google.collections") "com.google.guava"))
3887 #t))
3888 (add-before 'build 'copy-resources
3889 (lambda _
3890 (copy-recursively
3891 "plexus-container-default/src/main/resources/"
3892 "build/classes")
3893 #t))
3894 (replace 'install
3895 (install-from-pom "plexus-container-default/pom.xml")))))
3896 (propagated-inputs
3897 `(("java-plexus-worldclass" ,java-plexus-classworlds)
3898 ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect)
3899 ("java-plexus-utils" ,java-plexus-utils)
3900 ("java-junit" ,java-junit)
3901 ("java-guava" ,java-guava)
3902 ("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom)))
3903 (home-page "https://github.com/codehaus-plexus/plexus-containers")
3904 (synopsis "Inversion-of-control container")
3905 (description "Plexus-default-container is Plexus' inversion-of-control
3906(@dfn{IoC}) container. It is composed of its public API and its default
3907implementation.")
3908 (license license:asl2.0)))
3909
3910(define java-plexus-containers-parent-pom
3911 (package
3912 (inherit java-plexus-container-default-bootstrap)
3913 (name "java-plexus-containers-parent-pom")
3914 (arguments
3915 `(#:tests? #f
3916 #:phases
3917 (modify-phases %standard-phases
3918 (delete 'configure)
3919 (delete 'build)
3920 (replace 'install
3921 (install-pom-file "pom.xml")))))
3922 (propagated-inputs
3923 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
3924
3925(define-public java-plexus-io
3926 (package
3927 (name "java-plexus-io")
3928 (version "3.2.0")
3929 (source (origin
3930 (method git-fetch)
3931 (uri (git-reference
3932 (url "https://github.com/codehaus-plexus/plexus-io")
3933 (commit (string-append "plexus-io-" version))))
3934 (file-name (git-file-name name version))
3935 (sha256
3936 (base32
3937 "1r3wqfpbxq8vp4p914i8p88r0994rmcjw02hz14n11cfb6gsyvlr"))))
3938 (build-system ant-build-system)
3939 (arguments
3940 `(#:jar-name "plexus-io.jar"
3941 #:source-dir "src/main/java"
3942 #:test-dir "src/test"
3943 #:phases
3944 (modify-phases %standard-phases
3945 (add-before 'build 'copy-resources
3946 (lambda _
3947 (mkdir-p "build/classes")
3948 (copy-recursively "src/main/resources" "build/classes")
3949 (mkdir-p "build/test-classes")
3950 (copy-recursively "src/test/resources" "build/test-classes")
3951 #t))
3952 (replace 'install (install-from-pom "pom.xml")))))
3953 (propagated-inputs
3954 (list java-plexus-utils java-commons-io plexus-parent-pom-5.1))
3955 (inputs
3956 (list java-jsr305))
3957 (native-inputs
3958 `(("junit" ,java-junit)
3959 ("hamcrest" ,java-hamcrest-core)
3960 ("guava" ,java-guava)
3961 ("classworlds" ,java-plexus-classworlds)
3962 ("xbean" ,java-geronimo-xbean-reflect)
3963 ("container-default" ,java-plexus-container-default-bootstrap)))
3964 (home-page "https://github.com/codehaus-plexus/plexus-io")
3965 (synopsis "I/O plexus components")
3966 (description "Plexus IO is a set of plexus components, which are designed
3967for use in I/O operations. This implementation using plexus components allows
3968reusing it in maven.")
3969 (license license:asl2.0)))
3970
3971(define-public java-plexus-archiver
3972 (package
3973 (name "java-plexus-archiver")
3974 (version "4.2.2")
3975 (source (origin
3976 (method url-fetch)
3977 (uri (string-append "https://github.com/codehaus-plexus/plexus-archiver"
3978 "/archive/plexus-archiver-" version ".tar.gz"))
3979 (sha256
3980 (base32
3981 "144n971r3lfrx3l12nf2scm80x4xdvgbkk4bjpa4vcvvdrll6qys"))))
3982 (build-system ant-build-system)
3983 (arguments
3984 `(#:jar-name "plexus-archiver.jar"
3985 #:source-dir "src/main/java"
3986 #:test-dir "src/test"
3987 #:test-exclude (list "**/Abstract*.java" "**/Base*.java")
3988 #:phases
3989 (modify-phases %standard-phases
3990 (add-before 'check 'remove-failing
3991 (lambda _
3992 ;; Requires an older version of plexus container
3993 (delete-file
3994 "src/test/java/org/codehaus/plexus/archiver/DuplicateFilesTest.java")
3995 #t))
3996 (add-before 'check 'fix-test-building
3997 (lambda _
3998 (substitute* "build.xml"
3999 (("srcdir=\"src/test\"") "srcdir=\"src/test/java\""))
4000 #t))
4001 (add-before 'build 'copy-resources
4002 (lambda _
4003 (mkdir-p "build/classes")
4004 (copy-recursively "src/main/resources" "build/classes")
4005 (mkdir-p "build/test-classes")
4006 (copy-recursively "src/test/resources" "build/test-classes")
4007 #t))
4008 (replace 'install (install-from-pom "pom.xml")))))
4009 (propagated-inputs
4010 (list java-plexus-utils java-plexus-io java-iq80-snappy
4011 java-commons-compress plexus-parent-pom-6.1))
4012 (inputs
4013 `(("java-jsr305" ,java-jsr305)
4014 ("java-plexus-container-default"
4015 ,java-plexus-container-default-bootstrap)))
4016 (native-inputs
4017 `(("java-hamcrest-core" ,java-hamcrest-core)
4018 ("junit" ,java-junit)
4019 ("classworld" ,java-plexus-classworlds)
4020 ("xbean" ,java-geronimo-xbean-reflect)
4021 ("xz" ,java-xz)
4022 ("guava" ,java-guava)))
4023 (home-page "https://github.com/codehaus-plexus/plexus-archiver")
4024 (synopsis "Archiver component of the Plexus project")
4025 (description "Plexus-archiver contains a component to deal with project
4026archives (jar).")
4027 (license license:asl2.0)))
4028
4029(define-public java-plexus-container-default
4030 (package
4031 (inherit java-plexus-container-default-bootstrap)
4032 (name "java-plexus-container-default")
4033 (arguments
4034 `(#:jar-name "container-default.jar"
4035 #:source-dir "plexus-container-default/src/main/java"
4036 #:test-dir "plexus-container-default/src/test"
4037 #:test-exclude (list ;"**/*Test.java"
4038 "**/Abstract*.java"
4039 ;; Requires plexus-hierarchy
4040 "**/PlexusHierarchyTest.java"
4041 ;; Failures
4042 "**/ComponentRealmCompositionTest.java"
4043 "**/PlexusContainerTest.java")
4044 #:phases
4045 (modify-phases %standard-phases
4046 (add-before 'build 'fix-google-collections
4047 (lambda _
4048 ;; Google collections are now replaced with guava
4049 (substitute* "plexus-container-default/pom.xml"
4050 (("google-collections") "guava")
4051 (("com.google.collections") "com.google.guava"))
4052 #t))
4053 (add-before 'build 'copy-resources
4054 (lambda _
4055 (copy-recursively
4056 "plexus-container-default/src/main/resources/"
4057 "build/classes")
4058 #t))
4059 (add-before 'check 'fix-paths
4060 (lambda _
4061 (let ((dir "plexus-container-default/src/test/java/org/codehaus"))
4062 (substitute*
4063 (string-append
4064 dir "/plexus/component/composition/"
4065 "ComponentRealmCompositionTest.java")
4066 (("src/test") "plexus-container-default/src/test"))
4067 #t)))
4068 (replace 'install
4069 (install-from-pom "plexus-container-default/pom.xml")))))
4070 (inputs
4071 `(("worldclass" ,java-plexus-classworlds)
4072 ("xbean" ,java-geronimo-xbean-reflect)
4073 ("utils" ,java-plexus-utils)
4074 ("junit" ,java-junit)
4075 ("guava" ,java-guava)))
4076 (native-inputs
4077 `(("archiver" ,java-plexus-archiver)
4078 ("hamcrest" ,java-hamcrest-core)))))
4079
4080(define-public java-plexus-component-annotations
4081 (package
4082 (inherit java-plexus-container-default)
4083 (name "java-plexus-component-annotations")
4084 (arguments
4085 `(#:jar-name "plexus-component-annotations.jar"
4086 #:source-dir "plexus-component-annotations/src/main/java"
4087 #:tests? #f; no tests
4088 #:phases
4089 (modify-phases %standard-phases
4090 (replace 'install
4091 (install-from-pom "plexus-component-annotations/pom.xml")))))
4092 (propagated-inputs
4093 (list java-plexus-containers-parent-pom))
4094 (inputs '())
4095 (native-inputs '())
4096 (synopsis "Plexus descriptors generator")
4097 (description "This package is a Maven plugin to generate Plexus descriptors
4098from source tags and class annotations.")))
4099
4100(define-public java-plexus-component-metadata
4101 (package
4102 (inherit java-plexus-container-default)
4103 (name "java-plexus-component-metadata")
4104 (arguments
4105 `(#:jar-name "plexus-component-metadata.jar"
4106 #:source-dir "src/main/java"
4107 #:test-dir "src/test"
4108 #:jdk ,icedtea-8
4109 #:phases
4110 (modify-phases %standard-phases
4111 (add-before 'configure 'chdir
4112 (lambda _
4113 (chdir "plexus-component-metadata")
4114 #t))
4115 (add-before 'build 'copy-resources
4116 (lambda _
4117 (copy-recursively "src/main/resources"
4118 "build/classes/")
4119 #t))
4120 (add-before 'build 'fix-jdom
4121 (lambda _
4122 ;; The newer version of jdom now sets multiple features by default
4123 ;; that are not supported.
4124 ;; Skip these features
4125 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4126 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4127 "// skip"))))
4128 (add-before 'build 'reinstate-cli
4129 ;; The CLI was removed in 2.1.0, but we still need it to build some
4130 ;; maven dependencies, and some parts of maven itself. We can't use
4131 ;; the maven plugin for that yet.
4132 (lambda _
4133 (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java"
4134 (lambda _
4135 ;; Copied from a previous version of this package.
4136 (display "package org.codehaus.plexus.metadata;
4137
4138import java.io.File;
4139import java.util.Arrays;
4140import java.util.Collections;
4141
4142import org.apache.commons.cli.CommandLine;
4143import org.apache.commons.cli.OptionBuilder;
4144import org.apache.commons.cli.Options;
4145import org.codehaus.plexus.PlexusContainer;
4146import org.codehaus.plexus.tools.cli.AbstractCli;
4147
4148public class PlexusMetadataGeneratorCli
4149 extends AbstractCli
4150{
4151 public static final char SOURCE_DIRECTORY = 's';
4152 public static final char SOURCE_ENCODING = 'e';
4153 public static final char CLASSES_DIRECTORY = 'c';
4154 public static final char OUTPUT_FILE = 'o';
4155 public static final char DESCRIPTORS_DIRECTORY = 'm';
4156
4157 public static void main( String[] args )
4158 throws Exception
4159 {
4160 new PlexusMetadataGeneratorCli().execute( args );
4161 }
4162
4163 @Override
4164 public String getPomPropertiesPath()
4165 {
4166 return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\";
4167 }
4168
4169 @Override
4170 @SuppressWarnings(\"static-access\")
4171 public Options buildCliOptions( Options options )
4172 {
4173 options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) );
4174 options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) );
4175 options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) );
4176 options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) );
4177 options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) );
4178 return options;
4179 }
4180
4181 public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus )
4182 throws Exception
4183 {
4184 MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class );
4185
4186 MetadataGenerationRequest request = new MetadataGenerationRequest();
4187 request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) );
4188 request.classpath = Collections.emptyList();
4189 request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } );
4190 request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING );
4191 request.useContextClassLoader = true;
4192 request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) );
4193 request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) );
4194
4195 metadataGenerator.generateDescriptor( request );
4196 }
4197}")))))
4198 (add-before 'check 'fix-test-location
4199 (lambda _
4200 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4201 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4202 (("target") "build")))))))
4203 (propagated-inputs
4204 `(("java-plexus-container-default" ,java-plexus-container-default)
4205 ("java-plexu-component-annotations" ,java-plexus-component-annotations)
4206 ("java-plexus-utils" ,java-plexus-utils)
4207 ("java-plexus-cli" ,java-plexus-cli)
4208 ("java-plexus-classworlds" ,java-plexus-classworlds)
4209 ("maven-plugin-api" ,maven-plugin-api)
4210 ("maven-plugin-annotations" ,maven-plugin-annotations)
4211 ("maven-core-bootstrap" ,maven-core-bootstrap)
4212 ("maven-model" ,maven-model)
4213 ("java-commons-cli" ,java-commons-cli)
4214 ("java-qdox" ,java-qdox)
4215 ("java-jdom2" ,java-jdom2)
4216 ("java-asm-8" ,java-asm-8)))
4217 (native-inputs
4218 (list java-junit java-guava java-geronimo-xbean-reflect))
4219 (synopsis "Inversion-of-control container for Maven")
4220 (description "The Plexus project provides a full software stack for creating
4221and executing software projects. Based on the Plexus container, the
4222applications can utilise component-oriented programming to build modular,
4223reusable components that can easily be assembled and reused. This package
4224provides the Maven plugin generating the component metadata.")))
4225
4226(define-public java-plexus-container-default-1.7
4227 (package
4228 (inherit java-plexus-container-default)
4229 (version "1.7.1")
4230 (source (origin
4231 (method git-fetch)
4232 (uri (git-reference
4233 (url "https://github.com/codehaus-plexus/plexus-containers")
4234 (commit (string-append "plexus-containers-" version))))
4235 (file-name (git-file-name "java-plexus-container-default" version))
4236 (sha256
4237 (base32
4238 "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228"))))))
4239
4240(define java-plexus-containers-parent-pom-1.7
4241 (package
4242 (inherit java-plexus-container-default-1.7)
4243 (name "java-plexus-containers-parent-pom")
4244 (arguments
4245 `(#:tests? #f
4246 #:phases
4247 (modify-phases %standard-phases
4248 (delete 'configure)
4249 (delete 'build)
4250 (replace 'install
4251 (install-pom-file "pom.xml")))))
4252 (propagated-inputs
4253 `(("plexus-parent-pom" ,plexus-parent-pom-4.0)))))
4254
4255(define-public java-plexus-component-annotations-1.7
4256 (package
4257 (inherit java-plexus-container-default-1.7)
4258 (name "java-plexus-component-annotations")
4259 (arguments
4260 `(#:jar-name "plexus-component-annotations.jar"
4261 #:source-dir "plexus-component-annotations/src/main/java"
4262 #:tests? #f; no tests
4263 #:phases
4264 (modify-phases %standard-phases
4265 (replace 'install
4266 (install-from-pom "plexus-component-annotations/pom.xml")))))
4267 (propagated-inputs
4268 `(("java-plexus-containers-parent-pom-1.7" ,java-plexus-containers-parent-pom-1.7)))
4269 (inputs '())
4270 (native-inputs '())
4271 (synopsis "Plexus descriptors generator")
4272 (description "This package is a Maven plugin to generate Plexus descriptors
4273from source tags and class annotations.")))
4274
4275(define-public java-plexus-component-metadata-1.7
4276 (package
4277 (inherit java-plexus-container-default-1.7)
4278 (name "java-plexus-component-metadata")
4279 (arguments
4280 `(#:jar-name "plexus-component-metadata.jar"
4281 #:source-dir "src/main/java"
4282 #:test-dir "src/test"
4283 #:phases
4284 (modify-phases %standard-phases
4285 (add-before 'configure 'chdir
4286 (lambda _
4287 (chdir "plexus-component-metadata")
4288 #t))
4289 (add-before 'build 'copy-resources
4290 (lambda _
4291 (copy-recursively "src/main/resources"
4292 "build/classes/")
4293 #t))
4294 (add-before 'build 'fix-jdom
4295 (lambda _
4296 ;; The newer version of jdom now sets multiple features by default
4297 ;; that are not supported.
4298 ;; Skip these features
4299 (substitute* "src/main/java/org/codehaus/plexus/metadata/merge/MXParser.java"
4300 (("throw new XmlPullParserException\\(\"unsupporte feature \"\\+name\\);")
4301 "// skip"))))
4302 (add-before 'check 'fix-test-location
4303 (lambda _
4304 (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java"
4305 "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java")
4306 (("target") "build")))))))
4307 (propagated-inputs
4308 (list java-plexus-container-default-1.7
4309 java-plexus-component-annotations-1.7
4310 java-plexus-utils
4311 java-plexus-cli
4312 java-plexus-cli
4313 java-plexus-classworlds
4314 maven-plugin-api
4315 maven-plugin-annotations
4316 maven-core-bootstrap
4317 maven-model
4318 java-commons-cli
4319 java-qdox
4320 java-jdom2
4321 java-asm-8))
4322 (native-inputs
4323 (list java-junit java-guava java-geronimo-xbean-reflect))
4324 (synopsis "Inversion-of-control container for Maven")
4325 (description "The Plexus project provides a full software stack for creating
4326and executing software projects. Based on the Plexus container, the
4327applications can utilise component-oriented programming to build modular,
4328reusable components that can easily be assembled and reused. This package
4329provides the Maven plugin generating the component metadata.")))
4330
4331(define-public java-plexus-cipher
4332 (package
4333 (name "java-plexus-cipher")
4334 (version "2.0")
4335 (source (origin
4336 (method git-fetch)
4337 (uri (git-reference
4338 (url "https://github.com/codehaus-plexus/plexus-cipher")
4339 (commit (string-append "plexus-cipher-" version))))
4340 (file-name (git-file-name name version))
4341 (sha256
4342 (base32
4343 "01fipdsm090n8j4207fl8kbxznkgkmkkgyazf53hm1nwn6na5aai"))))
4344 (build-system ant-build-system)
4345 (arguments
4346 `(#:jar-name "plexus-cipher.jar"
4347 #:source-dir "src/main/java"
4348 #:phases
4349 (modify-phases %standard-phases
4350 (add-before 'build 'generate-javax.inject.Named
4351 (lambda _
4352 (mkdir-p "build/classes/META-INF/sisu")
4353 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4354 (lambda _
4355 (display
4356 "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4357 #t))
4358 (replace 'install (install-from-pom "pom.xml")))))
4359 (inputs
4360 `(("java-cdi-api" ,java-cdi-api)
4361 ("java-javax-inject" ,java-javax-inject)))
4362 (propagated-inputs
4363 `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15)
4364 ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject)))
4365 (native-inputs
4366 `(("java-junit" ,java-junit)))
4367 (home-page "https://github.com/sonatype/plexus-cipher")
4368 (synopsis "Encryption/decryption Component")
4369 (description "Plexus-cipher contains a component to deal with encryption
4370and decryption.")
4371 (license license:asl2.0)))
4372
4373(define-public java-plexus-cipher-1.7
4374 (package
4375 (inherit java-plexus-cipher)
4376 (version "1.7")
4377 (source (origin
4378 (method git-fetch)
4379 (uri (git-reference
4380 (url "https://github.com/codehaus-plexus/plexus-cipher")
4381 (commit (string-append "plexus-cipher-" version))))
4382 (file-name (git-file-name "java-plexus-cipher" version))
4383 (sha256
4384 (base32
4385 "0m638nzlxbmnbcj5cwdpgs326ab584yv0k803zlx37r6iqwvf6b0"))))
4386 (arguments
4387 `(#:jar-name "plexus-cipher.jar"
4388 #:source-dir "src/main/java"
4389 #:tests? #f; FIXME: requires sisu-inject-bean
4390 #:phases
4391 (modify-phases %standard-phases
4392 (add-before 'build 'copy-resources
4393 (lambda _
4394 (copy-recursively "src/main/resources" "build/classes")
4395 (mkdir-p "build/classes/META-INF/sisu")
4396 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4397 (lambda _
4398 (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n")))
4399 #t))
4400 (add-before 'install 'fix-test-dependency
4401 (lambda _
4402 ;; sisu-inject-bean is only used for tests, but its scope is "provided".
4403 (substitute* "pom.xml"
4404 (("provided") "test"))
4405 #t))
4406 (replace 'install (install-from-pom "pom.xml")))))
4407 (propagated-inputs
4408 (list java-sonatype-spice-parent-pom-15))))
4409
4410(define-public java-plexus-java
4411 (package
4412 (name "java-plexus-java")
4413 (version "0.9.10")
4414 (source (origin
4415 (method git-fetch)
4416 (uri (git-reference
4417 (url "https://github.com/codehaus-plexus/plexus-languages")
4418 (commit (string-append "plexus-languages-" version))))
4419 (file-name (git-file-name name version))
4420 (sha256
4421 (base32
4422 "0vmvgq5hfxs90yyxgssfpwq78l7vwx1ljwpkk594mrdr8sm668b5"))
4423 (modules '((guix build utils)))
4424 (snippet
4425 `(begin
4426 (for-each delete-file (find-files "." ".*.jar$"))
4427 #t))))
4428 (build-system ant-build-system)
4429 (arguments
4430 `(#:jar-name "plexus-java.java"
4431 #:source-dir "plexus-java/src/main/java"
4432 #:test-dir "plexus-java/src/test"
4433 #:tests? #f; require mockito 2
4434 #:phases
4435 (modify-phases %standard-phases
4436 (add-after 'build 'generate-metadata
4437 (lambda _
4438 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4439 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4440 "--source" "plexus-java/src/main/java"
4441 "--output" "build/classes/META-INF/plexus/components.xml"
4442 "--classes" "build/classes"
4443 "--descriptors" "build/classes/META-INF")
4444 (invoke "ant" "jar")
4445 #t))
4446 (add-before 'install 'install-parent
4447 (install-pom-file "pom.xml"))
4448 (replace 'install
4449 (install-from-pom "plexus-java/pom.xml")))))
4450 (propagated-inputs
4451 (list java-asm java-qdox-2-M9 java-javax-inject
4452 plexus-parent-pom-4.0))
4453 (inputs
4454 (list java-plexus-component-annotations-1.7))
4455 (native-inputs
4456 (list java-plexus-component-metadata-1.7 java-junit))
4457 (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java")
4458 (synopsis "Shared language features for Java")
4459 (description "This package contains shared language features of the Java
4460language, for the plexus project.")
4461 (license license:asl2.0)))
4462
4463(define-public java-plexus-compiler-api
4464 (package
4465 (name "java-plexus-compiler-api")
4466 (version "2.8.4")
4467 (source (origin
4468 (method git-fetch)
4469 (uri (git-reference
4470 (url "https://github.com/codehaus-plexus/plexus-compiler")
4471 (commit (string-append "plexus-compiler-" version))))
4472 (file-name (git-file-name name version))
4473 (sha256
4474 (base32
4475 "1nq1gnn3s6z1j29gmi1hqbklsmm8b1lmnafb0191914f95mn18gk"))))
4476 (build-system ant-build-system)
4477 (arguments
4478 `(#:jar-name "plexus-compiler-api.jar"
4479 #:source-dir "plexus-compiler-api/src/main/java"
4480 #:test-dir "plexus-compiler-api/src/test"
4481 #:phases
4482 (modify-phases %standard-phases
4483 (replace 'install
4484 (install-from-pom "plexus-compiler-api/pom.xml")))))
4485 (propagated-inputs
4486 `(("java-plexus-container-default" ,java-plexus-container-default)
4487 ("java-plexus-compiler-pom" ,java-plexus-compiler-pom)
4488 ("java-plexus-util" ,java-plexus-utils)))
4489 (native-inputs
4490 (list java-junit))
4491 (home-page "https://github.com/codehaus-plexus/plexus-compiler")
4492 (synopsis "Plexus Compilers component's API to manipulate compilers")
4493 (description "This package contains the API used by components to manipulate
4494compilers.")
4495 (license (list license:asl2.0
4496 license:expat))))
4497
4498(define java-plexus-compiler-pom
4499 (package
4500 (inherit java-plexus-compiler-api)
4501 (name "java-plexus-compiler-pom")
4502 (arguments
4503 `(#:tests? #f
4504 #:phases
4505 (modify-phases %standard-phases
4506 (delete 'configure)
4507 (delete 'build)
4508 (replace 'install
4509 (install-pom-file "pom.xml"))
4510 (add-after 'install 'install-compilers
4511 (install-pom-file "plexus-compilers/pom.xml")))))
4512 (propagated-inputs
4513 `(("plexus-components-parent-pom-4.0" ,plexus-components-parent-pom-4.0)))))
4514
4515(define plexus-components-parent-pom-4.0
4516 (package
4517 (name "plexus-components-parent-pom")
4518 (version "4.0")
4519 (source (origin
4520 (method git-fetch)
4521 (uri (git-reference
4522 (url "https://github.com/codehaus-plexus/plexus-components")
4523 (commit (string-append "plexus-components-" version))))
4524 (file-name (git-file-name name version))
4525 (sha256
4526 (base32
4527 "041bm8yv0m2i17mqg8zljib4ykpha7ijls2qfdwvkma4d39lhysi"))))
4528 (build-system ant-build-system)
4529 (arguments
4530 `(#:tests? #f
4531 #:phases
4532 (modify-phases %standard-phases
4533 (delete 'configure)
4534 (delete 'build)
4535 (replace 'install
4536 (install-pom-file "pom.xml")))))
4537 (propagated-inputs
4538 `(("plexus-parent-pom-4.0" ,plexus-parent-pom-4.0)))
4539 (home-page "https://codehaus-plexus.github.io/plexus-components")
4540 (synopsis "Plexus parent pom")
4541 (description "This package contains the Plexus components parent POM.")
4542 (license license:asl2.0)))
4543
4544(define-public java-plexus-compiler-manager
4545 (package
4546 (inherit java-plexus-compiler-api)
4547 (name "java-plexus-compiler-manager")
4548 (arguments
4549 `(#:jar-name "compiler-compiler-manager.java"
4550 #:source-dir "plexus-compiler-manager/src/main/java"
4551 #:test-dir "plexus-compiler-manager/src/test"
4552 #:tests? #f
4553 #:phases
4554 (modify-phases %standard-phases
4555 (add-after 'build 'generate-metadata
4556 (lambda _
4557 (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
4558 "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
4559 "--source" "plexus-compiler-manager/src/main/java"
4560 "--output" "build/classes/META-INF/plexus/components.xml"
4561 "--classes" "build/classes"
4562 "--descriptors" "build/classes/META-INF")
4563 (invoke "ant" "jar")
4564 #t))
4565 (add-after 'generate-metadata 'rebuild
4566 (lambda _
4567 (invoke "ant" "jar")
4568 #t))
4569 (replace 'install
4570 (install-from-pom "plexus-compiler-manager/pom.xml")))))
4571 (propagated-inputs
4572 (list java-plexus-compiler-api java-plexus-compiler-pom
4573 java-plexus-container-default-1.7))
4574 (native-inputs
4575 (list unzip java-plexus-component-metadata-1.7))
4576 (synopsis "Compiler management for Plexus Compiler component")
4577 (description "Plexus Compiler is a Plexus component to use different
4578compilers through a uniform API. This component chooses the compiler
4579implementation to use in a project.")))
4580
4581(define-public java-plexus-compiler-javac
4582 (package
4583 (inherit java-plexus-compiler-api)
4584 (name "java-plexus-compiler-javac")
4585 (arguments
4586 `(#:jar-name "plexus-compiler-javac.jar"
4587 #:source-dir "plexus-compilers/plexus-compiler-javac/src/main/java"
4588 #:jdk ,icedtea-8
4589 #:tests? #f; depends on compiler-test -> maven-core -> ... -> this package.
4590 #:test-dir "plexus-compilers/plexus-compiler-javac/src/test"
4591 #:modules ((guix build ant-build-system)
4592 (guix build utils)
4593 (guix build java-utils)
4594 (sxml simple))
4595 #:phases
4596 (modify-phases %standard-phases
4597 ;; We cannot use java-plexus-component-metadata to generate the metadata
4598 ;; because it ultimately depends on this package.
4599 ;; Create it manually instead
4600 (add-before 'build 'create-metadata
4601 (lambda _
4602 (let* ((dir "build/classes/META-INF/plexus")
4603 (file (string-append dir "/components.xml")))
4604 (mkdir-p dir)
4605 (with-output-to-file file
4606 (lambda _
4607 (sxml->xml
4608 `(component-set
4609 (components
4610 (component
4611 (role "org.codehaus.plexus.compiler.Compiler")
4612 (role-hint "javac")
4613 (implementation "org.codehaus.plexus.compiler.javac.JavacCompiler")
4614 (isolated-realm "false"))))))))
4615 #t))
4616 (replace 'install
4617 (install-from-pom "plexus-compilers/plexus-compiler-javac/pom.xml")))))
4618 (propagated-inputs
4619 (list java-plexus-compiler-api java-plexus-utils
4620 java-plexus-container-default))
4621 (synopsis "Javac Compiler support for Plexus Compiler component")
4622 (description "This package contains the Javac Compiler support for Plexus
4623Compiler component.")))
4624
4625(define plexus-components-pom-1.1.20
4626 (package
4627 (name "plexus-components-pom-1.1.20")
4628 (version "1.1.20")
4629 (source (origin
4630 (method git-fetch)
4631 (uri (git-reference
4632 (url "https://github.com/codehaus-plexus/plexus-components")
4633 (commit (string-append "plexus-components-" version))))
4634 (file-name (git-file-name name version))
4635 (sha256
4636 (base32
4637 "1q254k95m9icyfsvaw8c226midg8v6v436wvivhv7im825mnp5yb"))))
4638 (build-system ant-build-system)
4639 (arguments
4640 `(#:tests? #f
4641 #:phases
4642 (modify-phases %standard-phases
4643 (delete 'configure)
4644 (delete 'build)
4645 (replace 'install
4646 (install-pom-file "pom.xml")))))
4647 (propagated-inputs
4648 `(("plexus-parent-pom" ,plexus-parent-pom-3.1)))
4649 (home-page "https://github.com/codehaus-plexus/plexus-components")
4650 (synopsis "Maven parent pom for plexus packages")
4651 (description "This package contains the parent pom for plexus component
4652packages.")
4653 (license license:asl2.0)))
4654
4655(define-public java-plexus-digest
4656 (package
4657 (name "java-plexus-digest")
4658 (version "1.2")
4659 (source (origin
4660 (method git-fetch)
4661 (uri (git-reference
4662 (url "https://github.com/codehaus-plexus/plexus-digest")
4663 (commit "2a52ad1bda8297fa0e287163d2fa37245ec6a430")))
4664 (file-name (git-file-name name version))
4665 (sha256
4666 (base32
4667 "19w5wxsliz8r42niry68qa665kvjsb8081dazg9vgd3pca72w07x"))))
4668 (build-system ant-build-system)
4669 (arguments
4670 `(#:jar-name "plexus-digest.jar"
4671 #:source-dir "src/main/java"
4672 #:tests? #f
4673 #:phases
4674 (modify-phases %standard-phases
4675 (replace 'install
4676 (install-from-pom "pom.xml")))))
4677 (propagated-inputs
4678 (list java-plexus-utils plexus-components-pom-1.1.20))
4679 (native-inputs
4680 (list java-junit))
4681 (home-page "https://github.com/codehaus-plexus/plexus-digest")
4682 (synopsis "Hash function utilities for Java")
4683 (description "This package is a plexus component that contains hash
4684function utilities.")
4685 (license license:asl2.0)))
4686
4687(define-public java-plexus-sec-dispatcher
4688 (package
4689 (name "java-plexus-sec-dispatcher")
4690 (version "2.0")
4691 (source (origin
4692 (method git-fetch)
4693 (uri (git-reference
4694 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4695 (commit (string-append "plexus-sec-dispatcher-" version))))
4696 (sha256
4697 (base32
4698 "0665zcyxkv2knydxgv2dn64zvy1dx9j9af12ds9s64qmzd1rk6pk"))
4699 (file-name (git-file-name name version))))
4700 (arguments
4701 `(#:jar-name "plexus-sec-dispatcher.jar"
4702 #:source-dir "src/main/java"
4703 #:phases
4704 (modify-phases %standard-phases
4705 (add-before 'build 'generate-models
4706 (lambda* (#:key inputs #:allow-other-keys)
4707 (define (modello-single-mode file version mode)
4708 (invoke "java"
4709 "org.codehaus.modello.ModelloCli"
4710 file mode "src/main/java" version
4711 "false" "true"))
4712 (let ((file "src/main/mdo/settings-security.mdo"))
4713 (modello-single-mode file "1.0.0" "java")
4714 (modello-single-mode file "1.0.0" "xpp3-reader")
4715 (modello-single-mode file "1.0.0" "xpp3-writer"))
4716 #t))
4717 (add-before 'build 'generate-javax.inject.Named
4718 (lambda _
4719 (mkdir-p "build/classes/META-INF/sisu")
4720 (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named"
4721 (lambda _
4722 (display
4723 "org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher\n")))
4724 #t))
4725 (add-before 'check 'fix-paths
4726 (lambda _
4727 (copy-recursively "src/test/resources" "target")
4728 #t))
4729 (replace 'install (install-from-pom "pom.xml")))))
4730 (propagated-inputs
4731 (list java-plexus-utils java-plexus-cipher plexus-parent-pom-8))
4732 (native-inputs
4733 (list java-javax-inject
4734 java-modello-core
4735 ;; for modello
4736 java-plexus-container-default
4737 java-plexus-classworlds
4738 java-plexus-utils
4739 java-guava
4740 java-geronimo-xbean-reflect
4741 ;; modello plugins
4742 java-modello-plugins-java
4743 java-modello-plugins-xml
4744 java-modello-plugins-xpp3
4745 ;; for tests
4746 java-junit))
4747 (build-system ant-build-system)
4748 (home-page "https://github.com/sonatype/plexus-sec-dispatcher")
4749 (synopsis "Plexus Security Dispatcher Component")
4750 (description "This package is the Plexus Security Dispatcher Component.
4751This component decrypts a string passed to it.")
4752 (license license:asl2.0)))
4753
4754(define-public java-plexus-sec-dispatcher-1.4
4755 (package
4756 (inherit java-plexus-sec-dispatcher)
4757 (version "1.4")
4758 (source (origin
4759 (method git-fetch)
4760 (uri (git-reference
4761 (url "https://github.com/codehaus-plexus/plexus-sec-dispatcher")
4762 (commit (string-append "sec-dispatcher-" version))))
4763 (sha256
4764 (base32
4765 "1ng4yliy4cqpjr4fxxjbpwyk1wkch5f8vblm1kvwf328s4gibszs"))
4766 (file-name (git-file-name "java-plexus-sec-dispatcher" version))))
4767 (arguments
4768 (substitute-keyword-arguments (package-arguments java-plexus-sec-dispatcher)
4769 ((#:phases phases)
4770 `(modify-phases ,phases
4771 (delete 'generate-javax.inject.Named)
4772 (add-before 'build 'generate-components.xml
4773 (lambda _
4774 (mkdir-p "build/classes/META-INF/plexus")
4775 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4776 (lambda _
4777 (display
4778 "<component-set>\n
4779 <components>\n
4780 <component>\n
4781 <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role>\n
4782 <role-hint>default</role-hint>\n
4783 <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation>\n
4784 <description></description>\n
4785 <requirements>\n
4786 <requirement>\n
4787 <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>\n
4788 <field-name>_cipher</field-name>\n
4789 </requirement>\n
4790 <requirement>\n
4791 <role>org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor</role>\n
4792 <field-name>_decryptors</field-name>\n
4793 </requirement>\n
4794 </requirements>\n
4795 <configuration>\n
4796 <_configuration-file>~/.settings-security.xml</_configuration-file>\n
4797 </configuration>\n
4798 </component>\n
4799 </components>\n
4800</component-set>\n")))))))))
4801 (propagated-inputs
4802 (list java-plexus-utils java-plexus-cipher-1.7
4803 java-sonatype-spice-parent-pom-12))))
4804
4805(define-public java-plexus-cli
4806 (package
4807 (name "java-plexus-cli")
4808 (version "1.7")
4809 (source (origin
4810 (method git-fetch)
4811 (uri (git-reference
4812 (url "https://github.com/sonatype/plexus-cli")
4813 (commit "a776afa6bca84e5107bedb69440329cdb24ed645")))
4814 (file-name (string-append name "-" version))
4815 (sha256
4816 (base32
4817 "0xjrlay605rypv3zd7y24vlwf0039bil3n2cqw54r1ddpysq46vx"))))
4818 (build-system ant-build-system)
4819 (arguments
4820 `(#:jar-name "plexus-cli.jar"
4821 #:source-dir "src/main/java"
4822 #:jdk ,icedtea-8
4823 #:test-dir "src/test"))
4824 (inputs
4825 (list java-commons-cli java-plexus-container-default
4826 java-plexus-classworlds))
4827 (native-inputs
4828 (list java-plexus-utils java-junit java-guava))
4829 (home-page "https://codehaus-plexus.github.io/plexus-cli")
4830 (synopsis "CLI building library for plexus")
4831 (description "This package is a library to help creating CLI around
4832Plexus components.")
4833 (license license:asl2.0)))
4834
4835(define-public java-plexus-build-api
4836 (package
4837 (name "java-plexus-build-api")
4838 (version "0.0.7")
4839 (source (origin
4840 (method git-fetch)
4841 (uri (git-reference
4842 (url "https://github.com/codehaus-plexus/plexus-build-api")
4843 (commit (string-append "plexus-build-api-" version))))
4844 (file-name (git-file-name name version))
4845 (sha256
4846 (base32
4847 "1d5w6c58gkx30d51v7qwv1xrhc0ly76848gihmgshj19yf6yhca0"))))
4848 (build-system ant-build-system)
4849 (arguments
4850 `(#:jar-name "plexus-build-api.jar"
4851 #:source-dir "src/main/java"
4852 #:jdk ,icedtea-8
4853 #:tests? #f; FIXME: how to run the tests?
4854 #:phases
4855 (modify-phases %standard-phases
4856 (add-before 'build 'copy-resources
4857 (lambda _
4858 (copy-recursively "src/main/resources" "build/classes")
4859 (substitute* (find-files "build/classes")
4860 (("\\$\\{project.version\\}") ,version))
4861 #t))
4862 (add-before 'build 'generate-plexus-compontent
4863 (lambda _
4864 (mkdir-p "build/classes/META-INF/plexus")
4865 ;; This file is required for plexus to inject this package.
4866 ;; FIXME: how is it generated?
4867 (with-output-to-file "build/classes/META-INF/plexus/components.xml"
4868 (lambda _
4869 (display
4870 "<component-set>\n
4871 <components>\n
4872 <component>\n
4873 <role>org.sonatype.plexus.build.incremental.BuildContext</role>\n
4874 <role-hint>default</role-hint>\n
4875 <implementation>org.sonatype.plexus.build.incremental.DefaultBuildContext</implementation>\n
4876 <description>Filesystem based non-incremental build context implementation\n
4877which behaves as if all files were just created.</description>\n
4878 </component>\n
4879 </components>\n
4880</component-set>\n")))
4881 #t))
4882 (replace 'install
4883 (install-from-pom "pom.xml")))))
4884 (inputs
4885 (list java-plexus-utils-3.2.1 java-plexus-container-default))
4886 (home-page "https://github.com/codehaus-plexus/plexus-build-api/")
4887 (synopsis "Base build API for maven")
4888 (description "This package contains the base build API for maven and
4889a default implementation of it. This API is about scanning files in a
4890project and determining what files need to be rebuilt.")
4891 (license license:asl2.0)))
4892
4893(define-public java-modello-core
4894 (package
4895 (name "java-modello-core")
4896 (version "1.11")
4897 (source (origin
4898 (method git-fetch)
4899 (uri (git-reference
4900 (url "https://github.com/codehaus-plexus/modello")
4901 (commit (string-append "modello-" version))))
4902 (file-name (git-file-name name version))
4903 (sha256
4904 (base32
4905 "18885sim7z9j3wy19i9083y9kc8l9xxl2px823a96q4rnqj5z8s2"))))
4906 (build-system ant-build-system)
4907 (arguments
4908 `(#:jar-name "modello-core.jar"
4909 #:source-dir "modello-core/src/main/java"
4910 #:test-dir "modello-core/src/test"
4911 #:main-class "org.codehaus.modello.ModelloCli"
4912 #:jdk ,icedtea-8
4913 #:phases
4914 (modify-phases %standard-phases
4915 (add-before 'build 'copy-resources
4916 (lambda _
4917 (mkdir-p "build/classes/META-INF/plexus")
4918 (copy-file "modello-core/src/main/resources/META-INF/plexus/components.xml"
4919 "build/classes/META-INF/plexus/components.xml")
4920 #t))
4921 (add-before 'check 'fix-tests
4922 (lambda _
4923 (with-directory-excursion "modello-core/src/test/java/org/codehaus"
4924 (substitute* '("modello/core/DefaultModelloCoreTest.java"
4925 "modello/core/io/ModelReaderTest.java")
4926 (("src/test") "modello-core/src/test")))
4927 #t)))))
4928 (propagated-inputs
4929 (list java-plexus-utils java-plexus-container-default
4930 java-plexus-build-api))
4931 (native-inputs
4932 (list java-junit java-plexus-classworlds java-geronimo-xbean-reflect
4933 java-guava))
4934 (home-page "https://codehaus-plexus.github.io/modello/")
4935 (synopsis "Framework for code generation from a simple model")
4936 (description "Modello is a framework for code generation from a simple model.
4937
4938Modello generates code from a simple model format: based on a plugin
4939architecture, various types of code and descriptors can be generated from the
4940single model, including Java POJOs, XML/JSON/YAML marshallers/unmarshallers,
4941XSD and documentation.")
4942 (license (list
4943 license:expat
4944 ;; Although this package uses only files licensed under expat,
4945 ;; other parts of the source are licensed under different
4946 ;; licenses. We include them to be inherited by other packages.
4947 license:asl2.0
4948 ;; Some files in modello-plugin-java are licensed under a
4949 ;; 5-clause BSD license.
4950 (license:non-copyleft
4951 (string-append "file:///modello-plugins/modello-plugin-java/"
4952 "src/main/java/org/codehaus/modello/plugin/"
4953 "java/javasource/JNaming.java"))))))
4954
4955(define-public java-modello-plugins-java
4956 (package
4957 (inherit java-modello-core)
4958 (name "java-modello-plugins-java")
4959 (arguments
4960 `(#:jar-name "modello-plugins-java.jar"
4961 #:source-dir "modello-plugins/modello-plugin-java/src/main/java"
4962 #:test-dir "modello-plugins/modello-plugin-java/src/test"
4963 #:jdk ,icedtea-8
4964 #:tests? #f; requires maven-model, which depends on this package
4965 #:phases
4966 (modify-phases %standard-phases
4967 (add-before 'build 'copy-resources
4968 (lambda _
4969 (mkdir-p "build/classes")
4970 (copy-recursively "modello-plugins/modello-plugin-java/src/main/resources"
4971 "build/classes")
4972 #t)))))
4973 (inputs
4974 (list java-modello-core))
4975 (synopsis "Modello Java Plugin")
4976 (description "Modello Java Plugin generates Java objects for the model.")))
4977
4978(define-public java-modello-plugins-xml
4979 (package
4980 (inherit java-modello-core)
4981 (name "java-modello-plugins-xml")
4982 (arguments
4983 `(#:jar-name "modello-plugins-xml.jar"
4984 #:source-dir "modello-plugins/modello-plugin-xml/src/main/java"
4985 #:test-dir "modello-plugins/modello-plugin-xml/src/test"
4986 #:jdk ,icedtea-8
4987 #:phases
4988 (modify-phases %standard-phases
4989 (add-before 'build 'copy-resources
4990 (lambda _
4991 (mkdir-p "build/classes")
4992 (copy-recursively
4993 "modello-plugins/modello-plugin-xml/src/main/resources"
4994 "build/classes")
4995 #t))
4996 (add-before 'check 'fix-paths
4997 (lambda _
4998 (with-directory-excursion "modello-plugins/modello-plugin-xml/src/test"
4999 (substitute*
5000 "java/org/codehaus/modello/plugins/xml/XmlModelloPluginTest.java"
5001 (("src/test") "modello-plugins/modello-plugin-xml/src/test")))
5002 #t)))))
5003 (propagated-inputs
5004 (list java-modello-core java-modello-plugins-java))
5005 (synopsis "Modello XML Plugin")
5006 (description "Modello XML Plugin contains shared code for every plugins
5007working on XML representation of the model.")))
5008
5009(define-public java-modello-test
5010 (package
5011 (inherit java-modello-core)
5012 (name "java-modello-test")
5013 (arguments
5014 `(#:jar-name "modello-test.jar"
5015 #:source-dir "modello-test/src/main/java"
5016 #:tests? #f; no tests
5017 #:jdk ,icedtea-8))
5018 (inputs
5019 (list java-plexus-utils java-plexus-compiler-api
5020 java-plexus-compiler-javac java-plexus-container-default))
5021 (synopsis "Modello test package")
5022 (description "The modello test package contains the basis to create
5023Modello generator unit-tests, including sample models and xml files to test
5024every feature for every plugin.")))
5025
5026(define-public java-modello-plugins-xpp3
5027 (package
5028 (inherit java-modello-core)
5029 (name "java-modello-plugins-xpp3")
5030 (arguments
5031 `(#:jar-name "modello-plugins-xpp3.jar"
5032 #:source-dir "modello-plugins/modello-plugin-xpp3/src/main/java"
5033 #:test-dir "modello-plugins/modello-plugin-xpp3/src/test"
5034 ;; One of the test dependencies is maven-model which depends on this package.
5035 #:tests? #f
5036 #:jdk ,icedtea-8
5037 #:phases
5038 (modify-phases %standard-phases
5039 (add-before 'build 'copy-resources
5040 (lambda _
5041 (mkdir-p "build/classes")
5042 (copy-recursively "modello-plugins/modello-plugin-xpp3/src/main/resources"
5043 "build/classes")
5044 #t)))))
5045 (propagated-inputs
5046 (list java-modello-core java-modello-plugins-java
5047 java-modello-plugins-xml))
5048 (native-inputs
5049 (modify-inputs (package-native-inputs java-modello-core)
5050 (prepend java-xmlunit java-modello-test)))
5051 (synopsis "Modello XPP3 Plugin")
5052 (description "The modello XPP3 plugin generates XML readers and writers based
5053on the XPP3 API (XML Pull Parser).")))
5054
5055(define-public java-ow-util-ant-tasks
5056 (package
5057 (name "java-ow-util-ant-tasks")
5058 (version "1.3.2")
5059 (source (origin
5060 (method url-fetch)
5061 (uri (string-append
5062 "mirror://debian/pool/main/o/ow-util-ant-tasks/"
5063 "ow-util-ant-tasks_" version ".orig.tar.gz"))
5064 (sha256
5065 (base32
5066 "1y5ln1g36aligwcadqksdj18i5ghqnxn523wjbzy2zyd7w58fgy5"))))
5067 (build-system ant-build-system)
5068 (arguments
5069 `(#:jar-name "ow-util-ant-tasks.jar"
5070 #:tests? #f; no tests
5071 #:phases
5072 (modify-phases %standard-phases
5073 (add-before 'build 'delete-cyclic-dependency
5074 (lambda _
5075 ;; This file depends on asm-3, which depends on this package
5076 (delete-file "src/org/objectweb/util/ant/DependencyAnalyzer.java")
5077 ;; This file depends on xalan
5078 (delete-file "src/org/objectweb/util/ant/Xalan2Liaison.java")))
5079 (add-before 'build 'fix-new-ant
5080 (lambda _
5081 (substitute* "src/org/objectweb/util/ant/MultipleCopy.java"
5082 ((", destFile.getAbsolutePath\\(\\)")
5083 ", new String[] { destFile.getAbsolutePath() }")))))))
5084 (home-page "https://packages.debian.org/source/stretch/ow-util-ant-tasks")
5085 (synopsis "Replacement for base ant tasks")
5086 (description "This library is used in the legacy build process of several
5087key frameworks developed by ObjectWeb, among them legacy versions of the
5088ObjectWeb ASM bytecode manipulation framework.")
5089 (license license:lgpl2.0+)))
5090
5091(define-public java-asm
5092 (package
5093 (name "java-asm")
5094 (version "6.0")
5095 (source (origin
5096 (method url-fetch)
5097 (uri (string-append "https://download.forge.ow2.org/asm/"
5098 "asm-" version ".tar.gz"))
5099 (sha256
5100 (base32
5101 "115l5pqblirdkmzi32dxx7gbcm4jy0s14y5wircr6h8jdr9aix00"))))
5102 (build-system ant-build-system)
5103 (arguments
5104 `(#:build-target "compile"
5105 ;; The tests require an old version of Janino, which no longer compiles
5106 ;; with the JDK7.
5107 #:tests? #f
5108 #:make-flags
5109 (list
5110 ;; We don't need these extra ant tasks, but the build system asks us to
5111 ;; provide a path anyway.
5112 "-Dobjectweb.ant.tasks.path=dummy-path"
5113 ;; The java-aqute.bndlib JAR file will be put onto the classpath and
5114 ;; used during the build automatically by ant-build-system, but
5115 ;; java-asm's build.xml fails unless we provide something here.
5116 "-Dbiz.aQute.bnd.path=dummy-path")
5117 #:phases
5118 (modify-phases %standard-phases
5119 (add-before 'build 'remove-bnd-dependency
5120 (lambda _
5121 ;; This file is the only one to require bnd, and is not needed
5122 ;; because we don't build a bundle.
5123 (delete-file "src/org/objectweb/asm/tools/ModuleInfoBndPlugin.java")
5124 #t))
5125 (add-before 'install 'build-jars
5126 (lambda* (#:key make-flags #:allow-other-keys)
5127 ;; We cannot use the "jar" target because it depends on a couple
5128 ;; of unpackaged, complicated tools.
5129 (mkdir "dist")
5130 (invoke "jar"
5131 "-cf" (string-append "dist/asm-" ,version ".jar")
5132 "-C" "output/build/tmp" ".")))
5133 (add-before 'install 'fix-pom
5134 (lambda _
5135 (substitute* (find-files "archive" "\\.pom$")
5136 (("@product.artifact@") ,version))
5137 #t))
5138 (add-before 'install 'install-parent
5139 (install-pom-file "archive/asm-parent.pom"))
5140 (replace 'install
5141 (install-from-pom "archive/asm.pom")))))
5142 (native-inputs
5143 (list java-junit))
5144 (propagated-inputs
5145 (list java-org-ow2-parent-pom-1.3))
5146 (home-page "https://asm.ow2.io/")
5147 (synopsis "Very small and fast Java bytecode manipulation framework")
5148 (description "ASM is an all purpose Java bytecode manipulation and
5149analysis framework. It can be used to modify existing classes or dynamically
5150generate classes, directly in binary form. The provided common
5151transformations and analysis algorithms allow easily assembling custom
5152complex transformations and code analysis tools.")
5153 (license license:bsd-3)))
5154
5155(define-public java-org-ow2-parent-pom-1.3
5156 (package
5157 (name "java-org-ow2-parent-pom")
5158 (version "1.3")
5159 (source (origin
5160 (method url-fetch)
5161 (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom")
5162 (sha256
5163 (base32
5164 "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai"))))
5165 (build-system ant-build-system)
5166 (arguments
5167 `(#:tests? #f
5168 #:phases
5169 (modify-phases %standard-phases
5170 (delete 'unpack)
5171 (delete 'build)
5172 (delete 'configure)
5173 (replace 'install
5174 ,#~(install-pom-file #$source)))))
5175 (home-page "https://ow2.org")
5176 (synopsis "Ow2.org parent pom")
5177 (description "This package contains the parent pom for projects from ow2.org,
5178including java-asm.")
5179 (properties '((hidden? . #t)))
5180 (license license:lgpl2.1+)))
5181
5182(define-public java-asm-bootstrap
5183 (package
5184 (inherit java-asm)
5185 (name "java-asm-bootstrap")
5186 (properties '((hidden? . #t)))
5187 (arguments
5188 (substitute-keyword-arguments (package-arguments java-asm)
5189 ((#:tests? _) #f)))
5190 (native-inputs `())))
5191
5192(define-public java-asm-3
5193 (package
5194 (inherit java-asm)
5195 (version "3.1")
5196 (source (origin
5197 (method git-fetch)
5198 (uri (git-reference
5199 (url "https://gitlab.ow2.org/asm/asm")
5200 (commit "ASM_3_1")))
5201 (file-name (git-file-name "java-asm" version))
5202 (sha256
5203 (base32
5204 "0xbyf2sl8j6mrvfpg2da0vjdp906rac62l66gkk82x5cn3vc30h4"))
5205 (modules '((guix build utils)))
5206 (snippet `(for-each delete-file (find-files "." "\\.jar$")))))
5207 (arguments
5208 `(#:build-target "jar"
5209 #:test-target "test"
5210 #:tests? #f; require legacy test software
5211 #:phases
5212 (modify-phases %standard-phases
5213 (replace 'install (install-jars "output/dist"))
5214 (delete 'generate-jar-indices))))
5215 (native-inputs (list java-ow-util-ant-tasks))))
5216
5217(define-public java-asm-8
5218 (package
5219 (inherit java-asm)
5220 (version "8.0.1")
5221 (source (origin
5222 (method git-fetch)
5223 (uri (git-reference
5224 (url "https://gitlab.ow2.org/asm/asm")
5225 (commit (string-append
5226 "ASM_" (string-join (string-split version #\.)
5227 "_")))))
5228 (file-name (git-file-name "java-asm" version))
5229 (sha256
5230 (base32
5231 "1s6j27zc1i76gh891w2g48b1c3abp9w8zp5j54yb1vm5h8djkd69"))))
5232 (arguments
5233 `(#:jar-name "asm8.jar"
5234 #:source-dir "asm/src/main/java"
5235 #:test-dir "asm/src/test"
5236 ;; tests depend on junit5
5237 #:tests? #f))
5238 (propagated-inputs '())
5239 (native-inputs '())))
5240
5241(define-public java-asm-tree-8
5242 (package
5243 (inherit java-asm-8)
5244 (name "java-asm-tree")
5245 (arguments
5246 `(#:jar-name "asm-tree.jar"
5247 #:source-dir "asm-tree/src/main/java"
5248 #:test-dir "asm-tree/src/test"
5249 ;; tests depend on junit5
5250 #:tests? #f))
5251 (inputs
5252 (list java-asm-8))))
5253
5254(define-public java-asm-analysis-8
5255 (package
5256 (inherit java-asm-8)
5257 (name "java-asm-analysis")
5258 (arguments
5259 `(#:jar-name "asm-analysis.jar"
5260 #:source-dir "asm-analysis/src/main/java"
5261 #:test-dir "asm-analysis/src/test"
5262 ;; tests depend on junit5
5263 #:tests? #f))
5264 (inputs
5265 (list java-asm-8 java-asm-tree-8))))
5266
5267(define-public java-asm-util-8
5268 (package
5269 (inherit java-asm-8)
5270 (name "java-asm-util")
5271 (arguments
5272 `(#:jar-name "asm-util8.jar"
5273 #:source-dir "asm-util/src/main/java"
5274 #:test-dir "asm-util/src/test"
5275 ;; tests depend on junit5
5276 #:tests? #f))
5277 (inputs
5278 (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5279
5280(define-public java-asm-commons-8
5281 (package
5282 (inherit java-asm-8)
5283 (name "java-asm-commons")
5284 (arguments
5285 (list #:jar-name "asm-commons8.jar"
5286 #:source-dir "asm-commons/src/main/java"
5287 #:test-dir "asm-commons/src/test"
5288 ;; tests depend on junit5
5289 #:tests? #f))
5290 (inputs (list java-asm-8 java-asm-analysis-8 java-asm-tree-8))))
5291
5292(define-public java-asm-9
5293 (package
5294 (inherit java-asm)
5295 (version "9.4")
5296 (source (origin
5297 (method git-fetch)
5298 (uri (git-reference
5299 (url "https://gitlab.ow2.org/asm/asm")
5300 (commit (string-append
5301 "ASM_" (string-join (string-split version #\.)
5302 "_")))))
5303 (file-name (git-file-name "java-asm" version))
5304 (sha256
5305 (base32
5306 "0c00m638skr5md1p6y1c2xn11kj5w6sjapyvwp9mh70rw095bwzk"))))
5307 (arguments
5308 `(#:jar-name "asm9.jar"
5309 #:source-dir "asm/src/main/java"
5310 #:test-dir "asm/src/test"
5311 ;; tests depend on junit5
5312 #:tests? #f))
5313 (propagated-inputs '())
5314 (native-inputs '())))
5315
5316(define-public java-asm-tree-9
5317 (package
5318 (inherit java-asm-9)
5319 (name "java-asm-tree")
5320 (arguments
5321 `(#:jar-name "asm-tree.jar"
5322 #:source-dir "asm-tree/src/main/java"
5323 #:test-dir "asm-tree/src/test"
5324 ;; tests depend on junit5
5325 #:tests? #f))
5326 (inputs
5327 (list java-asm-9))))
5328
5329(define-public java-asm-analysis-9
5330 (package
5331 (inherit java-asm-9)
5332 (name "java-asm-analysis")
5333 (arguments
5334 `(#:jar-name "asm-analysis.jar"
5335 #:source-dir "asm-analysis/src/main/java"
5336 #:test-dir "asm-analysis/src/test"
5337 ;; tests depend on junit5
5338 #:tests? #f))
5339 (inputs
5340 (list java-asm-9 java-asm-tree-9))))
5341
5342(define-public java-asm-util-9
5343 (package
5344 (inherit java-asm-9)
5345 (name "java-asm-util")
5346 (arguments
5347 `(#:jar-name "asm-util8.jar"
5348 #:source-dir "asm-util/src/main/java"
5349 #:test-dir "asm-util/src/test"
5350 ;; tests depend on junit5
5351 #:tests? #f))
5352 (inputs
5353 (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5354
5355(define-public java-asm-commons-9
5356 (package
5357 (inherit java-asm-9)
5358 (name "java-asm-commons")
5359 (arguments
5360 (list #:jar-name "asm-commons8.jar"
5361 #:source-dir "asm-commons/src/main/java"
5362 #:test-dir "asm-commons/src/test"
5363 ;; tests depend on junit5
5364 #:tests? #f))
5365 (inputs (list java-asm-9 java-asm-analysis-9 java-asm-tree-9))))
5366
5367(define-public java-cglib
5368 (package
5369 (name "java-cglib")
5370 (version "3.3.0")
5371 (source
5372 (origin
5373 (method git-fetch)
5374 (uri (git-reference
5375 (url "https://github.com/cglib/cglib")
5376 (commit (string-append
5377 "RELEASE_"
5378 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
5379 version)))))
5380 (file-name (git-file-name name version))
5381 (sha256
5382 (base32 "1lnscamc6bnhh7jgij5garxagp3zn2jp4cbq0rsn4xr3l0cnd014"))))
5383 (build-system ant-build-system)
5384 (arguments
5385 `(;; FIXME: tests fail because junit runs
5386 ;; "net.sf.cglib.transform.AbstractTransformTest", which does not seem
5387 ;; to describe a test at all.
5388 #:tests? #f
5389 #:jar-name "cglib.jar"
5390 #:phases
5391 (modify-phases %standard-phases
5392 (add-after 'unpack 'chdir
5393 (lambda _ (chdir "cglib") #t)))))
5394 (native-inputs (list java-junit))
5395 (propagated-inputs (list java-asm-8))
5396 (home-page "https://github.com/cglib/cglib/")
5397 (synopsis "Java byte code generation library")
5398 (description "The byte code generation library CGLIB is a high level API
5399to generate and transform Java byte code.")
5400 (license license:asl2.0)))
5401
5402(define-public java-objenesis
5403 (package
5404 (name "java-objenesis")
5405 (version "3.3")
5406 (source (origin
5407 (method git-fetch)
5408 (uri (git-reference
5409 (url "https://github.com/easymock/objenesis")
5410 (commit version)))
5411 (file-name (git-file-name name version))
5412 (sha256
5413 (base32
5414 "1brlcn536p4s1v1f3vzxhr38lvyhc33wjrbj2x06kdrd8agy90cr"))))
5415 (build-system ant-build-system)
5416 (arguments
5417 `(#:tests? #f; require junit-5
5418 #:jar-name "objenesis.jar"
5419 #:source-dir "main/src/main/java"
5420 #:test-dir "main/src/test/"))
5421 (native-inputs
5422 (list java-junit java-hamcrest-core))
5423 (home-page "http://objenesis.org/")
5424 (synopsis "Bypass the constructor when creating an object")
5425 (description "Objenesis is a small Java library that serves one purpose:
5426to instantiate a new object of a particular class. It is common to see
5427restrictions in libraries stating that classes must require a default
5428constructor. Objenesis aims to overcome these restrictions by bypassing the
5429constructor on object instantiation.")
5430 (license license:asl2.0)))
5431
5432(define-public java-easymock
5433 (package
5434 (name "java-easymock")
5435 (version "3.4")
5436 (source (origin
5437 (method git-fetch)
5438 (uri (git-reference
5439 (url "https://github.com/easymock/easymock/")
5440 (commit (string-append "easymock-" version))))
5441 (file-name (git-file-name name version))
5442 (sha256
5443 (base32
5444 "02vybm8hc0i0n9sp2f2iiqn54zwqhq835f76wc6b2m7819z5a8dq"))))
5445 (build-system ant-build-system)
5446 (arguments
5447 `(#:jar-name "easymock.jar"
5448 #:source-dir "core/src/main"
5449 #:test-dir "core/src/test"
5450 #:phases
5451 (modify-phases %standard-phases
5452 ;; FIXME: Android support requires the following packages to be
5453 ;; available: com.google.dexmaker.stock.ProxyBuilder
5454 (add-after 'unpack 'delete-android-support
5455 (lambda _
5456 (with-directory-excursion "core/src/main/java/org/easymock/internal"
5457 (substitute* "MocksControl.java"
5458 (("AndroidSupport.isAndroid\\(\\)") "false")
5459 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5460 (delete-file "AndroidClassProxyFactory.java"))
5461 #t))
5462 (add-after 'unpack 'delete-broken-tests
5463 (lambda _
5464 (with-directory-excursion "core/src/test/java/org/easymock"
5465 ;; This test depends on dexmaker.
5466 (delete-file "tests2/ClassExtensionHelperTest.java")
5467
5468 ;; This is not a test.
5469 (delete-file "tests/BaseEasyMockRunnerTest.java")
5470
5471 ;; This test should be executed with a different runner...
5472 (delete-file "tests2/EasyMockAnnotationsTest.java")
5473 ;; ...but deleting it means that we also have to delete these
5474 ;; dependent files.
5475 (delete-file "tests2/EasyMockRunnerTest.java")
5476 (delete-file "tests2/EasyMockRuleTest.java")
5477
5478 ;; This test fails because the file "easymock.properties" does
5479 ;; not exist.
5480 (delete-file "tests2/EasyMockPropertiesTest.java"))
5481 #t)))))
5482 (inputs
5483 (list java-cglib java-objenesis))
5484 (native-inputs
5485 (list java-junit java-hamcrest-core))
5486 (home-page "https://easymock.org/")
5487 (synopsis "Java library providing mock objects for unit tests")
5488 (description "EasyMock is a Java library that provides an easy way to use
5489mock objects in unit testing.")
5490 (license license:asl2.0)))
5491
5492(define-public java-easymock-3.2
5493 (package
5494 (inherit java-easymock)
5495 (name "java-easymock")
5496 (version "3.2")
5497 (source (origin
5498 (method git-fetch)
5499 (uri (git-reference
5500 (url "https://github.com/easymock/easymock/")
5501 (commit (string-append "easymock-" version))))
5502 (file-name (git-file-name name version))
5503 (sha256
5504 (base32
5505 "0cn6qqa261mhk9mwxrsz39lkkknfv2h7iprr5zw7wpz9p96dwgv4"))))
5506 (arguments
5507 (list #:jar-name "easymock.jar"
5508 #:source-dir "easymock/src/main"
5509 #:test-dir "easymock/src/test"
5510 #:phases
5511 #~(modify-phases %standard-phases
5512 (add-after 'unpack 'delete-android-support
5513 (lambda _
5514 (with-directory-excursion "easymock/src/main/java/org/easymock/internal"
5515 (substitute* "MocksControl.java"
5516 (("AndroidSupport.isAndroid\\(\\)") "false")
5517 (("return classProxyFactory = new AndroidClassProxyFactory\\(\\);") ""))
5518 (delete-file "AndroidClassProxyFactory.java"))))
5519 (add-after 'unpack 'delete-broken-tests
5520 (lambda _
5521 (with-directory-excursion "easymock/src/test/java/org/easymock"
5522 ;; This test depends on dexmaker.
5523 (delete-file "tests2/ClassExtensionHelperTest.java")
5524 ;; This is not a test.
5525 (delete-file "tests/BaseEasyMockRunnerTest.java")
5526 ;; ...but deleting it means that we also have to delete these
5527 ;; dependent files.
5528 (delete-file "tests2/EasyMockRunnerTest.java")
5529 ;; This test fails because the file "easymock.properties" does
5530 ;; not exist.
5531 (delete-file "tests2/EasyMockPropertiesTest.java")))))))))
5532
5533(define-public java-easymock-class-extension
5534 (package
5535 (inherit java-easymock-3.2)
5536 (name "java-easymock-class-extension")
5537 (build-system ant-build-system)
5538 (arguments
5539 (list #:jar-name "easymock-class-extensions.jar"
5540 #:source-dir "easymock-classextension/src/main/java"
5541 #:test-dir "easymock-classextension/src/test"))
5542 (inputs (list java-asm-8
5543 java-easymock-3.2
5544 java-cglib
5545 java-objenesis))
5546 (native-inputs
5547 (list java-junit java-hamcrest-core))
5548 (home-page "https://easymock.org/")
5549 (synopsis "Easymock extension to mock classes")
5550 (description "This package provides an extension to earlier versions of
5551easymock that allows mocking classes.")
5552 (license license:asl2.0)))
5553
5554(define-public java-jmock-1
5555 (package
5556 (name "java-jmock")
5557 (version "1.2.0")
5558 (source (origin
5559 (method git-fetch)
5560 (uri (git-reference
5561 (url "https://github.com/jmock-developers/jmock-library")
5562 (commit version)))
5563 (file-name (git-file-name name version))
5564 (sha256
5565 (base32
5566 "0lkga995xd9b9mmzxmcd301hlw83p1h78nibh7djlx7wydscr85z"))))
5567 (build-system ant-build-system)
5568 (arguments
5569 `(#:build-target "jars"
5570 #:test-target "run.tests"
5571 #:phases
5572 (modify-phases %standard-phases
5573 (replace 'install (install-jars "build")))))
5574 (home-page "http://jmock.org/")
5575 (synopsis "Mock object library for test-driven development")
5576 (description "JMock is a library that supports test-driven development of
5577Java code with mock objects. Mock objects help you design and test the
5578interactions between the objects in your programs.
5579
5580The jMock library
5581
5582@itemize
5583@item makes it quick and easy to define mock objects
5584@item lets you precisely specify the interactions between
5585 your objects, reducing the brittleness of your tests
5586@item plugs into your favourite test framework
5587@item is easy to extend.
5588@end itemize\n")
5589 (license license:bsd-3)))
5590
5591(define-public java-jmock
5592 (package
5593 (inherit java-jmock-1)
5594 (name "java-jmock")
5595 (version "2.8.2")
5596 (source (origin
5597 (method git-fetch)
5598 (uri (git-reference
5599 (url "https://github.com/jmock-developers/jmock-library")
5600 (commit version)))
5601 (file-name (git-file-name name version))
5602 (sha256
5603 (base32
5604 "12b7l22g3nrjvf2dzcw3z03fpd2chrgp0d8xkvn8w55rwb57pax6"))))
5605 (inputs
5606 (list java-hamcrest-all java-bsh java-junit))
5607 (native-inputs
5608 `(("cglib" ,java-cglib)))
5609 (arguments
5610 `(#:jar-name "java-jmock.jar"
5611 #:source-dir "jmock/src/main/java"
5612 #:test-dir "jmock/src/test"))))
5613
5614(define-public java-jmock-junit4
5615 (package
5616 (inherit java-jmock)
5617 (name "java-jmock-junit4")
5618 (arguments
5619 `(#:jar-name "java-jmock-junit4.jar"
5620 #:source-dir "jmock-junit4/src/main/java"
5621 #:test-dir "jmock-junit4/src/test"))
5622 (inputs
5623 `(("java-hamcrest-all" ,java-hamcrest-all)
5624 ("java-bsh" ,java-bsh)
5625 ("java-jmock" ,java-jmock)
5626 ("java-jumit" ,java-junit)))))
5627
5628(define-public java-jmock-legacy
5629 (package
5630 (inherit java-jmock)
5631 (name "java-jmock-legacy")
5632 (arguments
5633 `(#:jar-name "java-jmock-legacy.jar"
5634 #:source-dir "jmock-legacy/src/main/java"
5635 #:test-dir "jmock-legacy/src/test"
5636 #:phases
5637 (modify-phases %standard-phases
5638 (add-before 'check 'copy-tests
5639 (lambda _
5640 ;; This file is a dependancy of some tests
5641 (let ((file "org/jmock/test/acceptance/PackageProtectedType.java"))
5642 (copy-file (string-append "jmock/src/test/java/" file)
5643 (string-append "jmock-legacy/src/test/java/" file))
5644 #t))))))
5645 (inputs
5646 (list java-hamcrest-all
5647 java-objenesis
5648 java-cglib
5649 java-jmock
5650 java-bsh
5651 java-junit))
5652 (native-inputs
5653 (list java-jmock-junit4))))
5654
5655(define-public java-hamcrest-all
5656 (package (inherit java-hamcrest-core)
5657 (name "java-hamcrest-all")
5658 (arguments
5659 `(#:jdk ,icedtea-8
5660 ,@(substitute-keyword-arguments (package-arguments java-hamcrest-core)
5661 ((#:build-target _) "bigjar")
5662 ((#:phases phases)
5663 `(modify-phases ,phases
5664 ;; Some build targets override the classpath, so we need to patch
5665 ;; the build.xml to ensure that required dependencies are on the
5666 ;; classpath.
5667 (add-after 'unpack 'patch-classpath-for-integration
5668 (lambda* (#:key inputs #:allow-other-keys)
5669 (substitute* "build.xml"
5670 ((" build/hamcrest-library-\\$\\{version\\}.jar" line)
5671 (string-join
5672 (cons line
5673 (append
5674 (find-files (assoc-ref inputs "java-junit") "\\.jar$")
5675 (find-files (assoc-ref inputs "java-jmock") "\\.jar$")
5676 (find-files (assoc-ref inputs "java-easymock") "\\.jar$")))
5677 ";"))
5678 (("build/hamcrest-core-\\$\\{version\\}\\.jar")
5679 (car (find-files (assoc-ref inputs "java-hamcrest-core")
5680 "jar$"))))
5681 #t))
5682 (replace 'install
5683 (lambda* (#:key outputs #:allow-other-keys)
5684 (let* ((target (string-append (assoc-ref outputs "out")
5685 "/share/java/"))
5686 (version-suffix
5687 ,(string-append
5688 "-" (package-version java-hamcrest-core) ".jar"))
5689 (install-without-version-suffix
5690 (lambda (jar)
5691 (copy-file jar
5692 (string-append target
5693 (basename jar version-suffix)
5694 ".jar")))))
5695 (mkdir-p target)
5696 (for-each
5697 install-without-version-suffix
5698 (find-files "build"
5699 (lambda (name _)
5700 (and (string-suffix? ".jar" name)
5701 (not (string-suffix? "-sources.jar" name)))))))
5702 #t)))))))
5703 (inputs
5704 (modify-inputs (package-inputs java-hamcrest-core)
5705 (prepend java-junit
5706 java-jmock-1
5707 ;; This is necessary because of what seems to be a race condition.
5708 ;; This package would sometimes fail to build because hamcrest-core.jar
5709 ;; could not be found, even though it is built as part of this package.
5710 ;; Adding java-hamcrest-core appears to fix this problem. See
5711 ;; https://debbugs.gnu.org/31390 for more information.
5712 java-hamcrest-core
5713 java-easymock)))))
5714
5715(define-public java-jopt-simple
5716 (package
5717 (name "java-jopt-simple")
5718 (version "5.0.3")
5719 (source (origin
5720 (method url-fetch)
5721 (uri (string-append "https://repo1.maven.org/maven2/"
5722 "net/sf/jopt-simple/jopt-simple/"
5723 version "/jopt-simple-"
5724 version "-sources.jar"))
5725 (sha256
5726 (base32
5727 "1v8bzmwmw6qq20gm42xyay6vrd567dra4vqwhgjnqqjz1gs9f8qa"))))
5728 (build-system ant-build-system)
5729 (arguments
5730 `(#:tests? #f ; there are no tests
5731 #:jar-name "jopt-simple.jar"
5732 #:phases
5733 (modify-phases %standard-phases
5734 (add-before 'install 'create-pom
5735 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version))
5736 (replace 'install
5737 (install-from-pom "pom.xml")))))
5738 (home-page "https://jopt-simple.github.io/jopt-simple/")
5739 (synopsis "Java library for parsing command line options")
5740 (description "JOpt Simple is a Java library for parsing command line
5741options, such as those you might pass to an invocation of @code{javac}. In
5742the interest of striving for simplicity, as closely as possible JOpt Simple
5743attempts to honor the command line option syntaxes of POSIX @code{getopt} and
5744GNU @code{getopt_long}. It also aims to make option parser configuration and
5745retrieval of options and their arguments simple and expressive, without being
5746overly clever.")
5747 (license license:expat)))
5748
5749;; Required by jmh
5750(define-public java-jopt-simple-4
5751 (package
5752 (inherit java-jopt-simple)
5753 (version "4.6")
5754 (source (origin
5755 (method url-fetch)
5756 (uri (string-append "https://repo1.maven.org/maven2/"
5757 "net/sf/jopt-simple/jopt-simple/"
5758 version "/jopt-simple-"
5759 version "-sources.jar"))
5760 (sha256
5761 (base32
5762 "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd"))))
5763 (arguments
5764 (substitute-keyword-arguments (package-arguments java-jopt-simple)
5765 ((#:phases phases)
5766 `(modify-phases ,phases
5767 (replace 'create-pom
5768 (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple"
5769 ,version))))))))
5770
5771(define-public java-commons-math3
5772 (package
5773 (name "java-commons-math3")
5774 (version "3.6.1")
5775 (source (origin
5776 (method url-fetch)
5777 (uri (string-append "mirror://apache/commons/math/source/"
5778 "commons-math3-" version "-src.tar.gz"))
5779 (sha256
5780 (base32
5781 "19l6yp44qc5g7wg816nbn5z3zq3xxzwimvbm4a8pczgvpi4i85s6"))))
5782 (build-system ant-build-system)
5783 (arguments
5784 `(#:build-target "jar"
5785 #:test-target "test"
5786 #:make-flags
5787 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5788 (junit #$(this-package-native-input "java-junit")))
5789 (list (string-append "-Djunit.jar="
5790 (car (find-files junit "jar$")))
5791 (string-append "-Dhamcrest.jar="
5792 (car (find-files hamcrest ".*.jar$")))))
5793 #:phases
5794 (modify-phases %standard-phases
5795 ;; We want to build the jar in the build phase and run the tests
5796 ;; later in a separate phase.
5797 (add-after 'unpack 'untangle-targets
5798 (lambda _
5799 (substitute* "build.xml"
5800 (("name=\"jar\" depends=\"test\"")
5801 "name=\"jar\" depends=\"compile\""))))
5802 ;; There is no install target.
5803 (replace 'install
5804 (install-from-pom "pom.xml")))))
5805 (native-inputs
5806 (list java-junit java-hamcrest-core))
5807 (home-page "https://commons.apache.org/math/")
5808 (synopsis "Apache Commons mathematics library")
5809 (description "Commons Math is a library of lightweight, self-contained
5810mathematics and statistics components addressing the most common problems not
5811available in the Java programming language or Commons Lang.")
5812 (license license:asl2.0)))
5813
5814(define-public java-jmh
5815 (package
5816 (name "java-jmh")
5817 (version "1.32")
5818 (source (origin
5819 (method git-fetch)
5820 (uri (git-reference
5821 (url "https://github.com/openjdk/jmh")
5822 (commit version)))
5823 (file-name (git-file-name name version))
5824 (sha256
5825 (base32
5826 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0"))))
5827 (build-system maven-build-system)
5828 (arguments
5829 `(#:exclude
5830 (("org.apache.maven.plugins" .
5831 ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin"
5832 "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin"))
5833 ("com.mycila.maven-license-plugin" . ("maven-license-plugin"))
5834 ("org.apache.maven.wagon" . ("wagon-ssh")))
5835 #:maven-plugins
5836 (("maven-enforcer-plugin" ,maven-enforcer-plugin)
5837 ,@(default-maven-plugins))
5838 #:phases
5839 (modify-phases %standard-phases
5840 (add-after 'unpack 'remove-unnecessary
5841 (lambda _
5842 ;; requires org.apache.maven.archetype:archetype-packaging.
5843 ;; Its subprojects also require groovy, kotlin and scala,
5844 ;; respectively.
5845 (delete-file-recursively "jmh-archetypes"))))))
5846 (propagated-inputs
5847 (list java-jopt-simple-4 java-commons-math3))
5848 (native-inputs
5849 (list java-junit java-hamcrest-core))
5850 (home-page "https://openjdk.java.net/projects/code-tools/jmh/")
5851 (synopsis "Benchmark harness for the JVM")
5852 (description "JMH is a Java harness for building, running, and analysing
5853nano/micro/milli/macro benchmarks written in Java and other languages
5854targeting the JVM.")
5855 ;; GPLv2 only
5856 (license license:gpl2)))
5857
5858(define-public java-commons-collections4
5859 (package
5860 (name "java-commons-collections4")
5861 (version "4.1")
5862 (source (origin
5863 (method url-fetch)
5864 (uri (string-append "mirror://apache/commons/collections/source/"
5865 "commons-collections4-" version "-src.tar.gz"))
5866 (sha256
5867 (base32
5868 "1krfhvggympq4avk7gh6qafzf6b9ip6r1m4lmacikyx04039m0wl"))))
5869 (build-system ant-build-system)
5870 (arguments
5871 `(#:test-target "test"
5872 #:make-flags
5873 ,#~(let ((hamcrest #$(this-package-native-input "java-hamcrest-core"))
5874 (junit #$(this-package-native-input "java-junit"))
5875 (easymock #$(this-package-native-input "java-easymock")))
5876 (list (string-append "-Djunit.jar="
5877 (car (find-files junit "jar$")))
5878 (string-append "-Dhamcrest.jar="
5879 (car (find-files hamcrest "jar$")))
5880 (string-append "-Deasymock.jar=" easymock
5881 "/share/java/easymock.jar")))
5882 #:phases
5883 (modify-phases %standard-phases
5884 (replace 'install
5885 (install-jars "target")))))
5886 (native-inputs
5887 (list java-junit java-hamcrest-core java-easymock))
5888 (home-page "https://commons.apache.org/collections/")
5889 (synopsis "Collections framework")
5890 (description "The Java Collections Framework is the recognised standard
5891for collection handling in Java. Commons-Collections seek to build upon the
5892JDK classes by providing new interfaces, implementations and utilities. There
5893are many features, including:
5894
5895@itemize
5896@item @code{Bag} interface for collections that have a number of copies of
5897 each object
5898@item @code{BidiMap} interface for maps that can be looked up from value to
5899 key as well and key to value
5900@item @code{MapIterator} interface to provide simple and quick iteration over
5901 maps
5902@item Transforming decorators that alter each object as it is added to the
5903 collection
5904@item Composite collections that make multiple collections look like one
5905@item Ordered maps and sets that retain the order elements are added in,
5906 including an LRU based map
5907@item Reference map that allows keys and/or values to be garbage collected
5908 under close control
5909@item Many comparator implementations
5910@item Many iterator implementations
5911@item Adapter classes from array and enumerations to collections
5912@item Utilities to test or create typical set-theory properties of collections
5913 such as union, intersection, and closure.
5914@end itemize\n")
5915 (license license:asl2.0)))
5916
5917(define-public java-commons-collections
5918 (package
5919 (inherit java-commons-collections4)
5920 (name "java-commons-collections")
5921 (version "3.2.2")
5922 (source (origin
5923 (method url-fetch)
5924 (uri (string-append "mirror://apache/commons/collections/source/"
5925 "commons-collections-" version "-src.tar.gz"))
5926 (sha256
5927 (base32
5928 "055r51a5lfc3z7rkxnxmnn1npvkvda7636hjpm4qk7cnfzz98387"))
5929 (patches
5930 (search-patches "java-commons-collections-fix-java8.patch"))))
5931 (arguments
5932 (substitute-keyword-arguments (package-arguments java-commons-collections4)
5933 ((#:phases phases)
5934 `(modify-phases ,phases
5935 ;; The manifest is required by the build procedure
5936 (add-before 'build 'add-manifest
5937 (lambda _
5938 (mkdir-p "build/conf")
5939 (call-with-output-file "build/conf/MANIFEST.MF"
5940 (lambda (file)
5941 (format file "Manifest-Version: 1.0\n")))
5942 #t))
5943 (replace 'install
5944 (install-jars "build"))))))))
5945
5946(define java-commons-collections-test-classes
5947 (package
5948 (inherit java-commons-collections)
5949 (arguments
5950 `(#:jar-name "commons-collections-test-classes.jar"
5951 #:source-dir "src/test"
5952 #:tests? #f))
5953 (inputs
5954 `(("collection" ,java-commons-collections)))))
5955
5956(define-public java-commons-beanutils
5957 (package
5958 (name "java-commons-beanutils")
5959 (version "1.9.3")
5960 (source (origin
5961 (method url-fetch)
5962 (uri (string-append "mirror://apache/commons/beanutils/source/"
5963 "commons-beanutils-" version "-src.tar.gz"))
5964 (sha256
5965 (base32
5966 "03cs0bq3sl1sdc7py9g3qnf8n9h473nrkvd3d251kaqv6a2ab7qk"))))
5967 (build-system ant-build-system)
5968 (arguments
5969 `(#:test-target "test"
5970 #:tests? #f
5971 #:phases
5972 (modify-phases %standard-phases
5973 (replace 'install
5974 (lambda* (#:key outputs #:allow-other-keys)
5975 (rename-file (string-append "dist/commons-beanutils-" ,version
5976 "-SNAPSHOT.jar")
5977 "commons-beanutils.jar")
5978 (install-file "commons-beanutils.jar"
5979 (string-append (assoc-ref outputs "out") "/share/java/"))
5980 #t)))))
5981 (inputs
5982 `(("logging" ,java-commons-logging-minimal)
5983 ("collections" ,java-commons-collections)))
5984 (native-inputs
5985 `(("junit" ,java-junit)
5986 ("collections-test" ,java-commons-collections-test-classes)))
5987 (home-page "https://commons.apache.org/beanutils/")
5988 (synopsis "Dynamically set or get properties in Java")
5989 (description "BeanUtils provides a simplified interface to reflection and
5990introspection to set or get dynamically determined properties through their
5991setter and getter method.")
5992 (license license:asl2.0)))
5993
5994(define-public java-commons-io
5995 (package
5996 (name "java-commons-io")
5997 (version "2.5")
5998 (source
5999 (origin
6000 (method url-fetch)
6001 (uri (string-append "mirror://apache/commons/io/source/"
6002 "commons-io-" version "-src.tar.gz"))
6003 (sha256
6004 (base32
6005 "0q5y41jrcjvx9hzs47x5kdhnasdy6rm4bzqd2jxl02w717m7a7v3"))))
6006 (build-system ant-build-system)
6007 (outputs '("out" "doc"))
6008 (arguments
6009 `(#:test-target "test"
6010 #:make-flags
6011 ,#~(list (string-append "-Djunit.jar="
6012 (car (find-files #$(this-package-native-input "java-junit")
6013 "jar$"))))
6014 #:phases
6015 (modify-phases %standard-phases
6016 (add-after 'build 'build-javadoc ant-build-javadoc)
6017 (replace 'install (install-from-pom "pom.xml"))
6018 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6019 (native-inputs
6020 (list java-junit java-hamcrest-core))
6021 (propagated-inputs
6022 (list apache-commons-parent-pom-39))
6023 (home-page "https://commons.apache.org/io/")
6024 (synopsis "Common useful IO related classes")
6025 (description "Commons-IO contains utility classes, stream implementations,
6026file filters and endian classes.")
6027 (license license:asl2.0)))
6028
6029(define-public java-commons-exec-1.1
6030 (package
6031 (name "java-commons-exec")
6032 (version "1.1")
6033 (source
6034 (origin
6035 (method url-fetch)
6036 (uri (string-append "mirror://apache/commons/exec/source/"
6037 "commons-exec-" version "-src.tar.gz"))
6038 (sha256
6039 (base32
6040 "025dk8xgj10lxwwwqp0hng2rn7fr4vcirxzydqzx9k4dim667alk"))))
6041 (build-system ant-build-system)
6042 (arguments
6043 `(#:test-target "test"
6044 #:make-flags
6045 ,#~(list (string-append "-Dmaven.junit.jar="
6046 (car (find-files #$(this-package-native-input "java-junit")
6047 "jar$"))))
6048 #:phases
6049 (modify-phases %standard-phases
6050 (add-before 'build 'delete-network-tests
6051 (lambda _
6052 (delete-file "src/test/java/org/apache/commons/exec/DefaultExecutorTest.java")
6053 (substitute* "src/test/java/org/apache/commons/exec/TestRunner.java"
6054 (("suite\\.addTestSuite\\(DefaultExecutorTest\\.class\\);") ""))
6055 #t))
6056 ;; The "build" phase automatically tests.
6057 (delete 'check)
6058 (replace 'install (install-jars "target")))))
6059 (native-inputs
6060 (list java-junit))
6061 (home-page "https://commons.apache.org/proper/commons-exec/")
6062 (synopsis "Common program execution related classes")
6063 (description "Commons-Exec simplifies executing external processes.")
6064 (license license:asl2.0)))
6065
6066(define-public java-commons-exec
6067 (package
6068 (inherit java-commons-exec-1.1)
6069 (version "1.3")
6070 (source
6071 (origin
6072 (method url-fetch)
6073 (uri (string-append "mirror://apache/commons/exec/source/"
6074 "commons-exec-" version "-src.tar.gz"))
6075 (sha256
6076 (base32
6077 "17yb4h6f8l49c5iyyvda4z2nmw0bxrx857nrwmsr7mmpb7x441yv"))))
6078 (arguments
6079 `(#:test-target "test"
6080 #:make-flags
6081 ,#~(list (string-append "-Dmaven.junit.jar="
6082 (car (find-files #$(this-package-native-input "java-junit")
6083 "jar$")))
6084 "-Dmaven.compiler.source=1.7"
6085 "-Dmaven.compiler.target=1.7")
6086 #:phases
6087 (modify-phases %standard-phases
6088 (add-before 'build 'delete-network-tests
6089 (lambda* (#:key inputs #:allow-other-keys)
6090 ;; This test hangs indefinitely.
6091 (delete-file "src/test/java/org/apache/commons/exec/issues/Exec60Test.java")
6092 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec41Test.java"
6093 (("ping -c 10 127.0.0.1") "sleep 10"))
6094 (substitute* "src/test/java/org/apache/commons/exec/issues/Exec49Test.java"
6095 (("/bin/ls") "ls"))
6096 (call-with-output-file "src/test/scripts/ping.sh"
6097 (lambda (port)
6098 (format port "#!~a/bin/sh\nsleep $1\n"
6099 (assoc-ref inputs "bash"))))
6100 #t))
6101 ;; The "build" phase automatically tests.
6102 (delete 'check)
6103 (replace 'install (install-jars "target")))))
6104 (native-inputs
6105 (list java-junit java-hamcrest-core))))
6106
6107(define-public java-commons-lang
6108 (package
6109 (name "java-commons-lang")
6110 (version "2.6")
6111 (source
6112 (origin
6113 (method url-fetch)
6114 (uri (string-append "mirror://apache/commons/lang/source/"
6115 "commons-lang-" version "-src.tar.gz"))
6116 (sha256
6117 (base32 "1mxwagqadzx1b2al7i0z1v0r235aj2njdyijf02szq0vhmqrfiq5"))))
6118 (build-system ant-build-system)
6119 (outputs '("out" "doc"))
6120 (arguments
6121 `(#:test-target "test"
6122 #:test-exclude (list "**/Abstract*.java" "**/Random*.java")
6123 #:phases
6124 (modify-phases %standard-phases
6125 (add-after 'build 'build-javadoc ant-build-javadoc)
6126 (add-before 'check 'disable-failing-test
6127 (lambda _
6128 ;; Disable a failing test
6129 (substitute* "src/test/java/org/apache/commons/lang/\
6130time/FastDateFormatTest.java"
6131 (("public void testFormat\\(\\)")
6132 "public void disabled_testFormat()"))
6133 #t))
6134 (replace 'install (install-jars "target"))
6135 (add-after 'install 'install-doc (install-javadoc "target/apidocs")))))
6136 (native-inputs
6137 (list java-junit))
6138 (home-page "https://commons.apache.org/lang/")
6139 (synopsis "Extension of the java.lang package")
6140 (description "The Commons Lang components contains a set of Java classes
6141that provide helper methods for standard Java classes, especially those found
6142in the @code{java.lang} package in the Sun JDK. The following classes are
6143included:
6144
6145@itemize
6146@item StringUtils - Helper for @code{java.lang.String}.
6147@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets
6148 of characters such as @code{[a-z]} and @code{[abcdez]}.
6149@item RandomStringUtils - Helper for creating randomised strings.
6150@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6151@item NumberRange - A range of numbers with an upper and lower bound.
6152@item ObjectUtils - Helper for @code{java.lang.Object}.
6153@item SerializationUtils - Helper for serializing objects.
6154@item SystemUtils - Utility class defining the Java system properties.
6155@item NestedException package - A sub-package for the creation of nested
6156 exceptions.
6157@item Enum package - A sub-package for the creation of enumerated types.
6158@item Builder package - A sub-package for the creation of @code{equals},
6159 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6160@end itemize\n")
6161 (license license:asl2.0)))
6162
6163(define-public java-commons-lang3
6164 (package
6165 (name "java-commons-lang3")
6166 (version "3.12.0")
6167 (source
6168 (origin
6169 (method url-fetch)
6170 (uri (string-append "mirror://apache/commons/lang/source/"
6171 "commons-lang3-" version "-src.tar.gz"))
6172 (sha256
6173 (base32 "09dcv1pkdx3hpf06py8p9511f1wkin6jpacdll0c8vxpbi3yfwzv"))
6174 (patches
6175 (search-patches "java-commons-lang-fix-dependency.patch"))))
6176 (build-system ant-build-system)
6177 (arguments
6178 `(#:jar-name "commons-lang3.jar"
6179 #:source-dir "src/main/java"
6180 #:tests? #f; require junit5
6181 #:phases
6182 (modify-phases %standard-phases
6183 (replace 'install (install-from-pom "pom.xml")))))
6184 (propagated-inputs
6185 (list apache-commons-parent-pom-48))
6186 (home-page "https://commons.apache.org/lang/")
6187 (synopsis "Extension of the java.lang package")
6188 (description "The Commons Lang components contains a set of Java classes
6189that provide helper methods for standard Java classes, especially those found
6190in the @code{java.lang} package. The following classes are included:
6191
6192@itemize
6193@item StringUtils - Helper for @code{java.lang.String}.
6194@item CharSetUtils - Methods for dealing with @code{CharSets}, which are sets of
6195 characters such as @code{[a-z]} and @code{[abcdez]}.
6196@item RandomStringUtils - Helper for creating randomised strings.
6197@item NumberUtils - Helper for @code{java.lang.Number} and its subclasses.
6198@item NumberRange - A range of numbers with an upper and lower bound.
6199@item ObjectUtils - Helper for @code{java.lang.Object}.
6200@item SerializationUtils - Helper for serializing objects.
6201@item SystemUtils - Utility class defining the Java system properties.
6202@item NestedException package - A sub-package for the creation of nested
6203 exceptions.
6204@item Enum package - A sub-package for the creation of enumerated types.
6205@item Builder package - A sub-package for the creation of @code{equals},
6206 @code{hashCode}, @code{compareTo} and @code{toString} methods.
6207@end itemize\n")
6208 (license license:asl2.0)))
6209
6210(define-public java-commons-bsf
6211 (package
6212 (name "java-commons-bsf")
6213 (version "2.4.0")
6214 (source (origin
6215 (method url-fetch)
6216 (uri (string-append "mirror://apache/commons/bsf/source/bsf-src-"
6217 version ".tar.gz"))
6218 (sha256
6219 (base32
6220 "1sbamr8jl32p1jgf59nw0b2w9qivyg145954hm6ly54cfgsqrdas"))
6221 (modules '((guix build utils)))
6222 (snippet
6223 '(begin
6224 (for-each delete-file
6225 (find-files "." "\\.jar$"))
6226 #t))))
6227 (build-system ant-build-system)
6228 (arguments
6229 `(#:build-target "jar"
6230 #:tests? #f; No test file
6231 #:modules ((guix build ant-build-system)
6232 (guix build utils)
6233 (guix build java-utils)
6234 (sxml simple))
6235 #:phases
6236 (modify-phases %standard-phases
6237 (add-before 'build 'create-properties
6238 (lambda _
6239 ;; This file is missing from the distribution
6240 (call-with-output-file "build-properties.xml"
6241 (lambda (port)
6242 (sxml->xml
6243 `(project (@ (basedir ".") (name "build-properties") (default ""))
6244 (property (@ (name "project.name") (value "bsf")))
6245 (property (@ (name "source.level") (value "1.5")))
6246 (property (@ (name "build.lib") (value "build/jar")))
6247 (property (@ (name "src.dir") (value "src")))
6248 (property (@ (name "tests.dir") (value "src/org/apache/bsf/test")))
6249 (property (@ (name "build.tests") (value "build/test-classes")))
6250 (property (@ (name "build.dest") (value "build/classes"))))
6251 port)))
6252 #t))
6253 (replace 'install (install-jars "build")))))
6254 (native-inputs
6255 (list java-junit))
6256 (inputs
6257 (list java-commons-logging-minimal))
6258 (home-page "https://commons.apache.org/proper/commons-bsf")
6259 (synopsis "Bean Scripting Framework")
6260 (description "The Bean Scripting Framework (BSF) is a set of Java classes
6261which provides scripting language support within Java applications, and access
6262to Java objects and methods from scripting languages. BSF allows one to write
6263JSPs in languages other than Java while providing access to the Java class
6264library. In addition, BSF permits any Java application to be implemented in
6265part (or dynamically extended) by a language that is embedded within it. This
6266is achieved by providing an API that permits calling scripting language engines
6267from within Java, as well as an object registry that exposes Java objects to
6268these scripting language engines.")
6269 (license license:asl2.0)))
6270
6271(define-public java-commons-jxpath
6272 (package
6273 (name "java-commons-jxpath")
6274 (version "1.3")
6275 (source (origin
6276 (method url-fetch)
6277 (uri (string-append "mirror://apache/commons/jxpath/source/"
6278 "commons-jxpath-" version "-src.tar.gz"))
6279 (sha256
6280 (base32
6281 "1rpgg31ayn9fwr4bfi2i1ij0npcg79ad2fv0w9hacvawsyc42cfs"))))
6282 (build-system ant-build-system)
6283 (arguments
6284 `(#:jar-name "commons-jxpath.jar"
6285 ;; tests require more dependencies, including mockrunner which depends on old software
6286 #:tests? #f
6287 #:source-dir "src/java"))
6288 (inputs
6289 `(("servlet" ,java-classpathx-servletapi)
6290 ("java-jdom" ,java-jdom)
6291 ("java-commons-beanutils" ,java-commons-beanutils)))
6292 (native-inputs
6293 (list java-junit))
6294 (home-page "https://commons.apache.org/jxpath/")
6295 (synopsis "Simple interpreter of an expression language called XPath")
6296 (description "The org.apache.commons.jxpath package defines a simple
6297interpreter of an expression language called XPath. JXPath applies XPath
6298expressions to graphs of objects of all kinds: JavaBeans, Maps, Servlet
6299contexts, DOM etc, including mixtures thereof.")
6300 (license license:asl2.0)))
6301
6302(define-public java-commons-pool
6303 (package
6304 (name "java-commons-pool")
6305 (version "2.6.2")
6306 (source (origin
6307 (method url-fetch)
6308 (uri (string-append "mirror://apache/commons/pool/source/"
6309 "commons-pool2-" version "-src.tar.gz"))
6310 (sha256
6311 (base32
6312 "1fi1hgqmq01bs6azbj3sfswxzadp2r8sjjfiq6ryilz1m50kvrv6"))))
6313 (arguments
6314 `(#:jar-name "common-pool.jar"
6315 #:source-dir "src/main/java"
6316 #:test-exclude
6317 (list "**/PerformanceTest.java")))
6318 (build-system ant-build-system)
6319 (inputs
6320 (list java-cglib))
6321 (native-inputs
6322 (list java-junit java-hamcrest-core java-asm java-objenesis))
6323 (home-page "https://commons.apache.org/proper/commons-pool/")
6324 (synopsis "Object-pooling API in Java")
6325 (description "The commons-pool package provides an object-pooling API
6326and a number of object pool implementations. This package defines a
6327handful of pooling interfaces and some base classes that may be useful when
6328creating new pool implementations.")
6329 (license license:asl2.0)))
6330
6331(define-public java-commons-dbcp
6332 (package
6333 (name "java-commons-dbcp")
6334 (version "2.6.0")
6335 (source (origin
6336 (method url-fetch)
6337 (uri (string-append "mirror://apache/commons/dbcp/source/"
6338 "commons-dbcp2-" version "-src.tar.gz"))
6339 (sha256
6340 (base32
6341 "0axbvcbnf2l70fc3ybrlp3siw2w4ka9mia2pnx4py8gz54cpw3rc"))))
6342 (arguments
6343 `(#:source-dir "src/main/java"
6344 #:jar-name "java-commons-dbcp.jar"
6345 #:tests? #f)); requires apache-geronimo
6346 (inputs
6347 `(("java-commons-pool" ,java-commons-pool)
6348 ("java-commons-logging" ,java-commons-logging-minimal)
6349 ("java-jboss-transaction-api-spec" ,java-jboss-transaction-api-spec)))
6350 (native-inputs
6351 (list java-junit))
6352 (build-system ant-build-system)
6353 (home-page "https://commons.apache.org/proper/commons-dbcp/")
6354 (synopsis "Database Connection Pool for Java")
6355 (description "Commons-dbcp allows you to share a pool of database
6356connections between users. Creating a new connection for each user can be
6357time consuming and even unfeasible when the number of simultaneous users is
6358very large. This package provides a way to share a poole of connections to
6359reduce that load.")
6360 (license license:asl2.0)))
6361
6362(define-public java-commons-jcs
6363 (package
6364 (name "java-commons-jcs")
6365 (version "3.1")
6366 (source (origin
6367 (method url-fetch)
6368 (uri (string-append "mirror://apache/commons/jcs/source/"
6369 "commons-jcs3-dist-" version "-src.tar.gz"))
6370 (sha256
6371 (base32
6372 "0y1lm1xnsj99bf7y9mkvbzqfy8dr7ac8zcbkpsjgzb9vhabfsbac"))))
6373 (build-system ant-build-system)
6374 (arguments
6375 `(#:jar-name "commons-jcs.jar"
6376 #:source-dir "commons-jcs-core/src/main/java"
6377 #:test-dir "commons-jcs-core/src/test"
6378 #:tests? #f; requires hsqldb
6379 #:phases
6380 (modify-phases %standard-phases
6381 (add-before 'build 'copy-resources
6382 (lambda _
6383 (copy-recursively "commons-jcs-core/src/main/resources"
6384 "build/classes"))))))
6385 (propagated-inputs
6386 (list java-classpathx-servletapi
6387 java-commons-dbcp
6388 java-httpcomponents-httpclient
6389 java-httpcomponents-httpcore
6390 java-log4j-api))
6391 (native-inputs
6392 (list java-junit))
6393 (home-page "https://commons.apache.org/proper/commons-jcs/")
6394 (synopsis "Distributed caching system in Java")
6395 (description "JCS is a distributed caching system written in Java. It
6396is intended to speed up applications by providing a means to manage cached
6397data of various dynamic natures. Like any caching system, JCS is most useful
6398for high read, low put applications. Latency times drop sharply and
6399bottlenecks move away from the database in an effectively cached system.")
6400 (license license:asl2.0)))
6401
6402(define-public java-jsr250
6403 (package
6404 (name "java-jsr250")
6405 (version "1.3")
6406 (source (origin
6407 (method git-fetch)
6408 (uri (git-reference
6409 (url "https://github.com/javaee/javax.annotation")
6410 (commit version)))
6411 (file-name (git-file-name name version))
6412 (sha256
6413 (base32
6414 "1g22a9d75g01s9yxgdig0ss7i30j4ysnnp08gn4krn0wly4lpqq0"))))
6415 (build-system ant-build-system)
6416 (arguments
6417 `(#:tests? #f ; no tests included
6418 #:jdk ,icedtea-8
6419 #:jar-name "jsr250.jar"
6420 #:phases
6421 (modify-phases %standard-phases
6422 (replace 'install
6423 (install-from-pom "pom.xml")))))
6424 (propagated-inputs (list java-jvnet-parent-pom-3))
6425 (home-page "https://jcp.org/en/jsr/detail?id=250")
6426 (synopsis "Security-related annotations")
6427 (description "This package provides annotations for security. It provides
6428packages in the @code{javax.annotation} and @code{javax.annotation.security}
6429namespaces.")
6430 ;; either cddl or gpl2 only, with classpath exception
6431 (license (list license:cddl1.0
6432 license:gpl2))))
6433
6434(define-public java-jsr305
6435 (package
6436 (name "java-jsr305")
6437 (version "3.0.1")
6438 (source (origin
6439 (method url-fetch)
6440 (uri (string-append "https://repo1.maven.org/maven2/"
6441 "com/google/code/findbugs/"
6442 "jsr305/" version "/jsr305-"
6443 version "-sources.jar"))
6444 (sha256
6445 (base32
6446 "1rh6jin9v7jqpq3kf1swl868l8i94r636n03pzpsmgr8v0lh9j2n"))))
6447 (build-system ant-build-system)
6448 (arguments
6449 `(#:tests? #f ; no tests included
6450 #:jar-name "jsr305.jar"
6451 #:phases
6452 (modify-phases %standard-phases
6453 (add-before 'install 'create-pom
6454 (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version))
6455 (replace 'install
6456 (install-from-pom "pom.xml")))))
6457 (home-page "https://findbugs.sourceforge.net/")
6458 (synopsis "Annotations for the static analyzer called findbugs")
6459 (description "This package provides annotations for the findbugs package.
6460It provides packages in the @code{javax.annotations} namespace.")
6461 (license license:asl2.0)))
6462
6463(define-public java-error-prone-annotations
6464 (package
6465 (name "java-error-prone-annotations")
6466 (version "2.18.0")
6467 (source (origin
6468 (method git-fetch)
6469 (uri (git-reference
6470 (url "https://github.com/google/error-prone")
6471 (commit (string-append "v" version))))
6472 (file-name (git-file-name "java-error-prone" version))
6473 (sha256
6474 (base32
6475 "19sqsz0b308rhadr3ff10azdbqjq37nvrn9c06224dwpxap0931f"))))
6476 (build-system ant-build-system)
6477 (arguments
6478 `(#:tests? #f; no tests
6479 #:jar-name (string-append ,name "-" ,version ".jar")
6480 #:source-dir "annotations/src/main/java"
6481 #:test-dir "annotations/src/altest"
6482 #:phases
6483 (modify-phases %standard-phases
6484 (replace 'install (install-from-pom "annotations/pom.xml")))))
6485 (propagated-inputs (list java-error-prone-parent-pom java-jsr305))
6486 (home-page "https://errorprone.info")
6487 (synopsis "Java static analyzer at compile-time")
6488 (description "Error Prone is a static analysis tool for Java that catches
6489common programming mistakes at compile-time. This package contains annotations
6490used by programmers to guide the static analysis.")
6491 (license license:asl2.0)))
6492
6493(define java-error-prone-parent-pom
6494 (package
6495 (inherit java-error-prone-annotations)
6496 (name "java-error-prone-parent-pom")
6497 (arguments
6498 `(#:tests? #f
6499 #:phases
6500 (modify-phases %standard-phases
6501 (delete 'configure)
6502 (delete 'build)
6503 (replace 'install
6504 (install-pom-file "pom.xml")))))
6505 (propagated-inputs '())))
6506
6507(define-public java-guava
6508 (package
6509 (name "java-guava")
6510 (version "31.1")
6511 (source (origin
6512 (method git-fetch)
6513 (uri (git-reference
6514 (url "https://github.com/google/guava/")
6515 (commit (string-append "v" version))))
6516 (file-name (git-file-name name version))
6517 (sha256
6518 (base32
6519 "0sv1w5cnids9ad3l7qhrh3dh1wdqwc946iinsxryafr25wg5z1lp"))
6520 (patches
6521 (search-patches "java-guava-remove-annotation-deps.patch"))))
6522 (build-system ant-build-system)
6523 (arguments
6524 `(#:tests? #f ; no tests included
6525 #:jar-name "guava.jar"
6526 #:source-dir "guava/src"
6527 #:phases
6528 (modify-phases %standard-phases
6529 (add-after 'unpack 'trim-sources
6530 (lambda _
6531 (with-directory-excursion "guava/src/com/google/common"
6532 ;; Remove annotations to avoid extra dependencies:
6533 ;; * "j2objc" annotations are used when converting Java to
6534 ;; Objective C;
6535 ;; * "IgnoreJRERequirement" is used for Android.
6536 ;; * "Nullable" is used to catch NPE at build time.
6537 (substitute* (find-files "." "\\.java$")
6538 (("import com.google.j2objc.*") "")
6539 (("import org.checkerframework.checker.*") "")
6540 (("@ReflectionSupport.*") "")
6541 (("@WeakOuter") "")
6542 (("@RetainedWith") "")
6543 (("@Weak") "")
6544 (("@J2ObjCIncompatible") "")
6545 (("@IgnoreJRERequirement") "")
6546 (("@Nullable") "")))))
6547 ;; This is required by guava, but this is just an empty stub
6548 (add-before 'install 'install-listenablefuture-stub
6549 (install-pom-file "futures/listenablefuture9999/pom.xml"))
6550 (replace 'install (install-from-pom "guava/pom.xml")))))
6551 (inputs
6552 (list java-error-prone-annotations java-jsr305))
6553 (propagated-inputs
6554 (list java-guava-futures-failureaccess java-guava-parent-pom))
6555 (home-page "https://github.com/google/guava")
6556 (synopsis "Google core libraries for Java")
6557 (description "Guava is a set of core libraries that includes new
6558collection types (such as multimap and multiset), immutable collections, a
6559graph library, functional types, an in-memory cache, and APIs/utilities for
6560concurrency, I/O, hashing, primitives, reflection, string processing, and much
6561more!")
6562 (license license:asl2.0)))
6563
6564(define-public java-guava-futures-failureaccess
6565 (package
6566 (inherit java-guava)
6567 (name "java-guava-futures-failureaccess")
6568 (arguments
6569 `(#:tests? #f; no tests
6570 #:jar-name "guava-futures-failureaccess.jar"
6571 #:source-dir "futures/failureaccess/src"
6572 #:phases
6573 (modify-phases %standard-phases
6574 (replace 'install
6575 (install-from-pom "futures/failureaccess/pom.xml")))))
6576 (propagated-inputs
6577 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6578
6579(define java-guava-parent-pom
6580 (package
6581 (inherit java-guava)
6582 (name "java-guava-parent-pom")
6583 (arguments
6584 `(#:tests? #f
6585 #:phases
6586 (modify-phases %standard-phases
6587 (delete 'configure)
6588 (delete 'build)
6589 (replace 'install
6590 (install-pom-file "pom.xml")))))
6591 (propagated-inputs
6592 `(("java-sonatype-oss-parent-pom" ,java-sonatype-oss-parent-pom-7)))))
6593
6594;; The java-commons-logging package provides adapters to many different
6595;; logging frameworks. To avoid an excessive dependency graph we try to build
6596;; it with only a minimal set of adapters.
6597(define-public java-commons-logging-minimal
6598 (package
6599 (name "java-commons-logging-minimal")
6600 (version "1.2")
6601 (source (origin
6602 (method url-fetch)
6603 (uri (string-append "mirror://apache/commons/logging/source/"
6604 "commons-logging-" version "-src.tar.gz"))
6605 (sha256
6606 (base32
6607 "10bwcy5w8d7y39n0krlwhnp8ds3kj5zhmzj0zxnkw0qdlsjmsrj9"))))
6608 (build-system ant-build-system)
6609 (arguments
6610 `(#:tests? #f ; avoid dependency on logging frameworks
6611 #:jar-name "commons-logging-minimal.jar"
6612 #:phases
6613 (modify-phases %standard-phases
6614 (add-after 'unpack 'delete-adapters-and-tests
6615 (lambda _
6616 ;; Delete all adapters except for NoOpLog, SimpleLog, and
6617 ;; LogFactoryImpl. NoOpLog is required to build; LogFactoryImpl
6618 ;; is used by applications; SimpleLog is the only actually usable
6619 ;; implementation that does not depend on another logging
6620 ;; framework.
6621 (for-each
6622 (lambda (file)
6623 (delete-file (string-append
6624 "src/main/java/org/apache/commons/logging/impl/" file)))
6625 (list "Jdk13LumberjackLogger.java"
6626 "WeakHashtable.java"
6627 "Log4JLogger.java"
6628 "ServletContextCleaner.java"
6629 "Jdk14Logger.java"
6630 "AvalonLogger.java"
6631 "LogKitLogger.java"))
6632 (delete-file-recursively "src/test")
6633 #t)))))
6634 (home-page "https://commons.apache.org/logging/")
6635 (synopsis "Common API for logging implementations")
6636 (description "The Logging package is a thin bridge between different
6637logging implementations. A library that uses the commons-logging API can be
6638used with any logging implementation at runtime.")
6639 (license license:asl2.0)))
6640
6641;; This is the last release of the 1.x series.
6642(define-public java-mockito-1
6643 (package
6644 (name "java-mockito")
6645 (version "1.10.19")
6646 (source (origin
6647 (method url-fetch)
6648 (uri (string-append "https://repo1.maven.org/maven2/"
6649 "org/mockito/mockito-core/" version
6650 "/mockito-core-" version "-sources.jar"))
6651 (sha256
6652 (base32
6653 "0vmiwnwpf83g2q7kj1rislmja8fpvqkixjhawh7nxnygx6pq11kc"))))
6654 (build-system ant-build-system)
6655 (arguments
6656 `(#:jar-name "mockito.jar"
6657 #:tests? #f ; no tests included
6658 ;; FIXME: patch-and-repack does not support jars, so we have to apply
6659 ;; patches in build phases.
6660 #:phases
6661 (modify-phases %standard-phases
6662 ;; Mockito was developed against a different version of hamcrest,
6663 ;; which does not require matcher implementations to provide an
6664 ;; implementation of the "describeMismatch" method. We add this
6665 ;; simple definition to pass the build with our version of hamcrest.
6666 (add-after 'unpack 'fix-hamcrest-build-error
6667 (lambda _
6668 (substitute* "src/org/mockito/internal/matchers/LocalizedMatcher.java"
6669 (("public Matcher getActualMatcher\\(\\) .*" line)
6670 (string-append "
6671 public void describeMismatch(Object item, Description description) {
6672 actualMatcher.describeMismatch(item, description);
6673 }"
6674 line)))
6675 #t))
6676 ;; Mockito bundles cglib. We have a cglib package, so let's use
6677 ;; that instead.
6678 (add-after 'unpack 'use-system-libraries
6679 (lambda _
6680 (with-directory-excursion "src/org/mockito/internal/creation/cglib"
6681 (substitute* '("CGLIBHacker.java"
6682 "CglibMockMaker.java"
6683 "ClassImposterizer.java"
6684 "DelegatingMockitoMethodProxy.java"
6685 "MethodInterceptorFilter.java"
6686 "MockitoNamingPolicy.java"
6687 "SerializableMockitoMethodProxy.java"
6688 "SerializableNoOp.java")
6689 (("import org.mockito.cglib") "import net.sf.cglib")))
6690 #t)))))
6691 (inputs
6692 (list java-junit java-objenesis java-cglib java-hamcrest-core))
6693 (home-page "http://mockito.org")
6694 (synopsis "Mockito is a mock library for Java")
6695 (description "Mockito is a mocking library for Java which lets you write
6696tests with a clean and simple API. It generates mocks using reflection, and
6697it records all mock invocations, including methods arguments.")
6698 (license license:asl2.0)))
6699
6700(define-public java-httpcomponents-httpcore
6701 (package
6702 (name "java-httpcomponents-httpcore")
6703 (version "4.4.6")
6704 (source (origin
6705 (method url-fetch)
6706 (uri (string-append "mirror://apache//httpcomponents/httpcore/"
6707 "source/httpcomponents-core-"
6708 version "-src.tar.gz"))
6709 (sha256
6710 (base32
6711 "02bwcf38y4vgwq7kj2s6q7qrmma641r5lacivm16kgxvb2j6h1vy"))))
6712 (build-system ant-build-system)
6713 (arguments
6714 `(#:jar-name "httpcomponents-httpcore.jar"
6715 #:phases
6716 (modify-phases %standard-phases
6717 (add-after 'unpack 'chdir
6718 (lambda _ (chdir "httpcore") #t)))))
6719 (inputs
6720 (list java-commons-logging-minimal java-commons-lang3))
6721 (native-inputs
6722 (list java-junit java-mockito-1))
6723 (home-page "https://hc.apache.org/httpcomponents-core-4.4.x/index.html")
6724 (synopsis "Low level HTTP transport components")
6725 (description "HttpCore is a set of low level HTTP transport components
6726that can be used to build custom client and server side HTTP services with a
6727minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6728on the classic Java I/O and non-blocking, event driven I/O model based on Java
6729NIO.
6730
6731This package provides the blocking I/O model library.")
6732 (license license:asl2.0)))
6733
6734(define-public java-httpcomponents-httpcore-nio
6735 (package (inherit java-httpcomponents-httpcore)
6736 (name "java-httpcomponents-httpcore-nio")
6737 (arguments
6738 `(#:jar-name "httpcomponents-httpcore-nio.jar"
6739 #:phases
6740 (modify-phases %standard-phases
6741 (add-after 'unpack 'chdir
6742 (lambda _ (chdir "httpcore-nio") #t)))))
6743 (inputs
6744 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6745 (prepend java-httpcomponents-httpcore java-hamcrest-core)))
6746 (description "HttpCore is a set of low level HTTP transport components
6747that can be used to build custom client and server side HTTP services with a
6748minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6749on the classic Java I/O and non-blocking, event driven I/O model based on Java
6750NIO.
6751
6752This package provides the non-blocking I/O model library based on Java
6753NIO.")))
6754
6755(define-public java-httpcomponents-httpcore-ab
6756 (package (inherit java-httpcomponents-httpcore)
6757 (name "java-httpcomponents-httpcore-ab")
6758 (arguments
6759 `(#:jar-name "httpcomponents-httpcore-ab.jar"
6760 #:phases
6761 (modify-phases %standard-phases
6762 (add-after 'unpack 'chdir
6763 (lambda _ (chdir "httpcore-ab") #t)))))
6764 (inputs
6765 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6766 (prepend java-httpcomponents-httpcore java-commons-cli
6767 java-hamcrest-core)))
6768 (synopsis "Apache HttpCore benchmarking tool")
6769 (description "This package provides the HttpCore benchmarking tool. It is
6770an Apache AB clone based on HttpCore.")))
6771
6772(define-public java-httpcomponents-httpcore-osgi
6773 (package (inherit java-httpcomponents-httpcore)
6774 (name "java-httpcomponents-httpcore-osgi")
6775 (arguments
6776 `(#:jar-name "httpcomponents-httpcore-osgi.jar"
6777 #:phases
6778 (modify-phases %standard-phases
6779 (add-after 'unpack 'chdir
6780 (lambda _ (chdir "httpcore-osgi"))))))
6781 (inputs
6782 (modify-inputs (package-inputs java-httpcomponents-httpcore)
6783 (prepend java-httpcomponents-httpcore
6784 java-httpcomponents-httpcore-nio
6785 java-hamcrest-core)))
6786 (native-inputs (list java-ops4j-pax-exam-core
6787 java-ops4j-pax-exam-core-junit
6788 java-ops4j-pax-exam-core-spi
6789 java-junit))
6790 (description "HttpCore is a set of low level HTTP transport components
6791that can be used to build custom client and server side HTTP services with a
6792minimal footprint. HttpCore supports two I/O models: blocking I/O model based
6793on the classic Java I/O and non-blocking, event driven I/O model based on Java
6794NIO.
6795
6796This package provides... some tests.")))
6797
6798(define-public java-httpcomponents-httpclient
6799 (package
6800 (name "java-httpcomponents-httpclient")
6801 (version "4.5.12")
6802 (source (origin
6803 (method url-fetch)
6804 (uri (string-append "mirror://apache/httpcomponents/httpclient/"
6805 "source/httpcomponents-client-"
6806 version "-src.tar.gz"))
6807 (sha256
6808 (base32
6809 "1va99m2zc2liv0v9vn72p5ja8yz4s5wq7zpahaai5nr966kvxzkb"))))
6810 (build-system ant-build-system)
6811 (arguments
6812 `(#:jar-name "httpcomponents-httpclient.jar"
6813 #:phases
6814 (modify-phases %standard-phases
6815 (add-after 'unpack 'chdir
6816 (lambda _ (chdir "httpclient") #t)))))
6817 (inputs
6818 (list java-commons-logging-minimal
6819 java-commons-codec
6820 java-hamcrest-core
6821 java-httpcomponents-httpcore
6822 java-mockito-1
6823 java-junit))
6824 (home-page "https://hc.apache.org/httpcomponents-client-ga/")
6825 (synopsis "HTTP client library for Java")
6826 (description "Although the @code{java.net} package provides basic
6827functionality for accessing resources via HTTP, it doesn't provide the full
6828flexibility or functionality needed by many applications. @code{HttpClient}
6829seeks to fill this void by providing an efficient, up-to-date, and
6830feature-rich package implementing the client side of the most recent HTTP
6831standards and recommendations.")
6832 (license license:asl2.0)))
6833
6834(define-public java-httpcomponents-httpclient-cache
6835 (package (inherit java-httpcomponents-httpclient)
6836 (name "java-httpcomponents-httpclient-cache")
6837 (arguments
6838 `(#:jar-name "httpcomponents-httpclient-cache.jar"
6839 #:source-dir "src/main/java"
6840 #:test-dir "src/test"
6841 #:tests? #f; tests are broken with current cglib.
6842 #:phases
6843 (modify-phases %standard-phases
6844 (add-after 'unpack 'delete-unused-impls
6845 (lambda _
6846 (for-each
6847 delete-file-recursively
6848 '("src/main/java/org/apache/http/impl/client/cache/ehcache/"
6849 "src/main/java/org/apache/http/impl/client/cache/memcached/"
6850 "src/test/java/org/apache/http/impl/client/cache/ehcache/"
6851 "src/test/java/org/apache/http/impl/client/cache/memcached/"))))
6852 (add-after 'unpack 'chdir
6853 (lambda _ (chdir "httpclient-cache"))))))
6854 (inputs
6855 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6856 (prepend java-httpcomponents-httpclient
6857 java-httpcomponents-httpmime
6858 java-hamcrest-core)))
6859 (description "This package provides an API for caching accessed HTTP
6860resources.")))
6861
6862(define-public java-httpcomponents-httpclient-osgi
6863 (package (inherit java-httpcomponents-httpclient)
6864 (name "java-httpcomponents-httpclient-osgi")
6865 (arguments
6866 `(#:jar-name "httpcomponents-httpclient-osgi.jar"
6867 #:tests? #f; tests are broken with current cglib.
6868 #:phases
6869 (modify-phases %standard-phases
6870 (add-after 'unpack 'chdir
6871 (lambda _ (chdir "httpclient-osgi") #t)))))
6872 (inputs
6873 (modify-inputs (package-inputs java-httpcomponents-httpclient)
6874 (prepend java-httpcomponents-httpclient
6875 java-httpcomponents-httpclient-cache
6876 java-osgi-framework
6877 java-osgi-service-cm
6878 java-hamcrest-core)))))
6879
6880(define-public java-httpcomponents-httpmime
6881 (package (inherit java-httpcomponents-httpclient)
6882 (name "java-httpcomponents-httpmime")
6883 (arguments
6884 `(#:jar-name "httpcomponents-httpmime.jar"
6885 #:phases
6886 (modify-phases %standard-phases
6887 (add-after 'unpack 'chdir
6888 (lambda _ (chdir "httpmime") #t)))))
6889 (inputs
6890 (list java-httpcomponents-httpclient java-httpcomponents-httpcore
6891 java-junit java-hamcrest-core))))
6892
6893(define-public java-commons-net
6894 (package
6895 (name "java-commons-net")
6896 (version "3.6")
6897 (source (origin
6898 (method url-fetch)
6899 (uri (string-append "mirror://apache/commons/net/source/"
6900 "commons-net-" version "-src.tar.gz"))
6901 (sha256
6902 (base32
6903 "0n0cmnddk9qdqhjvka8pc6hd9mn2qi3166f1s6xk32h7rfy1adxr"))))
6904 (build-system ant-build-system)
6905 (arguments
6906 `(;; FIXME: MainTest.java tries to read "examples.properties" (which
6907 ;; should be "resources/examples/examples.properties"), but gets "null"
6908 ;; instead.
6909 #:tests? #f
6910 #:jar-name "commons-net.jar"))
6911 (native-inputs
6912 (list java-junit java-hamcrest-core))
6913 (home-page "https://commons.apache.org/net/")
6914 (synopsis "Client library for many basic Internet protocols")
6915 (description "The Apache Commons Net library implements the client side of
6916many basic Internet protocols. The purpose of the library is to provide
6917fundamental protocol access, not higher-level abstractions.")
6918 (license license:asl2.0)))
6919
6920(define-public java-jsch
6921 (package
6922 (name "java-jsch")
6923 (version "0.1.55")
6924 (source (origin
6925 (method url-fetch)
6926 (uri (string-append "mirror://sourceforge/jsch/jsch/"
6927 version "/jsch-" version ".zip"))
6928 (sha256
6929 (base32
6930 "1lxyjwvmwa723wcf3bqn816hkvc03vz4xhbsi7bvfhrz2rpgcfq6"))))
6931 (build-system ant-build-system)
6932 (arguments
6933 `(#:build-target "dist"
6934 #:tests? #f ; no tests included
6935 #:phases
6936 (modify-phases %standard-phases
6937 (replace 'install (install-jars "dist")))))
6938 (native-inputs
6939 (list unzip))
6940 (home-page "http://www.jcraft.com/jsch/")
6941 (synopsis "Pure Java implementation of SSH2")
6942 (description "JSch is a pure Java implementation of SSH2. JSch allows you
6943to connect to an SSH server and use port forwarding, X11 forwarding, file
6944transfer, etc., and you can integrate its functionality into your own Java
6945programs.")
6946 (license license:bsd-3)))
6947
6948(define-public java-commons-compress
6949 (package
6950 (name "java-commons-compress")
6951 (version "1.21")
6952 (source (origin
6953 (method url-fetch)
6954 (uri (string-append "mirror://apache/commons/compress/source/"
6955 "commons-compress-" version "-src.tar.gz"))
6956 (sha256
6957 (base32
6958 "1rkpb6xcyly1wnbx4q6iq6p5hrr0h1d0ppb5r07psc75cbmizjry"))))
6959 (build-system ant-build-system)
6960 (arguments
6961 `(#:jar-name "commons-compress.jar"
6962 #:source-dir "src/main/java"
6963 #:tests? #f; requires java-mockito-3
6964 #:phases
6965 (modify-phases %standard-phases
6966 (replace 'install (install-from-pom "pom.xml")))))
6967 (propagated-inputs
6968 (list java-asm-3
6969 java-brotli
6970 java-osgi-core
6971 java-xz
6972 java-zstd
6973 apache-commons-parent-pom-52))
6974 (home-page "https://commons.apache.org/proper/commons-compress/")
6975 (synopsis "Java library for working with compressed files")
6976 (description "The Apache Commons Compress library defines an API for
6977working with compressed files such as ar, cpio, Unix dump, tar, zip, gzip, XZ,
6978Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE, lz4 and Z files.")
6979 (license license:asl2.0)))
6980
6981(define-public java-commons-csv
6982 (package
6983 (name "java-commons-csv")
6984 (version "1.4")
6985 (source (origin
6986 (method url-fetch)
6987 (uri (string-append "mirror://apache/commons/csv/source/"
6988 "commons-csv-" version "-src.tar.gz"))
6989 (sha256
6990 (base32
6991 "1l89m0fm2s3xx3v3iynvangymfg2vlyngaj6fgsi457nmsw7m7ij"))))
6992 (build-system ant-build-system)
6993 (arguments
6994 `(#:jar-name "commons-csv.jar"
6995 #:source-dir "src/main/java"
6996 #:tests? #f)); FIXME: requires java-h2
6997 (inputs
6998 `(("java-hamcrest-core" ,java-hamcrest-core)
6999 ("java-commons-io" ,java-commons-io)
7000 ("java-commons-lang3" ,java-commons-lang3)
7001 ("junit" ,java-junit)))
7002 (home-page "https://commons.apache.org/proper/commons-csv/")
7003 (synopsis "Read and write CSV documents")
7004 (description "Commons CSV reads and writes files in variations of the Comma
7005Separated Value (CSV) format. The most common CSV formats are predefined in the
7006CSVFormat class:
7007
7008@itemize
7009@item Microsoft Excel
7010@item Informix UNLOAD
7011@item Informix UNLOAD CSV
7012@item MySQL
7013@item RFC 4180
7014@item TDF
7015@end itemize
7016
7017Custom formats can be created using a fluent style API.")
7018 (license license:asl2.0)))
7019
7020(define-public java-osgi-annotation
7021 (package
7022 (name "java-osgi-annotation")
7023 (version "6.0.0")
7024 (source (origin
7025 (method url-fetch)
7026 (uri (string-append "https://repo1.maven.org/maven2/"
7027 "org/osgi/org.osgi.annotation/" version "/"
7028 "org.osgi.annotation-" version "-sources.jar"))
7029 (sha256
7030 (base32
7031 "1q718mb7gqg726rh6pc2hcisn8v50nv35abbir0jypmffhiii85w"))))
7032 (build-system ant-build-system)
7033 (arguments
7034 `(#:tests? #f ; no tests
7035 #:jar-name "osgi-annotation.jar"
7036 #:phases
7037 (modify-phases %standard-phases
7038 (add-before 'install 'create-pom
7039 (generate-pom.xml "pom.xml" "osgi" "osgi-annotation" ,version))
7040 (replace 'install (install-from-pom "pom.xml")))))
7041 (home-page "https://www.osgi.org")
7042 (synopsis "Annotation module of OSGi framework")
7043 (description
7044 "OSGi, for Open Services Gateway initiative framework, is a module system
7045and service platform for the Java programming language. This package contains
7046the OSGi annotation module, providing additional services to help dynamic
7047components.")
7048 (license license:asl2.0)))
7049
7050(define-public java-osgi-core
7051 (package
7052 (name "java-osgi-core")
7053 (version "6.0.0")
7054 (source (origin
7055 (method url-fetch)
7056 (uri (string-append "https://repo1.maven.org/maven2/"
7057 "org/osgi/org.osgi.core/" version "/"
7058 "org.osgi.core-" version "-sources.jar"))
7059 (sha256
7060 (base32
7061 "19bpf5jx32jq9789gyhin35q5v7flmw0p9mk7wbgqpxqfmxyiabv"))))
7062 (build-system ant-build-system)
7063 (arguments
7064 `(#:tests? #f ; no tests
7065 #:jar-name "osgi-core.jar"
7066 #:phases
7067 (modify-phases %standard-phases
7068 (add-before 'install 'create-pom
7069 (generate-pom.xml "pom.xml" "org.osgi" "org.osgi.core" ,version))
7070 (replace 'install (install-from-pom "pom.xml")))))
7071 (inputs
7072 (list java-osgi-annotation))
7073 (home-page "https://www.osgi.org")
7074 (synopsis "Core module of OSGi framework")
7075 (description
7076 "OSGi, for Open Services Gateway initiative framework, is a module system
7077and service platform for the Java programming language. This package contains
7078the OSGi Core module.")
7079 (license license:asl2.0)))
7080
7081(define-public java-osgi-service-event
7082 (package
7083 (name "java-osgi-service-event")
7084 (version "1.3.1")
7085 (source (origin
7086 (method url-fetch)
7087 (uri (string-append "https://repo1.maven.org/maven2/"
7088 "org/osgi/org.osgi.service.event/"
7089 version "/org.osgi.service.event-"
7090 version "-sources.jar"))
7091 (sha256
7092 (base32
7093 "1nyhlgagwym75bycnjczwbnpymv2iw84zbhvvzk84g9q736i6qxm"))))
7094 (build-system ant-build-system)
7095 (arguments
7096 `(#:tests? #f ; no tests
7097 #:jar-name "osgi-service-event.jar"))
7098 (inputs
7099 (list java-osgi-annotation java-osgi-core))
7100 (home-page "https://www.osgi.org")
7101 (synopsis "OSGi service event module")
7102 (description
7103 "OSGi, for Open Services Gateway initiative framework, is a module system
7104and service platform for the Java programming language. This package contains
7105the OSGi @code{org.osgi.service.event} module.")
7106 (license license:asl2.0)))
7107
7108(define-public java-eclipse-osgi
7109 (package
7110 (name "java-eclipse-osgi")
7111 (version "3.11.3")
7112 (source (origin
7113 (method url-fetch)
7114 (uri (string-append "https://repo1.maven.org/maven2/"
7115 "org/eclipse/platform/org.eclipse.osgi/"
7116 version "/org.eclipse.osgi-"
7117 version "-sources.jar"))
7118 (sha256
7119 (base32
7120 "00cqc6lb29n0zv68b4l842vzkwawvbr7gshfdygsk8sicvcq2c7b"))))
7121 (build-system ant-build-system)
7122 (arguments
7123 `(#:tests? #f ; no tests included
7124 #:jar-name "eclipse-equinox-osgi.jar"))
7125 (inputs
7126 (list java-osgi-annotation))
7127 (home-page "https://www.eclipse.org/equinox/")
7128 (synopsis "Eclipse Equinox OSGi framework")
7129 (description "This package provides an implementation of the OSGi Core
7130specification.")
7131 (license license:epl1.0)))
7132
7133(define-public java-eclipse-equinox-common
7134 (package
7135 (name "java-eclipse-equinox-common")
7136 (version "3.10.200")
7137 (source (origin
7138 (method url-fetch)
7139 (uri (string-append "https://repo1.maven.org/maven2/"
7140 "org/eclipse/platform/org.eclipse.equinox.common/"
7141 version "/org.eclipse.equinox.common-"
7142 version "-sources.jar"))
7143 (sha256
7144 (base32
7145 "1yn8ij6xsljlf35sr2l7wvyvc0ss4n1rv0ry5zkgb49dj4hyrqrj"))))
7146 (build-system ant-build-system)
7147 (arguments
7148 `(#:tests? #f ; no tests included
7149 #:jar-name "eclipse-equinox-common.jar"))
7150 (inputs
7151 (list java-eclipse-osgi))
7152 (home-page "https://www.eclipse.org/equinox/")
7153 (synopsis "Common Eclipse runtime")
7154 (description "This package provides the common Eclipse runtime.")
7155 (license license:epl1.0)))
7156
7157(define-public java-eclipse-core-jobs
7158 (package
7159 (name "java-eclipse-core-jobs")
7160 (version "3.8.0")
7161 (source (origin
7162 (method url-fetch)
7163 (uri (string-append "https://repo1.maven.org/maven2/"
7164 "org/eclipse/platform/org.eclipse.core.jobs/"
7165 version "/org.eclipse.core.jobs-"
7166 version "-sources.jar"))
7167 (sha256
7168 (base32
7169 "0395b8lh0km8vhzjnchvs1rii1qz48hyvb2wqfaq4yhklbwihq4b"))))
7170 (build-system ant-build-system)
7171 (arguments
7172 `(#:tests? #f ; no tests included
7173 #:jar-name "eclipse-core-jobs.jar"))
7174 (inputs
7175 (list java-eclipse-equinox-common java-eclipse-osgi))
7176 (home-page "https://www.eclipse.org/equinox/")
7177 (synopsis "Eclipse jobs mechanism")
7178 (description "This package provides the Eclipse jobs mechanism.")
7179 (license license:epl1.0)))
7180
7181(define-public java-eclipse-equinox-registry
7182 (package
7183 (name "java-eclipse-equinox-registry")
7184 (version "3.6.100")
7185 (source (origin
7186 (method url-fetch)
7187 (uri (string-append "https://repo1.maven.org/maven2/"
7188 "org/eclipse/platform/org.eclipse.equinox.registry/"
7189 version "/org.eclipse.equinox.registry-"
7190 version "-sources.jar"))
7191 (sha256
7192 (base32
7193 "1i9sgymh2fy5vdgk5y7s3qvrlbgh4l93ddqi3v4zmca7hwrlhf9k"))))
7194 (build-system ant-build-system)
7195 (arguments
7196 `(#:tests? #f ; no tests included
7197 #:jar-name "eclipse-equinox-registry.jar"))
7198 (inputs
7199 (list java-eclipse-core-jobs java-eclipse-equinox-common
7200 java-eclipse-osgi))
7201 (home-page "https://www.eclipse.org/equinox/")
7202 (synopsis "Eclipse extension registry support")
7203 (description "This package provides support for the Eclipse extension
7204registry.")
7205 (license license:epl1.0)))
7206
7207(define-public java-eclipse-equinox-app
7208 (package
7209 (name "java-eclipse-equinox-app")
7210 (version "1.3.400")
7211 (source (origin
7212 (method url-fetch)
7213 (uri (string-append "https://repo1.maven.org/maven2/"
7214 "org/eclipse/platform/org.eclipse.equinox.app/"
7215 version "/org.eclipse.equinox.app-"
7216 version "-sources.jar"))
7217 (sha256
7218 (base32
7219 "0nhvbp93y203ar7y59gb0mz3w2d3jlqhr0c9hii9bcfpmr7imdab"))))
7220 (build-system ant-build-system)
7221 (arguments
7222 `(#:tests? #f ; no tests included
7223 #:jar-name "eclipse-equinox-app.jar"))
7224 (inputs
7225 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7226 java-eclipse-osgi java-osgi-service-event))
7227 (home-page "https://www.eclipse.org/equinox/")
7228 (synopsis "Equinox application container")
7229 (description "This package provides the Equinox application container for
7230Eclipse.")
7231 (license license:epl1.0)))
7232
7233(define-public java-eclipse-equinox-preferences
7234 (package
7235 (name "java-eclipse-equinox-preferences")
7236 (version "3.6.1")
7237 (source (origin
7238 (method url-fetch)
7239 (uri (string-append "https://repo1.maven.org/maven2/"
7240 "org/eclipse/platform/org.eclipse.equinox.preferences/"
7241 version "/org.eclipse.equinox.preferences-"
7242 version "-sources.jar"))
7243 (sha256
7244 (base32
7245 "0k7w6c141sqym4fy3af0qkwpy4pdh2vsjpjba6rp5fxyqa24v0a2"))))
7246 (build-system ant-build-system)
7247 (arguments
7248 `(#:tests? #f ; no tests included
7249 #:jar-name "eclipse-equinox-preferences.jar"))
7250 (inputs
7251 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7252 java-eclipse-osgi))
7253 (home-page "https://www.eclipse.org/equinox/")
7254 (synopsis "Eclipse preferences mechanism")
7255 (description "This package provides the Eclipse preferences mechanism with
7256the module @code{org.eclipse.equinox.preferences}.")
7257 (license license:epl1.0)))
7258
7259(define-public java-eclipse-core-contenttype
7260 (package
7261 (name "java-eclipse-core-contenttype")
7262 (version "3.5.100")
7263 (source (origin
7264 (method url-fetch)
7265 (uri (string-append "https://repo1.maven.org/maven2/"
7266 "org/eclipse/platform/org.eclipse.core.contenttype/"
7267 version "/org.eclipse.core.contenttype-"
7268 version "-sources.jar"))
7269 (sha256
7270 (base32
7271 "1wcqcv7ijwv5rh748vz3x9pkmjl9w1r0k0026k56n8yjl4rrmspi"))))
7272 (build-system ant-build-system)
7273 (arguments
7274 `(#:tests? #f ; no tests included
7275 #:jar-name "eclipse-core-contenttype.jar"))
7276 (inputs
7277 (list java-eclipse-equinox-common java-eclipse-equinox-preferences
7278 java-eclipse-equinox-registry java-eclipse-osgi))
7279 (home-page "https://www.eclipse.org/")
7280 (synopsis "Eclipse content mechanism")
7281 (description "This package provides the Eclipse content mechanism in the
7282@code{org.eclipse.core.contenttype} module.")
7283 (license license:epl1.0)))
7284
7285(define-public java-eclipse-core-runtime
7286 (package
7287 (name "java-eclipse-core-runtime")
7288 (version "3.15.100")
7289 (source (origin
7290 (method url-fetch)
7291 (uri (string-append "https://repo1.maven.org/maven2/"
7292 "org/eclipse/platform/org.eclipse.core.runtime/"
7293 version "/org.eclipse.core.runtime-"
7294 version "-sources.jar"))
7295 (sha256
7296 (base32
7297 "0l8xayacsbjvz5hypx2fv47vpw2n4dspamcfb3hx30x9hj8vmg7r"))))
7298 (build-system ant-build-system)
7299 (arguments
7300 `(#:tests? #f ; no tests included
7301 #:jar-name "eclipse-core-runtime.jar"))
7302 (inputs
7303 (list java-eclipse-core-contenttype
7304 java-eclipse-core-jobs
7305 java-eclipse-equinox-app
7306 java-eclipse-equinox-common
7307 java-eclipse-equinox-registry
7308 java-eclipse-equinox-preferences
7309 java-eclipse-osgi))
7310 (home-page "https://www.eclipse.org/")
7311 (synopsis "Eclipse core runtime")
7312 (description "This package provides the Eclipse core runtime with the
7313module @code{org.eclipse.core.runtime}.")
7314 (license license:epl1.0)))
7315
7316(define-public java-eclipse-core-filesystem
7317 (package
7318 (name "java-eclipse-core-filesystem")
7319 (version "1.6.1")
7320 (source (origin
7321 (method url-fetch)
7322 (uri (string-append "https://repo1.maven.org/maven2/"
7323 "org/eclipse/platform/org.eclipse.core.filesystem/"
7324 version "/org.eclipse.core.filesystem-"
7325 version "-sources.jar"))
7326 (sha256
7327 (base32
7328 "0km1bhwjim4rfy3pkvjhvy31kgsyf2ncx0mlkmbf5n6g57pphdyj"))))
7329 (build-system ant-build-system)
7330 (arguments
7331 `(#:tests? #f ; no tests included
7332 #:jar-name "eclipse-core-filesystem.jar"))
7333 (inputs
7334 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7335 java-eclipse-osgi))
7336 (home-page "https://www.eclipse.org/")
7337 (synopsis "Eclipse core file system")
7338 (description "This package provides the Eclipse core file system with the
7339module @code{org.eclipse.core.filesystem}.")
7340 (license license:epl1.0)))
7341
7342(define-public java-eclipse-core-expressions
7343 (package
7344 (name "java-eclipse-core-expressions")
7345 (version "3.5.100")
7346 (source (origin
7347 (method url-fetch)
7348 (uri (string-append "https://repo1.maven.org/maven2/"
7349 "org/eclipse/platform/org.eclipse.core.expressions/"
7350 version "/org.eclipse.core.expressions-"
7351 version "-sources.jar"))
7352 (sha256
7353 (base32
7354 "18bw2l875gmygvpagpgk9l24qzbdjia4ag12nw6fi8v8yaq4987f"))))
7355 (build-system ant-build-system)
7356 (arguments
7357 `(#:tests? #f ; no tests included
7358 #:jar-name "eclipse-core-expressions.jar"))
7359 (inputs
7360 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7361 java-eclipse-equinox-preferences java-eclipse-core-runtime
7362 java-eclipse-osgi))
7363 (home-page "https://www.eclipse.org/")
7364 (synopsis "Eclipse core expression language")
7365 (description "This package provides the Eclipse core expression language
7366with the @code{org.eclipse.core.expressions} module.")
7367 (license license:epl1.0)))
7368
7369(define-public java-eclipse-core-variables
7370 (package
7371 (name "java-eclipse-core-variables")
7372 (version "3.3.0")
7373 (source (origin
7374 (method url-fetch)
7375 (uri (string-append "https://repo1.maven.org/maven2/"
7376 "org/eclipse/platform/org.eclipse.core.variables/"
7377 version "/org.eclipse.core.variables-"
7378 version "-sources.jar"))
7379 (sha256
7380 (base32
7381 "12dirh03zi4n5x5cj07vzrhkmnqy6h9q10h9j605pagmpmifyxmy"))))
7382 (build-system ant-build-system)
7383 (arguments
7384 `(#:tests? #f ; no tests included
7385 #:jar-name "eclipse-core-variables.jar"))
7386 (inputs
7387 (list java-eclipse-equinox-common java-eclipse-equinox-registry
7388 java-eclipse-equinox-preferences java-eclipse-core-runtime
7389 java-eclipse-osgi))
7390 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7391 (synopsis "Eclipse core variables")
7392 (description "This package provides the Eclipse core variables module
7393@code{org.eclipse.core.variables}.")
7394 (license license:epl1.0)))
7395
7396(define-public java-eclipse-ant-core
7397 (package
7398 (name "java-eclipse-ant-core")
7399 (version "3.4.100")
7400 (source (origin
7401 (method url-fetch)
7402 (uri (string-append "https://repo1.maven.org/maven2/"
7403 "org/eclipse/platform/org.eclipse.ant.core/"
7404 version "/org.eclipse.ant.core-"
7405 version "-sources.jar"))
7406 (sha256
7407 (base32
7408 "11g3if794qjlk98mz9zch22rr56sd7z63vn4i7k2icr8cq5bfqg7"))))
7409 (build-system ant-build-system)
7410 (arguments
7411 `(#:tests? #f ; no tests included
7412 #:jar-name "eclipse-ant-core.jar"))
7413 (inputs
7414 (list java-eclipse-equinox-app
7415 java-eclipse-equinox-common
7416 java-eclipse-equinox-registry
7417 java-eclipse-equinox-preferences
7418 java-eclipse-core-contenttype
7419 java-eclipse-core-runtime
7420 java-eclipse-core-variables
7421 java-eclipse-osgi))
7422 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7423 (synopsis "Ant build tool core libraries")
7424 (description "This package provides the ant build tool core libraries with
7425the module @code{org.eclipse.ant.core}.")
7426 (license license:epl1.0)))
7427
7428(define-public java-eclipse-core-resources
7429 (package
7430 (name "java-eclipse-core-resources")
7431 (version "3.13.200")
7432 (source (origin
7433 (method url-fetch)
7434 (uri (string-append "https://repo1.maven.org/maven2/"
7435 "org/eclipse/platform/org.eclipse.core.resources/"
7436 version "/org.eclipse.core.resources-"
7437 version "-sources.jar"))
7438 (sha256
7439 (base32
7440 "1sn3b6ky72hkvxcgf9b2jkpbdh3y8lbhi9xxwv1dsiddpkkq91hs"))))
7441 (build-system ant-build-system)
7442 (arguments
7443 `(#:tests? #f ; no tests included
7444 #:jar-name "eclipse-core-resources.jar"))
7445 (inputs
7446 (list java-eclipse-equinox-common
7447 java-eclipse-equinox-preferences
7448 java-eclipse-equinox-registry
7449 java-eclipse-core-contenttype
7450 java-eclipse-core-expressions
7451 java-eclipse-core-filesystem
7452 java-eclipse-core-jobs
7453 java-eclipse-core-runtime
7454 java-eclipse-ant-core
7455 java-eclipse-osgi))
7456 (home-page "https://www.eclipse.org/")
7457 (synopsis "Eclipse core resource management")
7458 (description "This package provides the Eclipse core resource management
7459module @code{org.eclipse.core.resources}.")
7460 (license license:epl1.0)))
7461
7462(define-public java-eclipse-compare-core
7463 (package
7464 (name "java-eclipse-compare-core")
7465 (version "3.6.0")
7466 (source (origin
7467 (method url-fetch)
7468 (uri (string-append "https://repo1.maven.org/maven2/"
7469 "org/eclipse/platform/org.eclipse.compare.core/"
7470 version "/org.eclipse.compare.core-"
7471 version "-sources.jar"))
7472 (sha256
7473 (base32
7474 "10g37r0pbiffyv2wk35c6g5lwzkdipkl0kkjp41v84dln46xm4dg"))))
7475 (build-system ant-build-system)
7476 (arguments
7477 `(#:tests? #f ; no tests included
7478 #:jar-name "eclipse-compare-core.jar"))
7479 (inputs
7480 (list java-eclipse-core-runtime java-eclipse-equinox-common
7481 java-eclipse-osgi java-icu4j))
7482 (home-page "https://www.eclipse.org/")
7483 (synopsis "Eclipse core compare support")
7484 (description "This package provides the Eclipse core compare support
7485module @code{org.eclipse.compare.core}.")
7486 (license license:epl1.0)))
7487
7488(define-public java-eclipse-team-core
7489 (package
7490 (name "java-eclipse-team-core")
7491 (version "3.8.0")
7492 (source (origin
7493 (method url-fetch)
7494 (uri (string-append "https://repo1.maven.org/maven2/"
7495 "org/eclipse/platform/org.eclipse.team.core/"
7496 version "/org.eclipse.team.core-"
7497 version "-sources.jar"))
7498 (sha256
7499 (base32
7500 "02j2jzqgb26zx2d5ahxmvijw6j4r0la90zl5c3i65x6z19ciyam7"))))
7501 (build-system ant-build-system)
7502 (arguments
7503 `(#:tests? #f ; no tests included
7504 #:jar-name "eclipse-team-core.jar"))
7505 (inputs
7506 (list java-eclipse-compare-core
7507 java-eclipse-core-contenttype
7508 java-eclipse-core-filesystem
7509 java-eclipse-core-jobs
7510 java-eclipse-core-resources
7511 java-eclipse-core-runtime
7512 java-eclipse-equinox-common
7513 java-eclipse-equinox-registry
7514 java-eclipse-equinox-preferences
7515 java-eclipse-osgi))
7516 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7517 (synopsis "Eclipse team support core")
7518 (description "This package provides the Eclipse team support core module
7519@code{org.eclipse.team.core}.")
7520 (license license:epl1.0)))
7521
7522(define-public java-eclipse-core-commands
7523 (package
7524 (name "java-eclipse-core-commands")
7525 (version "3.8.1")
7526 (source (origin
7527 (method url-fetch)
7528 (uri (string-append "https://repo1.maven.org/maven2/"
7529 "org/eclipse/platform/org.eclipse.core.commands/"
7530 version "/org.eclipse.core.commands-"
7531 version "-sources.jar"))
7532 (sha256
7533 (base32
7534 "0yjn482qndcfrsq3jd6vnhcylp16420f5aqkrwr8spsprjigjcr9"))))
7535 (build-system ant-build-system)
7536 (arguments
7537 `(#:tests? #f ; no tests included
7538 #:jar-name "eclipse-core-commands.jar"))
7539 (inputs
7540 (list java-eclipse-equinox-common))
7541 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7542 (synopsis "Eclipse core commands")
7543 (description "This package provides Eclipse core commands in the module
7544@code{org.eclipse.core.commands}.")
7545 (license license:epl1.0)))
7546
7547(define-public java-eclipse-text
7548 (package
7549 (name "java-eclipse-text")
7550 (version "3.6.0")
7551 (source (origin
7552 (method url-fetch)
7553 (uri (string-append "https://repo1.maven.org/maven2/"
7554 "org/eclipse/platform/org.eclipse.text/"
7555 version "/org.eclipse.text-"
7556 version "-sources.jar"))
7557 (sha256
7558 (base32
7559 "0scz70vzz5qs5caji9f5q01vkqnvip7dpri1q07l8wbbdcxn4cq1"))))
7560 (build-system ant-build-system)
7561 (arguments
7562 `(#:tests? #f ; no tests included
7563 #:jar-name "eclipse-text.jar"
7564 #:phases
7565 (modify-phases %standard-phases
7566 ;; When creating a new category we must make sure that the new list
7567 ;; matches List<Position>. By default it seems to be too generic
7568 ;; (ArrayList<Object>), so we specialize it to ArrayList<Position>.
7569 ;; Without this we get this error:
7570 ;;
7571 ;; [javac] .../src/org/eclipse/jface/text/AbstractDocument.java:376:
7572 ;; error: method put in interface Map<K,V> cannot be applied to given types;
7573 ;; [javac] fPositions.put(category, new ArrayList<>());
7574 ;; [javac] ^
7575 ;; [javac] required: String,List<Position>
7576 ;; [javac] found: String,ArrayList<Object>
7577 ;; [javac] reason: actual argument ArrayList<Object> cannot be converted
7578 ;; to List<Position> by method invocation conversion
7579 ;; [javac] where K,V are type-variables:
7580 ;; [javac] K extends Object declared in interface Map
7581 ;; [javac] V extends Object declared in interface Map
7582 ;;
7583 ;; I don't know if this is a good fix. I suspect it is not, but it
7584 ;; seems to work.
7585 (add-after 'unpack 'fix-compilation-error
7586 (lambda _
7587 (substitute* "src/org/eclipse/jface/text/AbstractDocument.java"
7588 (("Positions.put\\(category, new ArrayList<>\\(\\)\\);")
7589 "Positions.put(category, new ArrayList<Position>());"))
7590 #t)))))
7591 (inputs
7592 (list java-eclipse-equinox-common java-eclipse-core-commands
7593 java-icu4j))
7594 (home-page "https://projects.eclipse.org/projects/eclipse.platform")
7595 (synopsis "Eclipse text library")
7596 (description "Platform Text is part of the Platform UI project and
7597provides the basic building blocks for text and text editors within Eclipse
7598and contributes the Eclipse default text editor.")
7599 (license license:epl1.0)))
7600
7601(define-public java-eclipse-jdt-core
7602 (package
7603 (name "java-eclipse-jdt-core")
7604 (version "3.16.0")
7605 (source (origin
7606 (method url-fetch)
7607 (uri (string-append "https://repo1.maven.org/maven2/"
7608 "org/eclipse/jdt/org.eclipse.jdt.core/"
7609 version "/org.eclipse.jdt.core-"
7610 version "-sources.jar"))
7611 (sha256
7612 (base32
7613 "1g560yr9v2kzv34gc2m3ifpgnj7krcdd6h4gd4z83pwqacwkfz0k"))))
7614 (build-system ant-build-system)
7615 (arguments
7616 `(#:tests? #f ; no tests included
7617 #:jar-name "eclipse-jdt-core.jar"
7618 #:phases
7619 (modify-phases %standard-phases
7620 (add-after 'unpack 'move-sources
7621 (lambda _
7622 (with-directory-excursion "src/jdtCompilerAdaptersrc/"
7623 (for-each (lambda (file)
7624 (install-file file (string-append "../" (dirname file))))
7625 (find-files "." ".*")))
7626 (delete-file-recursively "src/jdtCompilerAdaptersrc/")
7627 #t))
7628 (add-before 'build 'copy-resources
7629 (lambda _
7630 (with-directory-excursion "src"
7631 (for-each (lambda (file)
7632 (install-file file (string-append "../build/classes/" (dirname file))))
7633 (find-files "." ".*.(props|properties|rsc)")))
7634 #t)))))
7635 (inputs
7636 (list java-eclipse-core-contenttype
7637 java-eclipse-core-filesystem
7638 java-eclipse-core-jobs
7639 java-eclipse-core-resources
7640 java-eclipse-core-runtime
7641 java-eclipse-equinox-app
7642 java-eclipse-equinox-common
7643 java-eclipse-equinox-preferences
7644 java-eclipse-equinox-registry
7645 java-eclipse-osgi
7646 java-eclipse-text))
7647 (home-page "https://www.eclipse.org/jdt")
7648 (synopsis "Java development tools core libraries")
7649 (description "This package provides the core libraries of the Eclipse Java
7650development tools.")
7651 (license license:epl1.0)))
7652
7653(define-public java-eclipse-jdt-compiler-apt
7654 (package
7655 (name "java-eclipse-jdt-compiler-apt")
7656 (version "1.3.400")
7657 (source (origin
7658 (method url-fetch)
7659 (uri (string-append "https://repo1.maven.org/maven2/"
7660 "org/eclipse/jdt/org.eclipse.jdt.compiler.apt/"
7661 version "/org.eclipse.jdt.compiler.apt-"
7662 version "-sources.jar"))
7663 (sha256
7664 (base32
7665 "1s285k9p2ixdqrknb40jbbvw682n9a7l5lqpn583a8pvlzg2l6r8"))))
7666 (build-system ant-build-system)
7667 (arguments
7668 `(#:tests? #f ; no tests included
7669 #:jar-name "eclipse-jdt-compiler-apt.jar"
7670 #:jdk ,openjdk11))
7671 (inputs
7672 (list java-eclipse-jdt-core))
7673 (home-page "https://www.eclipse.org/jdt/apt/")
7674 (synopsis "Annotation processing tool")
7675 (description "APT stands for Annotation Processing Tool. APT provides a
7676means for generating files and compiling new Java classes based on annotations
7677found in your source code.")
7678 (license license:epl2.0)))
7679
7680(define-public java-eclipse-lsp4j-common
7681 (package
7682 (name "java-eclipse-lsp4j-common")
7683 (version "0.10.0")
7684 (source (origin
7685 (method git-fetch)
7686 (uri (git-reference
7687 (url "https://github.com/eclipse/lsp4j")
7688 (commit (string-append "v" version))))
7689 (file-name (git-file-name name version))
7690 (sha256
7691 (base32
7692 "17srrac0pkpybwwc21rzdvn762zzl9m80rlqihc9b4l55hkqpk98"))))
7693 (build-system ant-build-system)
7694 (home-page "https://eclipse.org/lsp4j/")
7695 (synopsis "LSP4J common package")
7696 (description "Eclipse LSP4J provides Java bindings for the Language
7697Server Protocol and the Debug Adapter Protocol. This package is a common
7698definition intended to be inherited by other packages.")
7699 (license license:epl2.0)))
7700
7701(define-public java-eclipse-lsp4j-debug
7702 (package
7703 (inherit java-eclipse-lsp4j-common)
7704 (name "java-eclipse-lsp4j-debug")
7705 (arguments
7706 `(#:jar-name "eclipse-lsp4j-debug.jar"
7707 #:jdk ,openjdk11
7708 #:tests? #f; tests fail with reflection errors
7709 #:source-dir "org.eclipse.lsp4j.debug/src/main/java"
7710 #:test-dir "org.eclipse.lsp4j.debug/src/test"
7711 #:phases
7712 (modify-phases %standard-phases
7713 (add-before 'build 'copy-xtend
7714 (lambda _
7715 (copy-recursively "org.eclipse.lsp4j.debug/src/main/xtend-gen"
7716 "org.eclipse.lsp4j.debug/src/main/java"))))))
7717 (native-inputs
7718 (list java-junit))
7719 (inputs
7720 `(("java-gson" ,java-gson-2.8.6)
7721 ("java-eclipse-lsp4j-generaor" ,java-eclipse-lsp4j-generator)
7722 ("java-eclipse-lsp4j-jsonrpc" ,java-eclipse-lsp4j-jsonrpc)
7723 ("java-eclipse-lsp4j-jsonrpc-debug" ,java-eclipse-lsp4j-jsonrpc-debug)
7724 ("java-eclipse-xtext-xbase-lib" ,java-eclipse-xtext-xbase-lib)))
7725 (synopsis "Eclipse LSP4J Java bindings for the Debug Server Protocol")
7726 (description "Eclipse LSP4J provides Java bindings for the Language
7727Server Protocol and the Debug Adapter Protocol. This package contains its
7728LSP4J Java bindings for the Debug Server Protocol.")))
7729
7730(define-public java-eclipse-lsp4j-generator
7731 (package
7732 (inherit java-eclipse-lsp4j-common)
7733 (name "java-eclipse-lsp4j-generator")
7734 (arguments
7735 `(#:jar-name "eclipse-lsp4j-generator.jar"
7736 #:jdk ,openjdk11
7737 #:tests? #f; no tests
7738 #:source-dir "org.eclipse.lsp4j.generator/src/main/java"))
7739 (inputs
7740 (list java-eclipse-lsp4j-jsonrpc))
7741 (synopsis "Eclipse LSP4J Generator")
7742 (description "Eclipse LSP4J provides Java bindings for the Language
7743Server Protocol and the Debug Adapter Protocol. This package contains its
7744LSP4J code generator for Language Server Protocol classes.")))
7745
7746(define-public java-eclipse-lsp4j-jsonrpc
7747 (package
7748 (inherit java-eclipse-lsp4j-common)
7749 (name "java-eclipse-lsp4j-jsonrpc")
7750 (arguments
7751 `(#:jar-name "eclipse-lsp4j-jsonrpc.jar"
7752 #:jdk ,openjdk11
7753 #:source-dir "org.eclipse.lsp4j.jsonrpc/src/main/java"
7754 #:test-dir "org.eclipse.lsp4j.jsonrpc/src/test"))
7755 (native-inputs
7756 (list java-junit))
7757 (inputs
7758 (list java-gson-2.8.6))
7759 (synopsis "Java JSON-RPC implementation")
7760 (description "Eclipse LSP4J provides Java bindings for the Language
7761Server Protocol and the Debug Adapter Protocol. This package contains its
7762JSON-RPC implementation.")))
7763
7764(define-public java-eclipse-lsp4j-jsonrpc-debug
7765 (package
7766 (inherit java-eclipse-lsp4j-common)
7767 (name "java-eclipse-lsp4j-jsonrpc-debug")
7768 (arguments
7769 `(#:jar-name "eclipse-lsp4j-jsonrpc-debug.jar"
7770 #:jdk ,openjdk11
7771 #:source-dir "org.eclipse.lsp4j.jsonrpc.debug/src/main/java"
7772 #:test-dir "org.eclipse.lsp4j.jsonrpc.debug/src/test"))
7773 (native-inputs
7774 (list java-junit))
7775 (inputs
7776 (list java-eclipse-lsp4j-jsonrpc java-gson-2.8.6))
7777 (synopsis "Java JSON-RPC implementation (debug protocol)")
7778 (description "Eclipse LSP4J provides Java bindings for the Language
7779Server Protocol and the Debug Adapter Protocol. This package contains its
7780JSON-RPC implementation's debug protocol.")))
7781
7782(define-public java-eclipse-xtext-xbase-lib
7783 (package
7784 (name "java-eclipse-xtext-xbase-lib")
7785 (version "2.25.0")
7786 (source (origin
7787 (method git-fetch)
7788 (uri (git-reference
7789 (url "https://github.com/eclipse/xtext-lib")
7790 (commit (string-append "v" version))))
7791 (file-name (git-file-name name version))
7792 (sha256
7793 (base32
7794 "13b9lf6lnsprkik665m1qcyyc8cs16k33xm7as4rjcfcpn4pln71"))))
7795 (build-system ant-build-system)
7796 (arguments
7797 `(#:jar-name "eclipse-xtext-xbase-lib.jar"
7798 #:jdk ,openjdk11
7799 #:tests? #f; TODO (maybe needs newer guava version?)
7800 #:source-dir "org.eclipse.xtext.xbase.lib/src"
7801 #:test-dir "org.eclipse.xtext.xbase.lib.tests/src"))
7802 (native-inputs
7803 (list java-junit))
7804 (inputs
7805 (list java-guava))
7806 (home-page "https://www.eclipse.org/Xtext/")
7807 (synopsis "Eclipse Xbase Runtime Library")
7808 (description "This package contains runtime libraries for Xbase languages
7809such as Xtend.")
7810 (license license:epl2.0)))
7811
7812(define-public java-javax-mail
7813 (package
7814 (name "java-javax-mail")
7815 (version "1.5.6")
7816 (source (origin
7817 (method url-fetch)
7818 (uri (string-append "https://repo1.maven.org/maven2/"
7819 "com/sun/mail/javax.mail/"
7820 version "/javax.mail-"
7821 version "-sources.jar"))
7822 (sha256
7823 (base32
7824 "0sdlfgsc2b5s89xv1261y8i0jijcja019k2x1c8ngfn582w4jly9"))))
7825 (build-system ant-build-system)
7826 (arguments
7827 `(#:tests? #f ; no tests
7828 #:jar-name "javax-mail.jar"))
7829 (home-page "https://javamail.java.net")
7830 (synopsis "Reference implementation of the JavaMail API")
7831 (description
7832 "This package provides versions of the JavaMail API implementation, IMAP,
7833SMTP, and POP3 service providers, some examples, and documentation for the
7834JavaMail API.")
7835 ;; GPLv2 only with "classpath exception".
7836 (license license:gpl2)))
7837
7838(define-public java-log4j-api
7839 (package
7840 (name "java-log4j-api")
7841 (version "2.17.1")
7842 (source (origin
7843 (method url-fetch)
7844 (uri (string-append "mirror://apache/logging/log4j/" version
7845 "/apache-log4j-" version "-src.tar.gz"))
7846 (sha256
7847 (base32
7848 "05xssljdgxfv8ql42db8ydjfsvvbdqmsgip75phybm259ydzbsd6"))))
7849 (build-system ant-build-system)
7850 (arguments
7851 `(#:tests? #f ; tests require unpackaged software
7852 #:jar-name "log4j-api.jar"
7853 #:make-flags
7854 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7855 #:phases
7856 (modify-phases %standard-phases
7857 (add-after 'unpack 'enter-dir
7858 (lambda _ (chdir "log4j-api") #t))
7859 ;; FIXME: The tests require additional software that has not been
7860 ;; packaged yet, such as
7861 ;; * org.apache.maven
7862 ;; * org.apache.felix
7863 (add-after 'enter-dir 'delete-tests
7864 (lambda _ (delete-file-recursively "src/test") #t)))))
7865 (inputs
7866 (list java-osgi-core java-hamcrest-core java-junit))
7867 (properties '((cpe-name . "log4j")))
7868 (home-page "https://logging.apache.org/log4j/2.x/")
7869 (synopsis "API module of the Log4j logging framework for Java")
7870 (description
7871 "This package provides the API module of the Log4j logging framework for
7872Java.")
7873 (license license:asl2.0)))
7874
7875(define-public java-log4j-core
7876 (package
7877 (inherit java-log4j-api)
7878 (name "java-log4j-core")
7879 (inputs
7880 `(("java-osgi-core" ,java-osgi-core)
7881 ("java-hamcrest-core" ,java-hamcrest-core)
7882 ("java-log4j-api" ,java-log4j-api)
7883 ("java-mail" ,java-mail)
7884 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7885 ("java-conversant-disruptor" ,java-conversant-disruptor)
7886 ("java-lmax-disruptor" ,java-lmax-disruptor)
7887 ("java-jctools-core" ,java-jctools-core-1)
7888 ("java-stax2-api" ,java-stax2-api)
7889 ("java-jansi" ,java-jansi)
7890 ("java-kafka" ,java-kafka-clients)
7891 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
7892 ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
7893 ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
7894 ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
7895 ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml)
7896 ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
7897 ("java-commons-compress" ,java-commons-compress)
7898 ("java-commons-csv" ,java-commons-csv)
7899 ("java-jeromq" ,java-jeromq)
7900 ("java-junit" ,java-junit)))
7901 (native-inputs
7902 `(("hamcrest" ,java-hamcrest-all)
7903 ("java-commons-io" ,java-commons-io)
7904 ("java-commons-lang3" ,java-commons-lang3)
7905 ("slf4j" ,java-slf4j-api)))
7906 (arguments
7907 `(#:tests? #f ; tests require more dependencies
7908 #:test-dir "src/test"
7909 #:source-dir "src/main/java"
7910 #:jar-name "log4j-core.jar"
7911 #:jdk ,icedtea-8
7912 #:make-flags
7913 ,#~(list (string-append "-Ddist.dir=" #$output "/share/java"))
7914 #:phases
7915 (modify-phases %standard-phases
7916 (add-after 'unpack 'enter-dir
7917 (lambda _ (chdir "log4j-core") #t)))))
7918 (synopsis "Core component of the Log4j framework")
7919 (description "This package provides the core component of the Log4j
7920logging framework for Java.")))
7921
7922(define-public java-log4j-1.2-api
7923 (package
7924 (inherit java-log4j-api)
7925 (name "java-log4j-1.2-api")
7926 (arguments
7927 `(#:jar-name "java-log4j-1.2-api.jar"
7928 #:source-dir "log4j-1.2-api/src/main/java"
7929 #:jdk ,icedtea-8
7930 ;; Tests require maven-model (and other maven subprojects), which is a
7931 ;; cyclic dependency.
7932 #:tests? #f))
7933 (inputs
7934 `(("log4j-api" ,java-log4j-api)
7935 ("log4j-core" ,java-log4j-core)
7936 ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec)
7937 ("osgi-core" ,java-osgi-core)
7938 ("eclipse-osgi" ,java-eclipse-osgi)
7939 ("java-lmax-disruptor" ,java-lmax-disruptor)))))
7940
7941(define-public java-commons-cli
7942 (package
7943 (name "java-commons-cli")
7944 (version "1.4")
7945 (source (origin
7946 (method url-fetch)
7947 (uri (string-append "mirror://apache/commons/cli/source/"
7948 "commons-cli-" version "-src.tar.gz"))
7949 (sha256
7950 (base32
7951 "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1"))))
7952 (build-system ant-build-system)
7953 ;; TODO: javadoc
7954 (arguments
7955 `(#:jar-name "commons-cli.jar"
7956 #:phases
7957 (modify-phases %standard-phases
7958 (replace 'install
7959 (install-from-pom "pom.xml")))))
7960 (native-inputs
7961 (list java-junit java-hamcrest-core))
7962 (home-page "https://commons.apache.org/cli/")
7963 (synopsis "Command line arguments and options parsing library")
7964 (description "The Apache Commons CLI library provides an API for parsing
7965command line options passed to programs. It is also able to print help
7966messages detailing the options available for a command line tool.
7967
7968Commons CLI supports different types of options:
7969
7970@itemize
7971@item POSIX like options (ie. tar -zxvf foo.tar.gz)
7972@item GNU like long options (ie. du --human-readable --max-depth=1)
7973@item Java like properties (ie. java -Djava.awt.headless=true Foo)
7974@item Short options with value attached (ie. gcc -O2 foo.c)
7975@item long options with single hyphen (ie. ant -projecthelp)
7976@end itemize
7977
7978This is a part of the Apache Commons Project.")
7979 (license license:asl2.0)))
7980
7981(define-public java-commons-text
7982 (package
7983 (name "java-commons-text")
7984 (version "1.9")
7985 (source (origin
7986 (method url-fetch)
7987 (uri (string-append "mirror://apache/commons/text/source/"
7988 "commons-text-" version "-src.tar.gz"))
7989 (sha256
7990 (base32
7991 "1k99ib2dxlqxb5y94kpzf4ix8xgxz1j3n9kq3ddssqqcccsp5ik2"))))
7992 (build-system ant-build-system)
7993 (arguments
7994 (list #:jar-name "java-commons-text.jar"
7995 #:source-dir "src/main/java"
7996 #:test-dir "src/test"
7997 #:tests? #f ; Tests require JUnit5.
7998 #:phases
7999 #~(modify-phases %standard-phases
8000 (replace 'install
8001 (install-from-pom "pom.xml")))))
8002 (inputs
8003 (list java-commons-io))
8004 (propagated-inputs
8005 (list java-commons-lang3
8006 apache-commons-parent-pom-51))
8007 (home-page "https://commons.apache.org/text/")
8008 (synopsis "Library focused on algorithms working on strings")
8009 (description "Apache Commons Text is a library focused on algorithms
8010working on strings.
8011
8012This is a part of the Apache Commons Project.")
8013 (license license:asl2.0)))
8014
8015(define-public java-commons-codec
8016 (package
8017 (name "java-commons-codec")
8018 (version "1.15")
8019 (source (origin
8020 (method url-fetch)
8021 (uri (string-append "mirror://apache/commons/codec/source/"
8022 "commons-codec-" version "-src.tar.gz"))
8023 (sha256
8024 (base32
8025 "01z9qmg8fd8d7p7xxipwj1vi9bmvpgqyi29kldjz2x6vzwm171jj"))))
8026 (build-system ant-build-system)
8027 (arguments
8028 `(#:jar-name "java-commons-codec.jar"
8029 #:source-dir "src/main/java"
8030 #:test-dir "src/test"
8031 #:test-exclude (list "**/*AbstractTest.java")
8032 #:phases
8033 (modify-phases %standard-phases
8034 (add-before 'build 'copy-resources
8035 (lambda _
8036 (copy-recursively "src/main/resources"
8037 "build/classes")))
8038 (add-before 'check 'copy-test-resources
8039 (lambda _
8040 (copy-recursively "src/test/resources"
8041 "build/test-classes")))
8042 (add-before 'check 'skip-ravenous-test
8043 (lambda _
8044 ;; This test admits to being "memory hungry", but reliably fails
8045 ;; even on a machine that should have plenty (12 GiB). Skip it.
8046 (substitute*
8047 "src/test/java/org/apache/commons/codec/binary/BaseNCodecTest.java"
8048 (("\\bassertEnsureBufferSizeExpandsToMaxBufferSize.*;")
8049 "return;"))))
8050 (replace 'install (install-from-pom "pom.xml")))))
8051 (native-inputs
8052 (list java-commons-lang3 java-junit))
8053 (propagated-inputs
8054 (list apache-commons-parent-pom-52))
8055 (home-page "https://commons.apache.org/codec/")
8056 (synopsis "Common encoders and decoders such as Base64, Hex, Phonetic and URLs")
8057 (description "The codec package contains simple encoder and decoders for
8058various formats such as Base64 and Hexadecimal. In addition to these widely
8059used encoders and decoders, the codec package also maintains a collection of
8060phonetic encoding utilities.
8061
8062This is a part of the Apache Commons Project.")
8063 (license license:asl2.0)))
8064
8065(define-public java-commons-daemon
8066 (package
8067 (name "java-commons-daemon")
8068 (version "1.1.0")
8069 (source (origin
8070 (method url-fetch)
8071 (uri (string-append "mirror://apache/commons/daemon/source/"
8072 "commons-daemon-" version "-src.tar.gz"))
8073 (sha256
8074 (base32
8075 "141gkhfzv5v3pdhic6y4ardq2dhsa3v36j8wmmhy6f8mac48fp7n"))))
8076 (build-system ant-build-system)
8077 (arguments
8078 `(#:test-target "test"
8079 #:phases
8080 (modify-phases %standard-phases
8081 (add-after 'build 'build-javadoc ant-build-javadoc)
8082 (replace 'install (install-jars "dist"))
8083 (add-after 'install 'install-doc (install-javadoc "dist/docs/api")))))
8084 (native-inputs
8085 (list java-junit))
8086 (home-page "https://commons.apache.org/daemon/")
8087 (synopsis "Library to launch Java applications as daemons")
8088 (description "The Daemon package from Apache Commons can be used to
8089implement Java applications which can be launched as daemons. For example the
8090program will be notified about a shutdown so that it can perform cleanup tasks
8091before its process of execution is destroyed by the operation system.
8092
8093This package contains the Java library. You will also need the actual binary
8094for your architecture which is provided by the jsvc package.
8095
8096This is a part of the Apache Commons Project.")
8097 (license license:asl2.0)))
8098
8099(define-public java-javaewah
8100 (package
8101 (name "java-javaewah")
8102 (version "1.1.6")
8103 (source (origin
8104 (method git-fetch)
8105 (uri (git-reference
8106 (url "https://github.com/lemire/javaewah/")
8107 (commit (string-append "JavaEWAH-" version))))
8108 (file-name (git-file-name name version))
8109 (sha256
8110 (base32
8111 "1m8qcb1py76v7avbjjrkvyy6fhr5dk2ywy73gbsxqry04gkm2nhw"))))
8112 (build-system ant-build-system)
8113 (arguments `(#:jar-name "javaewah.jar"))
8114 (inputs
8115 (list java-junit java-hamcrest-core))
8116 (home-page "https://github.com/lemire/javaewah")
8117 (synopsis "Compressed alternative to the Java @code{BitSet} class")
8118 (description "This is a word-aligned compressed variant of the Java
8119@code{Bitset} class. It provides both a 64-bit and a 32-bit RLE-like
8120compression scheme. It can be used to implement bitmap indexes.
8121
8122The goal of word-aligned compression is not to achieve the best compression,
8123but rather to improve query processing time. Hence, JavaEWAH tries to save CPU
8124cycles, maybe at the expense of storage. However, the EWAH scheme is always
8125more efficient storage-wise than an uncompressed bitmap (as implemented in the
8126@code{BitSet} class by Sun).")
8127 ;; GPL2.0 derivates are explicitly allowed.
8128 (license license:asl2.0)))
8129
8130(define-public java-slf4j-api
8131 (package
8132 (name "java-slf4j-api")
8133 (version "1.7.25")
8134 (source (origin
8135 (method git-fetch)
8136 (uri (git-reference
8137 (url "https://github.com/qos-ch/slf4j")
8138 (commit (string-append "v_" version))))
8139 (file-name (git-file-name name version))
8140 (sha256
8141 (base32
8142 "15n42zq3k1iyn752nwdcbs44hxns2rmxhglwjfr4np7lxx56apjl"))
8143 (modules '((guix build utils)))
8144 ;; Delete bundled jars.
8145 (snippet
8146 '(begin
8147 (for-each delete-file (find-files "." "\\.jar$"))
8148 #t))))
8149 (build-system ant-build-system)
8150 (arguments
8151 `(#:jar-name "slf4j-api.jar"
8152 #:source-dir "slf4j-api/src/main"
8153 #:test-dir "slf4j-api/src/test"
8154 #:phases
8155 (modify-phases %standard-phases
8156 (add-after 'build 'regenerate-jar
8157 (lambda _
8158 ;; pom.xml ignores these files in the jar creation process. If we don't,
8159 ;; we get the error "This code should have never made it into slf4j-api.jar"
8160 (delete-file-recursively "build/classes/org/slf4j/impl")
8161 (invoke "jar" "-cf" "build/jar/slf4j-api.jar" "-C"
8162 "build/classes" ".")))
8163 (add-before 'check 'dont-test-abstract-classes
8164 (lambda _
8165 ;; abstract classes are not meant to be run with junit
8166 (substitute* "build.xml"
8167 (("<include name=\"\\*\\*/\\*Test.java\" />")
8168 (string-append "<include name=\"**/*Test.java\" />"
8169 "<exclude name=\"**/MultithreadedInitializationTest"
8170 ".java\" />")))
8171 #t))
8172 (replace 'install
8173 (install-from-pom "slf4j-api/pom.xml")))))
8174 (propagated-inputs
8175 (list java-slf4j-parent))
8176 (native-inputs
8177 (list java-junit java-hamcrest-core))
8178 (home-page "https://www.slf4j.org/")
8179 (synopsis "Simple logging facade for Java")
8180 (description "The Simple Logging Facade for Java (SLF4J) serves as a
8181simple facade or abstraction for various logging
8182frameworks (e.g. @code{java.util.logging}, @code{logback}, @code{log4j})
8183allowing the end user to plug in the desired logging framework at deployment
8184time.")
8185 (license license:expat)))
8186
8187(define java-slf4j-parent
8188 (package
8189 (inherit java-slf4j-api)
8190 (name "java-slf4j-parent")
8191 (native-inputs `())
8192 (propagated-inputs '())
8193 (arguments
8194 `(#:tests? #f
8195 #:phases
8196 (modify-phases %standard-phases
8197 (delete 'build)
8198 (delete 'configure)
8199 (replace 'install
8200 (install-pom-file "pom.xml")))))))
8201
8202(define-public java-slf4j-simple
8203 (package
8204 (name "java-slf4j-simple")
8205 (version "1.7.25")
8206 (source (package-source java-slf4j-api))
8207 (build-system ant-build-system)
8208 (arguments
8209 `(#:jar-name "slf4j-simple.jar"
8210 #:source-dir "slf4j-simple/src/main"
8211 #:test-dir "slf4j-simple/src/test"
8212 #:test-exclude (list "**/*SimpleLoggerMultithreadedInitializationTest.java")
8213 #:phases
8214 (modify-phases %standard-phases
8215 ;; The tests need some test classes from slf4j-api
8216 (add-before 'check 'build-slf4j-api-test-helpers
8217 (lambda _
8218 ;; Add current dir to CLASSPATH ...
8219 (setenv "CLASSPATH"
8220 (string-append (getcwd) ":" (getenv "CLASSPATH")))
8221 ;; ... and build test helper classes here:
8222 (apply invoke
8223 `("javac" "-d" "."
8224 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8225 (replace 'install
8226 (install-from-pom "slf4j-simple/pom.xml")))))
8227 (propagated-inputs
8228 (list java-slf4j-api))
8229 (native-inputs
8230 (list java-junit java-hamcrest-core))
8231 (home-page "https://www.slf4j.org/")
8232 (synopsis "Simple implementation of simple logging facade for Java")
8233 (description "SLF4J binding for the Simple implementation, which outputs
8234all events to System.err. Only messages of level INFO and higher are
8235printed.")
8236 (license license:expat)))
8237
8238(define-public java-slf4j-nop
8239 (package
8240 (name "java-slf4j-nop")
8241 (version "1.7.25")
8242 (source (package-source java-slf4j-api))
8243 (build-system ant-build-system)
8244 (arguments
8245 `(#:jar-name "slf4j-nop.jar"
8246 #:source-dir "slf4j-nop/src/main"
8247 #:test-dir "slf4j-nop/src/test"
8248 #:phases (modify-phases %standard-phases
8249 ;; The tests need some test classes from slf4j-api
8250 (add-before 'check 'build-slf4j-api-test-helpers
8251 (lambda _
8252 ;; Add current dir to CLASSPATH ...
8253 (setenv "CLASSPATH"
8254 (string-append (getcwd) ":"
8255 (getenv "CLASSPATH")))
8256 ;; ... and build test helper classes here:
8257 (apply invoke
8258 `("javac" "-d" "."
8259 ,@(find-files "slf4j-api/src/test" ".*\\.java")))))
8260 (replace 'install
8261 (install-from-pom "slf4j-nop/pom.xml")))))
8262 (propagated-inputs (list java-slf4j-api))
8263 (native-inputs (list java-junit java-hamcrest-core))
8264 (home-page "https://www.slf4j.org/")
8265 (synopsis "SLF4J binding that silently discards all logging messages")
8266 (description "Binding/provider for NOP, an implementation that silently
8267discards all logging messages.")
8268 (license license:expat)))
8269
8270(define-public antlr2
8271 (package
8272 (name "antlr2")
8273 (version "2.7.7")
8274 (source (origin
8275 (method url-fetch)
8276 (uri (string-append "https://www.antlr2.org/download/antlr-"
8277 version ".tar.gz"))
8278 (sha256
8279 (base32
8280 "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"))
8281 (modules '((guix build utils)))
8282 (snippet
8283 '(begin
8284 (delete-file "antlr.jar")
8285 (substitute* "lib/cpp/antlr/CharScanner.hpp"
8286 (("#include <map>")
8287 (string-append
8288 "#include <map>\n"
8289 "#define EOF (-1)\n"
8290 "#include <strings.h>")))
8291 (substitute* "configure"
8292 (("/bin/sh") "sh"))
8293 #t))))
8294 (build-system gnu-build-system)
8295 (arguments
8296 `(#:tests? #f ; no test target
8297 #:imported-modules ((guix build ant-build-system)
8298 ,@%default-gnu-imported-modules)
8299 #:modules (((guix build ant-build-system) #:prefix ant:)
8300 (guix build gnu-build-system)
8301 (guix build utils))
8302 #:phases
8303 (modify-phases %standard-phases
8304 (add-after 'install 'strip-jar-timestamps
8305 (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
8306 (add-before 'configure 'fix-timestamp
8307 (lambda _
8308 (substitute* "configure"
8309 (("^TIMESTAMP.*") "TIMESTAMP=19700101\n"))
8310 #t))
8311 (add-after 'configure 'fix-bin-ls
8312 (lambda _
8313 (substitute* (find-files "." "Makefile")
8314 (("/bin/ls") "ls"))
8315 #t)))))
8316 (native-inputs
8317 `(("which" ,which)
8318 ("zip" ,zip)
8319 ("java" ,icedtea "jdk")))
8320 (inputs
8321 `(("java" ,icedtea)))
8322 (home-page "https://www.antlr2.org")
8323 (synopsis "Framework for constructing recognizers, compilers, and translators")
8324 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8325is a language tool that provides a framework for constructing recognizers,
8326compilers, and translators from grammatical descriptions containing Java, C#,
8327C++, or Python actions. ANTLR provides excellent support for tree construction,
8328tree walking, and translation.")
8329 (license license:public-domain)))
8330
8331(define-public java-stringtemplate-3
8332 (package
8333 (name "java-stringtemplate")
8334 (version "3.2.1")
8335 (source (origin
8336 (method url-fetch)
8337 (uri (string-append "https://github.com/antlr/website-st4/raw/"
8338 "gh-pages/download/stringtemplate-"
8339 version ".tar.gz"))
8340 (sha256
8341 (base32
8342 "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is"))))
8343 (build-system ant-build-system)
8344 (arguments
8345 `(#:jar-name (string-append ,name "-" ,version ".jar")
8346 #:test-dir "test"
8347 #:modules ((guix build ant-build-system)
8348 (guix build utils)
8349 (srfi srfi-1))
8350 #:phases
8351 (modify-phases %standard-phases
8352 (add-before 'check 'fix-tests
8353 (lambda _
8354 (substitute* "build.xml"
8355 (("\\$\\{test.home\\}/java")
8356 "${test.home}/org"))
8357 #t))
8358 (add-before 'build 'generate-grammar
8359 (lambda _
8360 (with-directory-excursion "src/org/antlr/stringtemplate/language/"
8361 (for-each (lambda (file)
8362 (format #t "~a\n" file)
8363 (invoke "antlr" file))
8364 '("template.g" "angle.bracket.template.g" "action.g"
8365 "eval.g" "group.g" "interface.g")))
8366 #t)))))
8367 (native-inputs
8368 `(("antlr" ,antlr2)
8369 ("java-junit" ,java-junit)))
8370 (home-page "https://www.stringtemplate.org")
8371 (synopsis "Template engine to generate formatted text output")
8372 (description "StringTemplate is a java template engine (with ports for C#,
8373Objective-C, JavaScript, Scala) for generating source code, web pages, emails,
8374or any other formatted text output. StringTemplate is particularly good at
8375code generators, multiple site skins, and internationalization / localization.
8376StringTemplate also powers ANTLR.")
8377 (license license:bsd-3)))
8378
8379;; antlr3 is partially written using antlr3 grammar files. It also depends on
8380;; ST4 (stringtemplate4), which is also partially written using antlr3 grammar
8381;; files and uses antlr3 at runtime. The latest version requires a recent version
8382;; of antlr3 at runtime.
8383;; Fortunately, ST4 4.0.6 can be built with an older antlr3, and we use antlr3.3.
8384;; This version of ST4 is sufficient for the latest antlr3.
8385;; We use ST4 4.0.6 to build a boostrap antlr3 (latest version), and build
8386;; the latest ST4 with it. Then we build our final antlr3 that will be linked
8387;; against the latest ST4.
8388;; antlr3.3 still depends on antlr3 to generate some files, so we use an
8389;; even older version, antlr3.1, to generate them. Fortunately antlr3.1 uses
8390;; only grammar files with the antlr2 syntax.
8391;; So we build antlr3.1 -> antlr3.3 -> ST4.0.6 -> antlr3-bootstrap -> ST4 -> antlr3.
8392
8393(define-public java-stringtemplate
8394 (package (inherit java-stringtemplate-3)
8395 (name "java-stringtemplate")
8396 (version "4.0.8")
8397 (source (origin
8398 (method url-fetch)
8399 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/"
8400 version ".tar.gz"))
8401 (file-name (string-append name "-" version ".tar.gz"))
8402 (sha256
8403 (base32
8404 "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087"))))
8405 (build-system ant-build-system)
8406 (arguments
8407 `(#:jar-name (string-append ,name "-" ,version ".jar")
8408 #:tests? #f ; FIXME: tests fail for unknown reasons
8409 #:test-dir "test"
8410 #:modules ((guix build ant-build-system)
8411 (guix build utils)
8412 (srfi srfi-1))
8413 #:phases
8414 (modify-phases %standard-phases
8415 (add-before 'check 'fix-test-target
8416 (lambda _
8417 (substitute* "build.xml"
8418 (("\\$\\{test.home\\}/java") "${test.home}/")
8419 (("\\*Test.java") "Test*.java"))
8420 #t))
8421 (add-before 'build 'generate-grammar
8422 (lambda _
8423 (with-directory-excursion "src/org/stringtemplate/v4/compiler/"
8424 (for-each (lambda (file)
8425 (format #t "~a\n" file)
8426 (invoke "antlr3" file))
8427 '("STParser.g" "Group.g" "CodeGenerator.g")))
8428 #t)))))
8429 (inputs
8430 `(("antlr3" ,antlr3-bootstrap)
8431 ("antlr2" ,antlr2)
8432 ("java-stringtemplate" ,java-stringtemplate-3)
8433 ("java-junit" ,java-junit)))))
8434
8435(define java-stringtemplate-4.0.6
8436 (package (inherit java-stringtemplate)
8437 (name "java-stringtemplate")
8438 (version "4.0.6")
8439 (source (origin
8440 (method url-fetch)
8441 (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-"
8442 version ".tar.gz"))
8443 (file-name (string-append name "-" version ".tar.gz"))
8444 (sha256
8445 (base32
8446 "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp"))))
8447 (inputs
8448 `(("antlr3" ,antlr3-3.3)
8449 ("antlr2" ,antlr2)
8450 ("java-stringtemplate" ,java-stringtemplate-3)))))
8451
8452(define-public antlr3
8453 (package
8454 (name "antlr3")
8455 (version "3.5.2")
8456 (source (origin
8457 (method git-fetch)
8458 (uri (git-reference
8459 (url "https://github.com/antlr/antlr3")
8460 (commit version)))
8461 (file-name (git-file-name name version))
8462 (sha256
8463 (base32
8464 "0cafavrjmzqhklghrk8c2jqxkdwxgzskm20pbrfd3r41cn00dpnf"))))
8465 (build-system ant-build-system)
8466 (arguments
8467 `(#:jar-name (string-append ,name "-" ,version ".jar")
8468 #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3"
8469 #:tests? #f
8470 #:phases
8471 (modify-phases %standard-phases
8472 (add-after 'install 'bin-install
8473 (lambda* (#:key inputs outputs #:allow-other-keys)
8474 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8475 (bin (string-append (assoc-ref outputs "out") "/bin")))
8476 (mkdir-p bin)
8477 (with-output-to-file (string-append bin "/antlr3")
8478 (lambda _
8479 (display
8480 (string-append "#!" (which "sh") "\n"
8481 "java -cp " jar "/" ,name "-" ,version ".jar:"
8482 (string-concatenate
8483 (find-files (assoc-ref inputs "stringtemplate")
8484 ".*\\.jar"))
8485 ":"
8486 (string-concatenate
8487 (find-files (assoc-ref inputs "stringtemplate4")
8488 ".*\\.jar"))
8489 ":"
8490 (string-concatenate
8491 (find-files (string-append
8492 (assoc-ref inputs "antlr")
8493 "/lib")
8494 ".*\\.jar"))
8495 " org.antlr.Tool $*"))))
8496 (chmod (string-append bin "/antlr3") #o755))
8497 #t))
8498 (add-before 'build 'generate-grammar
8499 (lambda _
8500 (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/")
8501 (for-each (lambda (file)
8502 (display file)
8503 (newline)
8504 (invoke "antlr3" file))
8505 '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g"
8506 "AssignTokenTypesWalker.g"
8507 "ActionTranslator.g" "TreeToNFAConverter.g"
8508 "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g"
8509 "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g"))
8510 (substitute* "ANTLRParser.java"
8511 (("public Object getTree") "public GrammarAST getTree"))
8512 (substitute* "ANTLRv3Parser.java"
8513 (("public Object getTree") "public CommonTree getTree"))
8514 (chdir "../../../../../java")
8515 (substitute* "org/antlr/tool/LeftRecursiveRuleAnalyzer.java"
8516 (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*;
8517import org.antlr.grammar.v3.ANTLRTreePrinter;"))
8518 (substitute* "org/antlr/tool/ErrorManager.java"
8519 (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") ""))
8520 (chdir "../../../..")
8521 #t))
8522 (add-before 'build 'fix-build-xml
8523 (lambda _
8524 (substitute* "build.xml"
8525 (("target name=\"compile\">")
8526 "target name=\"compile\">
8527<copy todir=\"${classes.dir}\">
8528<fileset dir=\"tool/src/main/resources\">
8529<include name=\"**/*.stg\"/>
8530<include name=\"**/*.st\"/>
8531<include name=\"**/*.sti\"/>
8532<include name=\"**/STLexer.tokens\"/>
8533</fileset>
8534</copy>"))
8535 #t)))))
8536 (native-inputs
8537 `(("antlr" ,antlr2)
8538 ("antlr3" ,antlr3-bootstrap)))
8539 (inputs
8540 `(("junit" ,java-junit)
8541 ("stringtemplate" ,java-stringtemplate-3)
8542 ("stringtemplate4" ,java-stringtemplate)))
8543 (propagated-inputs
8544 `(("stringtemplate" ,java-stringtemplate-3)
8545 ("antlr" ,antlr2)
8546 ("stringtemplate4" ,java-stringtemplate-4.0.6)))
8547 (home-page "https://www.antlr3.org")
8548 (synopsis "Framework for constructing recognizers, compilers, and translators")
8549 (description "ANTLR, ANother Tool for Language Recognition, (formerly PCCTS)
8550is a language tool that provides a framework for constructing recognizers,
8551compilers, and translators from grammatical descriptions containing Java, C#,
8552C++, or Python actions. ANTLR provides excellent support for tree construction,
8553tree walking, and translation.")
8554 (license license:bsd-3)))
8555
8556(define antlr3-bootstrap
8557 (package
8558 (inherit antlr3)
8559 (name "antlr3-bootstrap")
8560 (native-inputs
8561 `(("antlr" ,antlr2)
8562 ("antlr3" ,antlr3-3.3)))
8563 (inputs
8564 `(("junit" ,java-junit)))))
8565
8566(define-public antlr3-3.3
8567 (package
8568 (inherit antlr3)
8569 (name "antlr3")
8570 (version "3.3")
8571 (source (origin
8572 (method url-fetch)
8573 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8574 "gh-pages/download/antlr-"
8575 version ".tar.gz"))
8576 (sha256
8577 (base32
8578 "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
8579 (patches
8580 (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
8581 (arguments
8582 `(#:jar-name (string-append ,name "-" ,version ".jar")
8583 #:source-dir (string-join '("tool/src/main/java"
8584 "runtime/Java/src/main/java"
8585 "tool/src/main/antlr2"
8586 "tool/src/main/antlr3")
8587 ":")
8588 #:tests? #f ; FIXME: tests seem to require maven plugin
8589 #:modules ((guix build ant-build-system)
8590 (guix build utils)
8591 (srfi srfi-1))
8592 #:phases
8593 (modify-phases %standard-phases
8594 (add-after 'install 'bin-install
8595 (lambda* (#:key inputs outputs #:allow-other-keys)
8596 (let* ((out (assoc-ref outputs "out"))
8597 (jar (string-append out "/share/java"))
8598 (bin (string-append out "/bin")))
8599 (mkdir-p bin)
8600 (with-output-to-file (string-append bin "/antlr3")
8601 (lambda _
8602 (display
8603 (string-append
8604 "#!" (which "sh") "\n"
8605 "java -cp " jar "/antlr3-3.3.jar:"
8606 (string-join
8607 (append (find-files (assoc-ref inputs "java-stringtemplate")
8608 ".*\\.jar$")
8609 (find-files (string-append (assoc-ref inputs "antlr")
8610 "/lib")
8611 ".*\\.jar$"))
8612 ":")
8613 " org.antlr.Tool $*"))))
8614 (chmod (string-append bin "/antlr3") #o755)
8615 #t)))
8616 (add-before 'build 'generate-grammar
8617 (lambda _
8618 (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java"
8619 (("import org.antlr.grammar.v2.\\*;")
8620 "import org.antlr.grammar.v2.*;\n
8621import org.antlr.grammar.v2.TreeToNFAConverter;\n
8622import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n
8623import org.antlr.grammar.v2.ANTLRTreePrinter;"))
8624 (with-directory-excursion "tool/src/main/antlr2/org/antlr/grammar/v2/"
8625 (for-each (lambda (file)
8626 (format #t "~a\n" file)
8627 (invoke "antlr" file))
8628 '("antlr.g" "antlr.print.g" "assign.types.g"
8629 "buildnfa.g" "codegen.g" "define.g")))
8630 (with-directory-excursion "tool/src/main/antlr3/org/antlr/grammar/v3/"
8631 (for-each (lambda (file)
8632 (format #t "~a\n" file)
8633 (invoke "antlr3" file))
8634 '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g"
8635 "ANTLRv3Tree.g")))
8636 #t))
8637 (add-before 'build 'fix-build-xml
8638 (lambda _
8639 (substitute* "build.xml"
8640 (("target name=\"compile\">")
8641 "target name=\"compile\">
8642<copy todir=\"${classes.dir}\">
8643<fileset dir=\"tool/src/main/resources\">
8644<include name=\"**/*.stg\"/>
8645<include name=\"**/*.st\"/>
8646<include name=\"**/*.sti\"/>
8647<include name=\"**/STLexer.tokens\"/>
8648</fileset>
8649</copy>"))
8650 #t)))))
8651 (native-inputs
8652 `(("antlr" ,antlr2)
8653 ("antlr3" ,antlr3-3.1)))
8654 (inputs
8655 `(("junit" ,java-junit)))
8656 (propagated-inputs
8657 `(("java-stringtemplate" ,java-stringtemplate-3)
8658 ("antlr" ,antlr2)))))
8659
8660(define-public antlr3-3.1
8661 (package
8662 (inherit antlr3)
8663 (version "3.1")
8664 (source (origin
8665 (method url-fetch)
8666 (uri (string-append "https://github.com/antlr/website-antlr3/raw/"
8667 "gh-pages/download/antlr-"
8668 version ".tar.gz"))
8669 (sha256
8670 (base32
8671 "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
8672 (patches
8673 (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
8674 (arguments
8675 `(#:jar-name (string-append "antlr3-" ,version ".jar")
8676 #:source-dir "src:runtime/Java/src"
8677 #:tests? #f
8678 #:phases
8679 (modify-phases %standard-phases
8680 (add-after 'install 'bin-install
8681 (lambda* (#:key inputs outputs #:allow-other-keys)
8682 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8683 (bin (string-append (assoc-ref outputs "out") "/bin")))
8684 (mkdir-p bin)
8685 (with-output-to-file (string-append bin "/antlr3")
8686 (lambda _
8687 (display
8688 (string-append "#!" (which "sh") "\n"
8689 "java -cp " jar "/antlr3-3.1.jar:"
8690 (string-concatenate
8691 (find-files (assoc-ref inputs "stringtemplate")
8692 ".*\\.jar"))
8693 ":"
8694 (string-concatenate
8695 (find-files (string-append
8696 (assoc-ref inputs "antlr")
8697 "/lib")
8698 ".*\\.jar"))
8699 " org.antlr.Tool $*"))))
8700 (chmod (string-append bin "/antlr3") #o755))
8701 #t))
8702 (add-before 'build 'generate-grammar
8703 (lambda _
8704 (let ((dir "src/org/antlr/tool/"))
8705 (for-each (lambda (file)
8706 (display file)
8707 (newline)
8708 (invoke "antlr" "-o" dir (string-append dir file)))
8709 '("antlr.g" "antlr.print.g" "assign.types.g"
8710 "buildnfa.g" "define.g")))
8711 (format #t "codegen.g\n")
8712 (invoke "antlr" "-o" "src/org/antlr/codegen"
8713 "src/org/antlr/codegen/codegen.g")
8714 #t))
8715 (add-before 'build 'fix-build-xml
8716 (lambda _
8717 (substitute* "build.xml"
8718 (("target name=\"compile\">")
8719 "target name=\"compile\">
8720<copy todir=\"${classes.dir}\">
8721<fileset dir=\"src\">
8722<include name=\"**/*.stg\"/>
8723<include name=\"**/*.st\"/>
8724<include name=\"**/*.sti\"/>
8725<include name=\"**/STLexer.tokens\"/>
8726</fileset>
8727</copy>"))
8728 #t)))))
8729 (native-inputs
8730 `(("antlr" ,antlr2)))
8731 (inputs
8732 `(("junit" ,java-junit)))
8733 (propagated-inputs
8734 `(("stringtemplate" ,java-stringtemplate-3)))))
8735
8736(define-public java-treelayout
8737 (package
8738 (name "java-treelayout")
8739 (version "1.0.3")
8740 (source (origin
8741 (method git-fetch)
8742 (uri (git-reference
8743 (url "https://github.com/abego/treelayout")
8744 (commit (string-append "v" version))))
8745 (file-name (git-file-name name version))
8746 (sha256
8747 (base32
8748 "18my8ql9b1y0n0zrvkih7xfhf3dpgfhyfifvkcfhmwcvw3divxak"))))
8749 (build-system ant-build-system)
8750 (arguments
8751 `(#:jar-name (string-append ,name "-" ,version ".jar")
8752 #:source-dir "org.abego.treelayout/src/main/java"
8753 #:test-dir "org.abego.treelayout/src/test"))
8754 (inputs
8755 (list java-junit))
8756 (native-inputs
8757 (list java-hamcrest-core))
8758 (home-page "https://treelayout.sourceforge.net")
8759 (synopsis "Tree Layout Algorithm in Java")
8760 (description "TreeLayout creates tree layouts for arbitrary trees. It is
8761not restricted to a specific output or format, but can be used for any kind of
8762two dimensional diagram. Examples are Swing based components, SVG files, etc.
8763This is possible because TreeLayout separates the layout of a tree from the
8764actual rendering.")
8765 (license license:bsd-3)))
8766
8767(define-public java-antlr4-runtime
8768 (package
8769 (name "java-antlr4-runtime")
8770 (version "4.10.1")
8771 (source (origin
8772 (method git-fetch)
8773 (uri (git-reference
8774 (url "https://github.com/antlr/antlr4")
8775 (commit version)))
8776 (file-name (git-file-name name version))
8777 (sha256
8778 (base32
8779 "0ldvd9jm4nrivaw7i7wh1q40q6xgzmzirsywiakbhg8sppagqlv7"))
8780 (patches
8781 (search-patches "java-antlr4-Add-standalone-generator.patch"))))
8782 (build-system ant-build-system)
8783 (arguments
8784 `(#:jar-name "java-antlr4-runtime.jar"
8785 #:source-dir "runtime/Java/src/org"
8786 #:tests? #f; tests depend on java-antlr4 itself
8787 #:phases
8788 (modify-phases %standard-phases
8789 (add-before 'build 'copy-resources
8790 (lambda _
8791 (copy-recursively "runtime/Java/src/main/dot"
8792 "build/classes")
8793 #t)))))
8794 (home-page "https://www.antlr.org")
8795 (synopsis "ANTLR runtime library")
8796 (description "This package contains the runtime library used with generated
8797sources by ANTLR.")
8798 (license license:bsd-3)))
8799
8800(define-public java-antlr4-runtime-cpp
8801 (package
8802 (inherit java-antlr4-runtime)
8803 (name "java-antlr4-runtime-cpp")
8804 (outputs '("out" "static"))
8805 (build-system cmake-build-system)
8806 (arguments
8807 (list
8808 ;; TODO: try to run the tests under
8809 ;; runtime-testsuite/test/org/antlr/v4/test/runtime/cpp with antlr4.
8810 #:tests? #f ;no CMake test target
8811 ;; TODO: Building the tests wants to download googletest.
8812 #:configure-flags #~'("-DANTLR_BUILD_CPP_TESTS=OFF")
8813 #:phases
8814 #~(modify-phases %standard-phases
8815 (add-after 'unpack 'chdir
8816 (lambda _
8817 (chdir "runtime/Cpp")))
8818 (add-after 'install 'move-static-library
8819 (lambda* (#:key outputs #:allow-other-keys)
8820 (let ((static (assoc-ref outputs "static"))
8821 (libantlr4-runtime.a (search-input-file
8822 outputs "lib/libantlr4-runtime.a")))
8823 (mkdir-p (string-append static "/lib"))
8824 (rename-file
8825 libantlr4-runtime.a
8826 (string-append static "/lib/"
8827 (basename libantlr4-runtime.a)))))))))
8828 (native-inputs (list pkg-config))
8829 (inputs (list `(,util-linux "lib"))) ;libuuid
8830 (synopsis "ANTL C++ runtime library")
8831 (description "This package contains the C++ runtime library used with C++
8832generated sources by ANTLR.")))
8833
8834(define-public java-antlr4-runtime-python
8835 (package
8836 (inherit java-antlr4-runtime)
8837 (name "java-antlr4-runtime-python")
8838 (outputs '("out"))
8839 (build-system python-build-system)
8840 (arguments
8841 (list
8842 #:tests? #f ; tests require antlr
8843 #:phases
8844 #~(modify-phases %standard-phases
8845 (add-after 'unpack 'chdir
8846 (lambda _
8847 (chdir "runtime/Python3"))))))
8848 (native-inputs (list pkg-config))
8849 (inputs (list `(,util-linux "lib"))) ; libuuid
8850 (synopsis "ANTLR Python runtime library")
8851 (description "This package contains the Python runtime library used with
8852Python generated sources by ANTLR.")))
8853
8854(define-public antlr4
8855 (package
8856 (inherit java-antlr4-runtime)
8857 (name "antlr4")
8858 (arguments
8859 `(#:jar-name "antlr4.jar"
8860 #:source-dir "tool/src"
8861 #:test-dir "tool-testsuite/test:runtime-testsuite/test"
8862 #:test-include (list "**/Test*.java")
8863 #:test-exclude (list
8864 ;; These have no runnable methods and fail because
8865 ;; test-include above is too broad.
8866 "**/TestContext.java"
8867 "**/TestOutputReading.java"
8868 ;; no @Test methods
8869 "**/TestParserErrors.java"
8870 "**/TestSemPredEvalParser.java"
8871 "**/TestSets.java"
8872 "**/TestListeners.java"
8873 "**/TestParseTrees.java"
8874 "**/TestParserExec.java"
8875 "**/TestLexerErrors.java"
8876 "**/TestPerformance.java"
8877 "**/TestCompositeParsers.java"
8878 "**/TestLexerExec.java"
8879 "**/TestSemPredEvalLexer.java"
8880 "**/TestLeftRecursion.java"
8881 "**/TestFullContextParsing.java"
8882 "**/TestCompositeLexers.java"
8883 ;; Null pointer exception
8884 "**/TestCompositeGrammars.java")
8885 #:phases
8886 (modify-phases %standard-phases
8887 (add-before 'build 'fix-build.xml
8888 (lambda _
8889 ;; tests are not in a java subdirectory
8890 (substitute* "build.xml"
8891 (("\\$\\{test.home\\}/java") "${test.home}"))
8892 #t))
8893 ;; tests require to have a working antlr4 binary
8894 (delete 'check)
8895 (add-after 'install 'check
8896 (lambda _
8897 (invoke "ant" "compile-tests")
8898 (invoke "ant" "check" "-Dtest.home=runtime-testsuite/test")
8899 (invoke "ant" "check" "-Dtest.home=tool-testsuite/test")
8900 #t))
8901 (add-before 'check 'remove-unrelated-languages
8902 (lambda _
8903 ;; There are tests for other languages that ANTLR can generate, but
8904 ;; we don't have the infrastructure for that yet. Let's test Java
8905 ;; generation only.
8906 (for-each
8907 (lambda (language)
8908 (delete-file-recursively
8909 (string-append "runtime-testsuite/test/org/antlr/v4/test/runtime/"
8910 language)))
8911 '("cpp" "csharp" "go" "javascript" "php" "python" "python2"
8912 "python3" "swift"))
8913 #t))
8914 (add-before 'check 'generate-test-parsers
8915 (lambda* (#:key outputs #:allow-other-keys)
8916 (define (run-antlr dir filename package)
8917 (invoke "antlr4" "-lib" dir "-visitor" "-no-listener"
8918 "-package" package (string-append dir "/" filename)
8919 "-Xlog"))
8920 (setenv "PATH" (string-append (getenv "PATH") ":"
8921 (assoc-ref outputs "out") "/bin"))
8922 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8923 "Java.g4" "org.antlr.v4.test.runtime.java.api")
8924 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8925 "VisitorBasic.g4" "org.antlr.v4.test.runtime.java.api")
8926 (run-antlr "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api"
8927 "VisitorCalc.g4" "org.antlr.v4.test.runtime.java.api")
8928 #t))
8929 (add-before 'check 'remove-graphemes
8930 (lambda _
8931 ;; When running antlr on grahemes.g4, we get a runtime exception:
8932 ;; set is empty. So delete the file that depends on it.
8933 (delete-file
8934 "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")
8935 #t))
8936 (add-after 'install 'bin-install
8937 (lambda* (#:key inputs outputs #:allow-other-keys)
8938 (let ((jar (string-append (assoc-ref outputs "out") "/share/java"))
8939 (bin (string-append (assoc-ref outputs "out") "/bin")))
8940 (mkdir-p bin)
8941 (with-output-to-file (string-append bin "/antlr4")
8942 (lambda _
8943 (display
8944 (string-append "#!" (which "sh") "\n"
8945 "java -cp " jar "/antlr4.jar:"
8946 (string-join
8947 (apply
8948 append
8949 (map
8950 (lambda (input)
8951 (find-files (assoc-ref inputs input)
8952 ".*\\.jar"))
8953 '("antlr3" "java-stringtemplate"
8954 "java-antlr4-runtime" "java-treelayout"
8955 "java-jsonp-api" "java-icu4j")))
8956 ":")
8957 " org.antlr.v4.Tool $*"))))
8958 (chmod (string-append bin "/antlr4") #o755)
8959 #t)))
8960 (add-before 'build 'copy-resources
8961 (lambda _
8962 (copy-recursively "tool/resources/" "build/classes")
8963 #t))
8964 (add-before 'build 'generate-unicode
8965 (lambda _
8966 ;; First: build the generator
8967 (invoke "javac" "-cp" (getenv "CLASSPATH")
8968 "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
8969 "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
8970 ;; Then use it
8971 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
8972 ":tool/src:runtime/Java")
8973 "org.antlr.v4.unicode.UnicodeRenderer"
8974 "tool/resources/org/antlr/v4/tool/templates"
8975 "unicodedata"
8976 "tool/src/org/antlr/v4/unicode/UnicodeData.java")
8977 ;; It seems there is a bug with our ST4
8978 (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
8979 (("\\\\>") ">"))
8980 ;; Remove the additional file
8981 (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
8982 #t))
8983 (add-before 'build 'generate-grammar
8984 (lambda* (#:key inputs #:allow-other-keys)
8985 (with-directory-excursion "tool/src/org/antlr/v4/parse"
8986 (for-each (lambda (file)
8987 (display file)
8988 (newline)
8989 (invoke "antlr3" file))
8990 '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
8991 "GrammarTreeVisitor.g" "ATNBuilder.g"
8992 "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
8993 (with-directory-excursion "tool/src/org/antlr/v4/codegen"
8994 (install-file "../parse/ANTLRParser.tokens" ".")
8995 (display "SourceGenTriggers.g\n")
8996 (invoke "antlr3" "SourceGenTriggers.g"))
8997 #t)))))
8998 (inputs
8999 (list antlr3
9000 java-antlr4-runtime
9001 java-icu4j
9002 java-jsonp-api
9003 java-stringtemplate
9004 java-treelayout))
9005 (native-inputs
9006 (list java-junit))
9007 (synopsis "Parser and lexer generator in Java")
9008 (description "ANTLR (ANother Tool for Language Recognition) is a powerful
9009parser generator for reading, processing, executing, or translating structured
9010text or binary files. It's widely used to build languages, tools, and
9011frameworks. From a grammar, ANTLR generates a parser that can build and walk
9012parse trees.")))
9013
9014(define-public java-antlr4-runtime-4.1
9015 (package
9016 (inherit java-antlr4-runtime)
9017 (version "4.1")
9018 (source (origin
9019 (method git-fetch)
9020 (uri (git-reference
9021 (url "https://github.com/antlr/antlr4")
9022 (commit version)))
9023 (file-name (git-file-name "antlr4" version))
9024 (sha256
9025 (base32
9026 "1i8hmx5an58cjyvhji0xgpvd6lq00z1k1mjys025q2wqc25wv4c1"))))
9027 (arguments
9028 (substitute-keyword-arguments (package-arguments java-antlr4-runtime)
9029 ((#:phases phases)
9030 `(modify-phases ,phases
9031 (add-before 'configure 'chmod
9032 (lambda _
9033 (chmod "build.xml" #o644)
9034 #t))))))
9035 (inputs
9036 (list java-treelayout))))
9037
9038(define-public antlr4-4.1
9039 (package
9040 (inherit antlr4)
9041 (version (package-version java-antlr4-runtime-4.1))
9042 (source (package-source java-antlr4-runtime-4.1))
9043 (arguments
9044 (substitute-keyword-arguments (package-arguments antlr4)
9045 ((#:test-dir _)
9046 "tool/test")
9047 ((#:test-exclude excludes)
9048 `(list "**/TestParseErrors.java"
9049 "**/TestTopologicalSort.java"
9050 ,@excludes))
9051 ((#:phases phases)
9052 `(modify-phases ,phases
9053 (delete 'generate-unicode)
9054 (replace 'check
9055 (lambda _
9056 (invoke "ant" "check")
9057 #t))
9058 (add-before 'configure 'chmod
9059 (lambda _
9060 (chmod "build.xml" #o644)
9061 #t))
9062 (delete 'remove-graphemes)
9063 (delete 'remove-unrelated-languages)
9064 (delete 'generate-test-parsers)))))
9065 (inputs
9066 (alist-replace
9067 "java-antlr4-runtime" (list java-antlr4-runtime-4.1)
9068 (package-inputs antlr4)))))
9069
9070(define-public java-tunnelvisionlabs-antlr4-runtime-annotations
9071 (package
9072 (inherit java-antlr4-runtime)
9073 (name "java-tunnelvisionlabs-antlr4-runtime-annotations")
9074 (version "4.7.4")
9075 (source (origin
9076 (method git-fetch)
9077 (uri (git-reference
9078 (url "https://github.com/tunnelvisionlabs/antlr4")
9079 (commit (string-append version "-opt"))))
9080 (file-name (git-file-name "java-tunnelvisionlabs-antlr4" version))
9081 (sha256
9082 (base32
9083 "1mf2lvvsszpialsk23ma83pwp50nd32lrbjpa847zlm5gmranbr8"))
9084 (patches
9085 (search-patches "java-antlr4-Add-standalone-generator.patch"
9086 "java-tunnelvisionlabs-antlr-code-too-large.patch"))))
9087 (arguments
9088 `(#:jar-name "java-antlr4-runtime-annotations.jar"
9089 #:source-dir "runtime/JavaAnnotations/src"
9090 #:tests? #f; no tests
9091 #:phases
9092 (modify-phases %standard-phases
9093 (add-after 'build 'copy-resources
9094 (lambda _
9095 (copy-recursively "runtime/JavaAnnotations/resources"
9096 "build/classes")
9097 #t))
9098 (add-after 'copy-resources 'rebuild-jar
9099 (lambda _
9100 (invoke "ant" "jar")
9101 #t)))))
9102 (inputs '())
9103 (native-inputs '())
9104 (synopsis "Annotations for ANTLR's runtime library")
9105 (description "This package contains annotations used during the build of
9106the runtime library of ANTLR.")))
9107
9108;; the runtime of this library requires a lexer that is generated by antlr4.
9109;; However, antlr4 itself requires this library at build and run-time. We
9110;; use [email protected], the closest version of antlr that doesn't need this
9111;; bootstrap process, to generate the lexer. The generated lexer is built
9112;; for the 4.1 runtime, which is slightly different from this runtime.
9113;; So, we build the runtime with antlr 4.1, with a broken xml lexer, that we
9114;; use to build antlr4. We then re-use this antlr4 to build the runtime, and
9115;; the proper, working, runtime to build antlr4 again.
9116(define java-tunnelvisionlabs-antlr4-runtime-bootstrap
9117 (package
9118 (inherit java-antlr4-runtime)
9119 (name "java-tunnelvisionlabs-antlr4-runtime")
9120 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9121 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9122 (arguments
9123 `(#:jar-name "java-antlr4-runtime.jar"
9124 #:source-dir "runtime/Java/src"
9125 #:tests? #f; tests require antlr4, but antlr4 depends on this package
9126 #:phases
9127 (modify-phases %standard-phases
9128 (add-before 'build 'generate-xpath-lexer
9129 (lambda _
9130 (invoke "antlr4" "-lib" "runtime/Java/src/org/antlr/v4/runtime/tree/xpath"
9131 "-visitor" "-no-listener"
9132 "-package" "org.antlr.v4.runtime.tree.xpath"
9133 "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.g4")
9134 ;; Generated code is for an incompatible version of the runtime
9135 (substitute* "runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPathLexer.java"
9136 (("LexerATNSimulator\\(this,_ATN,_decisionToDFA,_sharedContextCache\\)")
9137 "LexerATNSimulator(this,_ATN)"))
9138 #t))
9139 (add-before 'build 'copy-resources
9140 (lambda _
9141 (copy-recursively "runtime/Java/src/main/dot"
9142 "build/classes")
9143 #t)))))
9144 (native-inputs
9145 `(("antlr4" ,antlr4-4.1)
9146 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9147 ,java-tunnelvisionlabs-antlr4-runtime-annotations)))))
9148
9149(define java-tunnelvisionlabs-antlr4-bootstrap
9150 (package
9151 (inherit antlr4)
9152 (name "java-tunnelvisionlabs-antlr4")
9153 (version (package-version java-tunnelvisionlabs-antlr4-runtime-annotations))
9154 (source (package-source java-tunnelvisionlabs-antlr4-runtime-annotations))
9155 (arguments
9156 (substitute-keyword-arguments (package-arguments antlr4)
9157 ((#:test-dir _)
9158 "tool/test:runtime-testsuite/src")
9159 ((#:phases phases)
9160 `(modify-phases ,phases
9161 (delete 'remove-unrelated-languages)
9162 (delete 'remove-graphemes)
9163 (delete 'generate-test-parsers)
9164 (delete 'check)))))
9165 (native-inputs '())
9166 (inputs
9167 `(("antlr3" ,antlr3)
9168 ("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9169 ("java-tunnelvisionlabs-antlr4-runtime-annotations"
9170 ,java-tunnelvisionlabs-antlr4-runtime-annotations)
9171 ("java-icu4j" ,java-icu4j)
9172 ("java-jsonp-api" ,java-jsonp-api)
9173 ("java-stringtemplate" ,java-stringtemplate)
9174 ("java-treelayout" ,java-treelayout)))))
9175
9176(define-public java-tunnelvisionlabs-antlr4-runtime
9177 (package
9178 (inherit java-tunnelvisionlabs-antlr4-runtime-bootstrap)
9179 (native-inputs
9180 (alist-replace
9181 "antlr4" (list java-tunnelvisionlabs-antlr4-bootstrap)
9182 (package-native-inputs java-tunnelvisionlabs-antlr4-runtime-bootstrap)))))
9183
9184(define-public java-tunnelvisionlabs-antlr4
9185 (package
9186 (inherit java-tunnelvisionlabs-antlr4-bootstrap)
9187 (inputs
9188 (alist-replace
9189 "java-antlr4-runtime" (list java-tunnelvisionlabs-antlr4-runtime)
9190 (package-inputs java-tunnelvisionlabs-antlr4-bootstrap)))))
9191
9192(define-public java-commons-cli-1.2
9193 ;; This is a bootstrap dependency for Maven2.
9194 (package
9195 (inherit java-commons-cli)
9196 (version "1.2")
9197 (source (origin
9198 (method url-fetch)
9199 (uri (string-append "mirror://apache/commons/cli/source/"
9200 "commons-cli-" version "-src.tar.gz"))
9201 (sha256
9202 (base32
9203 "0rvfgzgv2pc1m091dfj3ih9ddsjjppr1f1wf0qmc3bk6b1kwv2dm"))))
9204 (arguments
9205 `(#:jar-name "commons-cli.jar"
9206 #:phases
9207 (modify-phases %standard-phases
9208 (add-before 'check 'fix-build-xml
9209 (lambda* (#:key inputs #:allow-other-keys)
9210 (substitute* "build.xml"
9211 (("dir=\"\\$\\{test.home\\}/java\"")
9212 "dir=\"${test.home}\""))
9213 #t)))))
9214 (native-inputs
9215 (list java-junit))))
9216
9217(define-public java-microemulator-cldc
9218 (package
9219 (name "java-microemulator-cldc")
9220 (version "2.0.4")
9221 (source (origin
9222 (method url-fetch)
9223 (uri (string-append "https://github.com/barteo/microemu/archive/"
9224 "microemulator_"
9225 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
9226 version)
9227 ".tar.gz"))
9228 (file-name (string-append name "-" version ".tar.gz"))
9229 (sha256
9230 (base32
9231 "1x1apmz38gkppxnwnygwmi12j54v4p258v8ddzn6dldkk7vak1ll"))))
9232 (build-system ant-build-system)
9233 (arguments
9234 `(#:jar-name "microemulator-cldc.jar"
9235 #:source-dir "microemu-cldc/src/main/java"
9236 #:tests? #f)); Requires even older software
9237 (home-page "https://github.com/barteo/microemu")
9238 (synopsis "J2ME CLDC emulator")
9239 (description "Microemulator is a Java 2 Micro Edition (J2ME) CLDC/MIDP
9240Emulator. It demonstrates MIDlet based applications in web browser
9241applet and can be run as a standalone java application.")
9242 (license (list license:asl2.0
9243 ;; or altenatively:
9244 license:lgpl2.1+))))
9245
9246(define-public java-datanucleus-javax-persistence
9247 (package
9248 (name "java-datanucleus-javax-persistence")
9249 (version "2.2.0")
9250 (source (origin
9251 (method url-fetch)
9252 (uri (string-append "https://github.com/datanucleus/"
9253 "javax.persistence/archive/javax.persistence-"
9254 version "-release.tar.gz"))
9255 (sha256
9256 (base32
9257 "11jx0fjwgc2hhbqqgdd6m1pf2fplf9vslppygax0y1z5csnqjhpx"))))
9258 (build-system ant-build-system)
9259 (arguments
9260 `(#:jar-name "java-datanucleus-javax-persistence.jar"
9261 #:jdk ,icedtea-8
9262 #:source-dir "src/main/java"
9263 #:tests? #f)); no tests
9264 (home-page "https://github.com/datanucleus/javax.persistence")
9265 (synopsis "JPA API")
9266 (description "This package contains a clean definition of JPA API intended
9267for use with DataNucleus JPA since the JCP haven't provided an official JPA API
9268jar. See @url{http://java.net/projects/jpa-spec/downloads} for the specification
9269used to generate this API.")
9270 (license (list license:edl1.0 license:epl1.0))))
9271
9272(define-public java-osgi-cmpn
9273 (package
9274 (name "java-osgi-cmpn")
9275 (version "6.0.0")
9276 (source (origin
9277 (method url-fetch)
9278 (uri (string-append "https://repo1.maven.org/maven2/"
9279 "org/osgi/osgi.cmpn/" version "/osgi.cmpn-"
9280 version "-sources.jar"))
9281 (sha256
9282 (base32
9283 "1lmb6xyrmkqdhv1kayf0514rlwq6ypvs4m44ibrck3snp8241wys"))))
9284 (build-system ant-build-system)
9285 (arguments
9286 `(#:jar-name "osgi-cmpn.jar"
9287 #:tests? #f)); no tests
9288 (inputs
9289 `(("annotation" ,java-osgi-annotation)
9290 ("core" ,java-osgi-core)
9291 ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence)
9292 ("microemulator" ,java-microemulator-cldc)
9293 ("servlet" ,java-classpathx-servletapi)))
9294 (home-page "https://www.osgi.org")
9295 (synopsis "Compendium specification module of OSGi framework")
9296 (description
9297 "OSGi, for Open Services Gateway initiative framework, is a module system
9298and service platform for the Java programming language. This package contains
9299the compendium specification module, providing interfaces and classes for use
9300in compiling bundles.")
9301 (license license:asl2.0)))
9302
9303(define-public java-osgi-service-component-annotations
9304 (package
9305 (name "java-osgi-service-component-annotations")
9306 (version "1.3.0")
9307 (source (origin
9308 (method url-fetch)
9309 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9310 "org.osgi.service.component.annotations/"
9311 version "/org.osgi.service.component.annotations-"
9312 version "-sources.jar"))
9313 (sha256
9314 (base32
9315 "15rq9cmp4fpn74q44m4j35qsqmjf5lx3hcrk6pzvbhc08igic2f0"))))
9316 (build-system ant-build-system)
9317 (arguments
9318 `(#:jar-name "osgi-service-component-annotations.jar"
9319 #:tests? #f)); no tests
9320 (inputs
9321 `(("annotation" ,java-osgi-annotation)))
9322 (home-page "https://www.osgi.org")
9323 (synopsis "Support annotations for osgi-service-component")
9324 (description
9325 "OSGi, for Open Services Gateway initiative framework, is a module system
9326and service platform for the Java programming language. This package contains
9327the support annotations for osgi-service-component.")
9328 (license license:asl2.0)))
9329
9330(define-public java-osgi-dto
9331 (package
9332 (name "java-osgi-dto")
9333 (version "1.0.0")
9334 (source (origin
9335 (method url-fetch)
9336 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9337 "org.osgi.dto/" version "/org.osgi.dto-"
9338 version "-sources.jar"))
9339 (sha256
9340 (base32
9341 "0f4bqjzadn0hwk6sd3h5gvbyfp3yci1s6r0v770cc15p0pg627yr"))))
9342 (build-system ant-build-system)
9343 (arguments
9344 `(#:jar-name "osgi-dto.jar"
9345 #:tests? #f)); no tests
9346 (inputs
9347 `(("annotation" ,java-osgi-annotation)))
9348 (home-page "https://www.osgi.org")
9349 (synopsis "Data Transfer Objects")
9350 (description
9351 "OSGi, for Open Services Gateway initiative framework, is a module system
9352and service platform for the Java programming language. This package contains
9353the Data Transfer Objects. It is easily serializable having only public fields
9354of primitive types and their wrapper classes, Strings, and DTOs. List, Set,
9355Map and array aggregates may also be used. The aggregates must only hold
9356objects of the listed types or aggregates.")
9357 (license license:asl2.0)))
9358
9359(define-public java-osgi-resource
9360 (package
9361 (name "java-osgi-resource")
9362 (version "1.0.0")
9363 (source (origin
9364 (method url-fetch)
9365 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9366 "org.osgi.resource/"
9367 version "/org.osgi.resource-"
9368 version "-sources.jar"))
9369 (sha256
9370 (base32
9371 "0hi0fsc5v99q22bd7lrkvpz1y0ds4w9arjldpwsrcpqvz2js7q2d"))))
9372 (build-system ant-build-system)
9373 (arguments
9374 `(#:jar-name "osgi-resource.jar"
9375 #:tests? #f)); no tests
9376 (inputs
9377 `(("annotation" ,java-osgi-annotation)
9378 ("dto" ,java-osgi-dto)))
9379 (home-page "https://www.osgi.org")
9380 (synopsis "OSGI Resource")
9381 (description
9382 "OSGi, for Open Services Gateway initiative framework, is a module system
9383and service platform for the Java programming language. This package contains
9384the definition of common types in osgi packages.")
9385 (license license:asl2.0)))
9386
9387(define-public java-osgi-namespace-contract
9388 (package
9389 (name "java-osgi-namespace-contract")
9390 (version "1.0.0")
9391 (source (origin
9392 (method url-fetch)
9393 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9394 "org.osgi.namespace.contract/"
9395 version "/org.osgi.namespace.contract-"
9396 version "-sources.jar"))
9397 (sha256
9398 (base32
9399 "1iz4f2i0fvqrlq90ki9nfzcfpvy2av434ri25bglywqssx8mmp36"))))
9400 (build-system ant-build-system)
9401 (inputs
9402 `(("resource" ,java-osgi-resource)
9403 ("annotation" ,java-osgi-annotation)))
9404 (arguments
9405 `(#:jar-name "osgi-namespace-contract.jar"
9406 #:tests? #f)); no tests
9407 (home-page "https://www.osgi.org")
9408 (synopsis "Contract Capability and Requirement Namespace")
9409 (description
9410 "OSGi, for Open Services Gateway initiative framework, is a module system
9411and service platform for the Java programming language. This package contains
9412the names for the attributes and directives for a namespace with contracts.")
9413 (license license:asl2.0)))
9414
9415(define-public java-osgi-namespace-extender
9416 (package
9417 (name "java-osgi-namespace-extender")
9418 (version "1.0.1")
9419 (source (origin
9420 (method url-fetch)
9421 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9422 "org.osgi.namespace.extender/"
9423 version "/org.osgi.namespace.extender-"
9424 version "-sources.jar"))
9425 (sha256
9426 (base32
9427 "0jgqiak2i05qv6j3gd33xlaifzzc0ylxxk376v2x0apfg3vvixmz"))))
9428 (build-system ant-build-system)
9429 (inputs
9430 `(("resource" ,java-osgi-resource)
9431 ("annotation" ,java-osgi-annotation)))
9432 (arguments
9433 `(#:jar-name "osgi-namespace-extendent.jar"
9434 #:tests? #f)); no tests
9435 (home-page "https://www.osgi.org")
9436 (synopsis "Extender Capability and Requirement Namespace")
9437 (description
9438 "OSGi, for Open Services Gateway initiative framework, is a module system
9439and service platform for the Java programming language. This package contains
9440the names for the attributes and directives for an extender namespace.")
9441 (license license:asl2.0)))
9442
9443(define-public java-osgi-namespace-service
9444 (package
9445 (name "java-osgi-namespace-service")
9446 (version "1.0.0")
9447 (source (origin
9448 (method url-fetch)
9449 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9450 "org.osgi.namespace.service/"
9451 version "/org.osgi.namespace.service-"
9452 version "-sources.jar"))
9453 (sha256
9454 (base32
9455 "0qmw8n2449nkmm56d1znz9zhazb6ya3vsimd5bf5jg23zzhgl8c8"))))
9456 (build-system ant-build-system)
9457 (inputs
9458 `(("resource" ,java-osgi-resource)
9459 ("annotation" ,java-osgi-annotation)))
9460 (arguments
9461 `(#:jar-name "osgi-namespace-service.jar"
9462 #:tests? #f)); no tests
9463 (home-page "https://www.osgi.org")
9464 (synopsis "Service Capability and Requirement Namespace")
9465 (description
9466 "OSGi, for Open Services Gateway initiative framework, is a module system
9467and service platform for the Java programming language. This package contains
9468the names for the attributes and directives for a service namespace.")
9469 (license license:asl2.0)))
9470
9471(define-public java-osgi-util-function
9472 (package
9473 (name "java-osgi-util-function")
9474 (version "1.0.0")
9475 (source (origin
9476 (method url-fetch)
9477 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9478 "org.osgi.util.function/"
9479 version "/org.osgi.util.function-"
9480 version "-sources.jar"))
9481 (sha256
9482 (base32
9483 "04l7j3hwmmj28w23m7paca0afzncs42j2mdr3liqq8kvp548sc6x"))))
9484 (build-system ant-build-system)
9485 (arguments
9486 `(#:jar-name "osgi-util-function.jar"
9487 #:tests? #f)); no tests
9488 (inputs
9489 `(("annotation" ,java-osgi-annotation)))
9490 (home-page "https://www.osgi.org")
9491 (synopsis "OSGI Util Function")
9492 (description
9493 "OSGi, for Open Services Gateway initiative framework, is a module system
9494and service platform for the Java programming language. This package contains
9495an interface for a function that accepts a single argument and produces a result.")
9496 (license license:asl2.0)))
9497
9498(define-public java-osgi-util-promise
9499 (package
9500 (name "java-osgi-util-promise")
9501 (version "1.0.0")
9502 (source (origin
9503 (method url-fetch)
9504 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9505 "org.osgi.util.promise/"
9506 version "/org.osgi.util.promise-"
9507 version "-sources.jar"))
9508 (sha256
9509 (base32
9510 "0y34dwiflg1c4ahvkswpf9z02xph2sr9fm04ia5493x3lshpw22c"))))
9511 (build-system ant-build-system)
9512 (arguments
9513 `(#:jar-name "osgi-util-promise.jar"
9514 #:tests? #f)); no tests
9515 (inputs
9516 `(("annotation" ,java-osgi-annotation)
9517 ("function" ,java-osgi-util-function)))
9518 (home-page "https://www.osgi.org")
9519 (synopsis "Promise of a value")
9520 (description
9521 "OSGi, for Open Services Gateway initiative framework, is a module system
9522and service platform for the Java programming language. This package contains
9523an interface and utilitary classes for promises. A Promise represents a future
9524value. It handles the interactions for asynchronous processing.")
9525 (license license:asl2.0)))
9526
9527(define-public java-osgi-service-metatype-annotations
9528 (package
9529 (name "java-osgi-service-metatype-annotations")
9530 (version "1.3.0")
9531 (source (origin
9532 (method url-fetch)
9533 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9534 "org.osgi.service.metatype.annotations/"
9535 version "/org.osgi.service.metatype.annotations-"
9536 version "-sources.jar"))
9537 (sha256
9538 (base32
9539 "12rwm3349wk80vm88rcdgs4435m4jxkpkj5mrx326skkz2c6hyw6"))))
9540 (build-system ant-build-system)
9541 (arguments
9542 `(#:jar-name "osgi-service-metatype-annotations.jar"
9543 #:tests? #f)); no tests
9544 (inputs
9545 `(("annotation" ,java-osgi-annotation)))
9546 (home-page "https://www.osgi.org")
9547 (synopsis "Support annotations for metatype")
9548 (description
9549 "OSGi, for Open Services Gateway initiative framework, is a module system
9550and service platform for the Java programming language. This package contains
9551the support annotations for metatype.")
9552 (license license:asl2.0)))
9553
9554(define-public java-osgi-service-repository
9555 (package
9556 (name "java-osgi-service-repository")
9557 (version "1.1.0")
9558 (source (origin
9559 (method url-fetch)
9560 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9561 "org.osgi.service.repository/"
9562 version "/org.osgi.service.repository-"
9563 version "-sources.jar"))
9564 (sha256
9565 (base32
9566 "1k41mhg7b58pd8nsghr2qwcjrxdnf1p9spsw9v11k4257g6rl06n"))))
9567 (build-system ant-build-system)
9568 (arguments
9569 `(#:jar-name "osgi-service-repository.jar"
9570 #:tests? #f)); no tests
9571 (inputs
9572 `(("annotation" ,java-osgi-annotation)
9573 ("promise" ,java-osgi-util-promise)
9574 ("resource" ,java-osgi-resource)))
9575 (home-page "https://www.osgi.org")
9576 (synopsis "OSGI service repository")
9577 (description
9578 "OSGi, for Open Services Gateway initiative framework, is a module system
9579and service platform for the Java programming language. This package contains
9580a repository service that contains resources.")
9581 (license license:asl2.0)))
9582
9583(define-public java-osgi-framework
9584 (package
9585 (name "java-osgi-framework")
9586 (version "1.8.0")
9587 (source (origin
9588 (method url-fetch)
9589 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9590 "org.osgi.framework/" version "/org.osgi.framework-"
9591 version "-sources.jar"))
9592 (sha256
9593 (base32
9594 "1lwp2zfad3rybcc6q9bwz8xsgkc92ypzy5p6x54387f1qj65m73s"))))
9595 (build-system ant-build-system)
9596 (arguments
9597 `(#:jar-name "osgi-framework.jar"
9598 #:tests? #f)); no tests
9599 (inputs
9600 `(("annotation" ,java-osgi-annotation)
9601 ("resource" ,java-osgi-resource)
9602 ("dto" ,java-osgi-dto)))
9603 (home-page "https://www.osgi.org")
9604 (synopsis "OSGi framework")
9605 (description
9606 "OSGi, for Open Services Gateway initiative framework, is a module system
9607and service platform for the Java programming language.")
9608 (license license:asl2.0)))
9609
9610(define-public java-osgi-service-log
9611 (package
9612 (name "java-osgi-service-log")
9613 (version "1.3.0")
9614 (source (origin
9615 (method url-fetch)
9616 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9617 "org.osgi.service.log/"
9618 version "/org.osgi.service.log-"
9619 version "-sources.jar"))
9620 (sha256
9621 (base32
9622 "1029j30dzcwializzca0j3fkhwwz08kmmsha5agw1iccscimj6r0"))))
9623 (build-system ant-build-system)
9624 (arguments
9625 `(#:jar-name "osgi-service-log.jar"
9626 #:tests? #f)); no tests
9627 (inputs
9628 (list java-osgi-framework))
9629 (home-page "https://www.osgi.org")
9630 (synopsis "Provides methods for bundles to write messages to the log")
9631 (description
9632 "OSGi, for Open Services Gateway initiative framework, is a module system
9633and service platform for the Java programming language. This package contains
9634the log service.")
9635 (license license:asl2.0)))
9636
9637(define-public java-osgi-service-jdbc
9638 (package
9639 (name "java-osgi-service-jdbc")
9640 (version "1.0.0")
9641 (source (origin
9642 (method url-fetch)
9643 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9644 "org.osgi.service.jdbc/"
9645 version "/org.osgi.service.jdbc-"
9646 version "-sources.jar"))
9647 (sha256
9648 (base32
9649 "11iln5v7bk469cgb9ddkrz9sa95b3733gqgaqw9xf5g6wq652yjz"))))
9650 (build-system ant-build-system)
9651 (arguments
9652 `(#:jar-name "osgi-service-jdbc.jar"
9653 #:tests? #f)); no tests
9654 (home-page "https://www.osgi.org")
9655 (synopsis "Factory for JDBC connection factories")
9656 (description
9657 "OSGi, for Open Services Gateway initiative framework, is a module system
9658and service platform for the Java programming language. This package contains
9659a factory for JDBC connection factories. There are 3 preferred connection
9660factories for getting JDBC connections:
9661
9662@itemize
9663@item @code{javax.sql.DataSource};
9664@item @code{javax.sql.ConnectionPoolDataSource};
9665@item @code{javax.sql.XADataSource}.
9666@end itemize")
9667 (license license:asl2.0)))
9668
9669(define-public java-osgi-service-resolver
9670 (package
9671 (name "java-osgi-service-resolver")
9672 (version "1.0.1")
9673 (source (origin
9674 (method url-fetch)
9675 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9676 "org.osgi.service.resolver/"
9677 version "/org.osgi.service.resolver-"
9678 version "-sources.jar"))
9679 (sha256
9680 (base32
9681 "1dzqn1ryfi2rq4zwsgp44bmj2wlfydjg1qbxw2b0z4xdjjy55vxd"))))
9682 (build-system ant-build-system)
9683 (arguments
9684 `(#:jar-name "osgi-service-resolver.jar"
9685 #:tests? #f)); no tests
9686 (inputs
9687 `(("annotation" ,java-osgi-annotation)
9688 ("resource" ,java-osgi-resource)))
9689 (home-page "https://www.osgi.org")
9690 (synopsis "OSGI Resolver service")
9691 (description
9692 "OSGi, for Open Services Gateway initiative framework, is a module system
9693and service platform for the Java programming language. This package contains
9694a resolver service that resolves the specified resources in the context supplied
9695by the caller.")
9696 (license license:asl2.0)))
9697
9698(define-public java-osgi-util-tracker
9699 (package
9700 (name "java-osgi-util-tracker")
9701 (version "1.5.1")
9702 (source (origin
9703 (method url-fetch)
9704 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9705 "org.osgi.util.tracker/"
9706 version "/org.osgi.util.tracker-"
9707 version "-sources.jar"))
9708 (sha256
9709 (base32
9710 "0c4fh9vxwzsx59r8dygda0gq2gx3z5vfhc3jsphlqwf5w0h403lz"))))
9711 (build-system ant-build-system)
9712 (arguments
9713 `(#:jar-name "osgi-util-tracker.jar"
9714 #:tests? #f)); no tests
9715 (inputs
9716 `(("framework" ,java-osgi-framework)
9717 ("annotation" ,java-osgi-annotation)))
9718 (home-page "https://www.osgi.org")
9719 (synopsis "Bundle tracking")
9720 (description
9721 "OSGi, for Open Services Gateway initiative framework, is a module system
9722and service platform for the Java programming language. This package contains
9723bundle tracking utility classes.")
9724 (license license:asl2.0)))
9725
9726(define-public java-osgi-service-cm
9727 (package
9728 (name "java-osgi-service-cm")
9729 (version "1.5.0")
9730 (source (origin
9731 (method url-fetch)
9732 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9733 "org.osgi.service.cm/"
9734 version "/org.osgi.service.cm-"
9735 version "-sources.jar"))
9736 (sha256
9737 (base32
9738 "1z8kap48y3xi0ggj8v6czglfnpnd94mmismgi2wbqhj1nl5fzbp6"))))
9739 (build-system ant-build-system)
9740 (arguments
9741 `(#:jar-name "osgi-service-cm.jar"
9742 #:tests? #f)); no tests
9743 (inputs
9744 `(("framework" ,java-osgi-framework)
9745 ("annotation" ,java-osgi-annotation)))
9746 (home-page "https://www.osgi.org")
9747 (synopsis "OSGI Configuration Management")
9748 (description
9749 "OSGi, for Open Services Gateway initiative framework, is a module system
9750and service platform for the Java programming language. This package contains
9751utility classes for the configuration of services.")
9752 (license license:asl2.0)))
9753
9754(define-public java-osgi-service-packageadmin
9755 (package
9756 (name "java-osgi-service-packageadmin")
9757 (version "1.2.0")
9758 (source (origin
9759 (method url-fetch)
9760 (uri (string-append "https://repo1.maven.org/maven2/org/osgi/"
9761 "org.osgi.service.packageadmin/"
9762 version "/org.osgi.service.packageadmin-"
9763 version "-sources.jar"))
9764 (sha256
9765 (base32
9766 "041mpxzi7g36wmcily6y4ccn3jx15akpdy8gmhyb7m98x7qfvn52"))))
9767 (build-system ant-build-system)
9768 (arguments
9769 `(#:jar-name "osgi-service-packageadmin.jar"
9770 #:tests? #f)); no tests
9771 (inputs
9772 `(("framework" ,java-osgi-framework)))
9773 (home-page "https://www.osgi.org")
9774 (synopsis "OSGI Package Administration")
9775 (description
9776 "OSGi, for Open Services Gateway initiative framework, is a module system
9777and service platform for the Java programming language. This package contains
9778the packageadmin service.")
9779 (license license:asl2.0)))
9780
9781(define-public java-ops4j-base-lang
9782 (package
9783 (name "java-ops4j-base-lang")
9784 (version "1.5.0")
9785 (source (origin
9786 (method url-fetch)
9787 (uri (string-append "https://github.com/ops4j/org.ops4j.base/"
9788 "archive/base-" version ".tar.gz"))
9789 (sha256
9790 (base32
9791 "18hl3lpchgpv8yh5rlk39l2gif5dlfgb8gxjmncf39pr2dprkniw"))))
9792 (build-system ant-build-system)
9793 (arguments
9794 `(#:jar-name "java-ops4j-base-lang.jar"
9795 #:source-dir "ops4j-base-lang/src/main/java"
9796 #:tests? #f; no tests
9797 #:phases
9798 (modify-phases %standard-phases
9799 (add-before 'build 'add-test-file
9800 (lambda _
9801 ;; That file is required by a test in ops4j-pax-exam-core-spi
9802 (mkdir-p "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang")
9803 (with-output-to-file "build/classes/META-INF/maven/org.ops4j.base/ops4j-base-lang/pom.properties"
9804 (lambda _
9805 (display
9806 (string-append
9807 "version=" ,version "\n"
9808 "groupId=org.ops4j.base"
9809 "artifactId=ops4j-base-lang\n"))))
9810 #t)))))
9811 (home-page "https://ops4j1.jira.com/wiki/spaces/base/overview")
9812 (synopsis "Utility classes and extensions to be used in OPS4J projects")
9813 (description "OPS4J stands for Open Participation Software for Java. This
9814package contains utilities and extensions related to @code{java.lang}.")
9815 (license license:asl2.0)))
9816
9817(define-public java-ops4j-base-monitors
9818 (package
9819 (inherit java-ops4j-base-lang)
9820 (name "java-ops4j-base-monitors")
9821 (arguments
9822 `(#:jar-name "java-ops4j-base-monitors.jar"
9823 #:source-dir "ops4j-base-monitors/src/main/java"
9824 #:tests? #f)); no tests
9825 (inputs
9826 `(("lang" ,java-ops4j-base-lang)))
9827 (description "OPS4J stands for Open Participation Software for Java. This
9828package contains utilities and extensions related to monitoring.")))
9829
9830(define-public java-ops4j-base-io
9831 (package
9832 (inherit java-ops4j-base-lang)
9833 (name "java-ops4j-base-io")
9834 (arguments
9835 `(#:jar-name "java-ops4j-base-io.jar"
9836 #:source-dir "ops4j-base-io/src/main/java"
9837 #:test-dir "ops4j-base-io/src/test"
9838 #:test-exclude
9839 (list "**/ListerTest.java")))
9840 (inputs
9841 `(("lang" ,java-ops4j-base-monitors)
9842 ("lang" ,java-ops4j-base-lang)))
9843 (native-inputs
9844 `(("junit" ,java-junit)
9845 ("hamcrest" ,java-hamcrest-core)))
9846 (description "OPS4J stands for Open Participation Software for Java. This
9847package contains utilities and extensions related to handling streams and files.")))
9848
9849(define-public java-ops4j-base-util
9850 (package
9851 (inherit java-ops4j-base-lang)
9852 (name "java-ops4j-base-util")
9853 (arguments
9854 `(#:jar-name "java-ops4j-base-util.jar"
9855 #:source-dir "ops4j-base-util/src/main/java"
9856 #:test-dir "ops4j-base-util/src/test"))
9857 (inputs
9858 `(("lang" ,java-ops4j-base-lang)))
9859 (native-inputs
9860 `(("junit" ,java-junit)))
9861 (description "OPS4J stands for Open Participation Software for Java. This
9862package contains utilities and extensions related to environment, i18n and
9863mime types.")))
9864
9865(define-public java-ops4j-base-util-property
9866 (package
9867 (inherit java-ops4j-base-lang)
9868 (name "java-ops4j-base-util-property")
9869 (arguments
9870 `(#:jar-name "java-ops4j-base-util-property.jar"
9871 #:source-dir "ops4j-base-util-property/src/main/java"
9872 #:tests? #f)); no tests
9873 (inputs
9874 `(("lang" ,java-ops4j-base-lang)
9875 ("util" ,java-ops4j-base-util)))
9876 (description "OPS4J stands for Open Participation Software for Java. This
9877package contains utilities and extensions related to resolving properties from
9878different sources.")))
9879
9880(define-public java-ops4j-base-store
9881 (package
9882 (inherit java-ops4j-base-lang)
9883 (name "java-ops4j-base-store")
9884 (arguments
9885 `(#:jar-name "java-ops4j-base-store.jar"
9886 #:source-dir "ops4j-base-store/src/main/java"
9887 #:tests? #f)); no tests
9888 (inputs
9889 `(("lang" ,java-ops4j-base-lang)
9890 ("slf4j" ,java-slf4j-api)
9891 ("io" ,java-ops4j-base-io)))
9892 (description "OPS4J stands for Open Participation Software for Java. This
9893package contains utilities for storing and retrieving data from an
9894@code{InputStream}.")))
9895
9896(define-public java-ops4j-base-spi
9897 (package
9898 (inherit java-ops4j-base-lang)
9899 (name "java-ops4j-base-spi")
9900 (arguments
9901 `(#:jar-name "java-ops4j-base-spi.jar"
9902 #:source-dir "ops4j-base-spi/src/main/java"
9903 #:test-dir "ops4j-base-spi/src/test"))
9904 (native-inputs
9905 `(("junit" ,java-junit)
9906 ("hamcrest" ,java-hamcrest-core)))
9907 (description "OPS4J stands for Open Participation Software for Java. This
9908package contains utilities for obtaining services via the Java SE 6
9909@code{ServiceLoader}.")))
9910
9911(define-public java-aqute-bnd-annotation
9912 (package
9913 (name "java-aqute-bnd-annotation")
9914 (version "3.5.0")
9915 (source (origin
9916 (method url-fetch)
9917 (uri (string-append "https://github.com/bndtools/bnd/archive/"
9918 version ".REL.tar.gz"))
9919 (file-name (string-append name "-" version ".tar.gz"))
9920 (sha256
9921 (base32
9922 "1ggyiq0as0f6cz333a0dh98j72kmvv5pf2s47v9554yh905lfqdl"))))
9923 (build-system ant-build-system)
9924 (arguments
9925 `(#:jar-name "java-aqute-bnd-annotation.jar"
9926 #:source-dir "biz.aQute.bnd.annotation/src"
9927 #:tests? #f)); empty test dir
9928 (home-page "https://bnd.bndtools.org/")
9929 (synopsis "Tools for OSGi")
9930 (description "Bnd is a swiss army knife for OSGi, it creates manifest
9931headers based on analyzing the class code, it verifies the project settings,
9932it manages project dependencies, gives diffs jars, and much more.")
9933 (license license:asl2.0)))
9934
9935(define-public java-aqute-libg
9936 (package
9937 (inherit java-aqute-bnd-annotation)
9938 (name "java-aqute-libg")
9939 (arguments
9940 `(#:jar-name "java-aqute-libg.jar"
9941 ;; The build fails when source/target more recent than 1.7. This
9942 ;; is a known issue. See: https://github.com/bndtools/bnd/issues/1327
9943 ;;
9944 ;; It is closed as won't fix. There is no way to change the source
9945 ;; so that it works on 1.8, and still works on 1.6, the upstream
9946 ;; target. It work fine on 1.7, so we use 1.7.
9947 #:make-flags (list "-Dant.build.javac.source=1.7"
9948 "-Dant.build.javac.target=1.7")
9949 #:phases
9950 (modify-phases %standard-phases
9951 (add-before 'configure 'chdir
9952 ;; Change to aQute.libg directory, so that the relative
9953 ;; paths in the tests aren't broken.
9954 (lambda _
9955 (chdir "aQute.libg")
9956 #t))
9957 (add-before 'check 'create-test-directory
9958 ;; Copy the test directory to test/java, since that's where
9959 ;; ant-build-system's default project in build.xml expects to find
9960 ;; the test classes. Leave a copy in the original place to not
9961 ;; break paths in tests.
9962 (lambda _
9963 (mkdir "src/test")
9964 (copy-recursively "test" "src/test/java")
9965 #t)))))
9966 (inputs
9967 `(("slf4j" ,java-slf4j-api)
9968 ("osgi-annot" ,java-osgi-annotation)
9969 ("java-osgi-cmpn" ,java-osgi-cmpn)
9970 ("osgi" ,java-osgi-core)))
9971 (native-inputs
9972 `(("hamcrest" ,java-hamcrest-core)
9973 ("java-junit" ,java-junit)))))
9974
9975(define-public java-aqute-bndlib
9976 (package
9977 (inherit java-aqute-bnd-annotation)
9978 (name "java-aqute-bndlib")
9979 (arguments
9980 `(#:jar-name "java-bndlib.jar"
9981 #:source-dir "biz.aQute.bndlib/src"
9982 #:tests? #f)); no tests
9983 (inputs
9984 `(("slf4j" ,java-slf4j-api)
9985 ("osgi-annot" ,java-osgi-annotation)
9986 ("java-aqute-libg" ,java-aqute-libg)
9987 ("java-aqute-bnd-annotation" ,java-aqute-bnd-annotation)
9988 ("java-osgi-service-component-annotations" ,java-osgi-service-component-annotations)
9989 ("java-osgi-service-repository" ,java-osgi-service-repository)
9990 ("java-osgi-service-log" ,java-osgi-service-log)
9991 ("java-osgi-service-metatype-annotations" ,java-osgi-service-metatype-annotations)
9992 ("java-osgi-namespace-contract" ,java-osgi-namespace-contract)
9993 ("java-osgi-namespace-extender" ,java-osgi-namespace-extender)
9994 ("java-osgi-namespace-service" ,java-osgi-namespace-service)
9995 ("promise" ,java-osgi-util-promise)
9996 ("osgi" ,java-osgi-core)))))
9997
9998(define-public java-ops4j-pax-tinybundles
9999 (package
10000 (name "java-ops4j-pax-tinybundles")
10001 (version "2.1.1")
10002 (source (origin
10003 (method url-fetch)
10004 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.tinybundles/"
10005 "archive/tinybundles-" version ".tar.gz"))
10006 (sha256
10007 (base32
10008 "0y0gq3pvv0iir2b885lmlwnvr724vv7vklzhhr4fs27d7mdkj871"))))
10009 (arguments
10010 `(#:jar-name "java-ops4j-pax-tinybundles.jar"
10011 #:source-dir "src/main/java"
10012 #:test-exclude
10013 ;; Abstract base classes for other tests
10014 (list "**/BndTest.java" "**/CoreTest.java")
10015 #:phases
10016 (modify-phases %standard-phases
10017 (add-before 'check 'fix-version
10018 (lambda _
10019 ;; This test has a reference to an old version of bndlib we are not
10020 ;; packaging. It uses the version referenced in pom.xml. We replace
10021 ;; it with our own version.
10022 (substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
10023 (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
10024 ,(package-version java-aqute-bndlib)))
10025 #t)))))
10026 (inputs
10027 `(("lang" ,java-ops4j-base-lang)
10028 ("io" ,java-ops4j-base-io)
10029 ("store" ,java-ops4j-base-store)
10030 ("slf4j" ,java-slf4j-api)
10031 ("libg" ,java-aqute-libg)
10032 ("bndlib" ,java-aqute-bndlib)))
10033 (native-inputs
10034 `(("junit" ,java-junit)
10035 ("hamcrest" ,java-hamcrest-core)
10036 ("log4j" ,java-log4j-api)
10037 ("bndannotation" ,java-aqute-bnd-annotation)
10038 ("framework" ,java-osgi-framework)))
10039 (build-system ant-build-system)
10040 (home-page "https://ops4j1.jira.com/wiki/spaces/ops4j/pages/12060312/Tinybundles")
10041 (synopsis "Java APIs to create OSGi related artifacts")
10042 (description "Tinybundles is all about creating OSGi related artifacts like
10043Bundles, Fragments and Deployment Packages with Java Api. It is very convenient
10044to create such artifacts on-the-fly inside Tests (like in Pax Exam). On the
10045other hand, this library can be a foundation of real end user tools that need
10046to create those artifacts.")
10047 (license license:asl2.0)))
10048
10049(define-public java-ops4j-pax-exam-core
10050 (package
10051 (name "java-ops4j-pax-exam-core")
10052 (version "4.11.0")
10053 (source (origin
10054 (method url-fetch)
10055 (uri (string-append "https://github.com/ops4j/org.ops4j.pax.exam2/"
10056 "archive/exam-reactor-" version ".tar.gz"))
10057 (sha256
10058 (base32
10059 "1b0f89gawxyl0pkqx9sicp6n58pirkzhjw41y749bwrkb6h99i26"))))
10060 (arguments
10061 (list #:jar-name "java-ops4j-pax-exam-core.jar"
10062 #:source-dir "core/pax-exam/src/main/java"
10063 #:test-dir "core/pax-exam/src/test"))
10064 (inputs
10065 (list java-slf4j-api
10066 java-ops4j-base-lang
10067 java-ops4j-base-io
10068 java-ops4j-base-util-property
10069 java-ops4j-base-store
10070 java-osgi-core))
10071 (native-inputs
10072 (list java-junit
10073 java-hamcrest-core))
10074 (build-system ant-build-system)
10075 (home-page "https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/overview")
10076 (synopsis "In-Container Testing for OSGi, Java EE and CDI")
10077 (description "Pax Exam creates OSGi bundles for testing purposes. It lets
10078the user take control of the OSGi framework, the test framework (e.g. JUnit) and
10079the system under test at the same time.")
10080 (license license:asl2.0)))
10081
10082(define-public java-ops4j-pax-exam-core-spi
10083 (package
10084 (inherit java-ops4j-pax-exam-core)
10085 (name "java-ops4j-pax-exam-core-spi")
10086 (arguments
10087 `(#:jar-name "java-ops4j-pax-exam-spi.jar"
10088 #:source-dir "src/main/java"
10089 #:test-exclude
10090 (list
10091 ;; Abstract base class, not a test
10092 "**/BaseStagedReactorTest.java"
10093 ;; Depends on org.mortbay.jetty.testwars:test-war-dump
10094 "**/WarBuilderTest.java")
10095 #:phases
10096 (modify-phases %standard-phases
10097 (add-before 'configure 'chdir
10098 (lambda _
10099 ;; Tests assume we are in this directory
10100 (chdir "core/pax-exam-spi")
10101 #t))
10102 (add-before 'check 'fix-tests
10103 (lambda _
10104 ;; One test checks that this file is present.
10105 (mkdir-p "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi")
10106 (with-output-to-file
10107 "build/classes/META-INF/maven/org.ops4j.pax.exam/pax-exam-spi/pom.properties"
10108 (lambda _
10109 (display
10110 (string-append "artifactId = pax-exam-spi\n"
10111 "version = " ,(package-version java-ops4j-pax-exam-core-spi)))))
10112 ;; Maven puts compilation results in the target directory, while we
10113 ;; put them in the build directory.
10114 (substitute* '("src/test/java/org/ops4j/pax/exam/spi/war/WarBuilderTest.java"
10115 "src/test/java/org/ops4j/pax/exam/spi/war/WarTestProbeBuilderTest.java"
10116 "src/test/java/org/ops4j/pax/exam/spi/war/ZipBuilderTest.java")
10117 (("target") "build"))
10118 ;; One test is expected to fail, but it doesn't throw the expected exception
10119 (substitute* "src/test/java/org/ops4j/pax/exam/spi/reactors/BaseStagedReactorTest.java"
10120 (("AssertionError") "IllegalArgumentException"))
10121 #t)))))
10122 (inputs
10123 `(("java-ops4j-pax-exam-core" ,java-ops4j-pax-exam-core)
10124 ("lang" ,java-ops4j-base-lang)
10125 ("monitors" ,java-ops4j-base-monitors)
10126 ("store" ,java-ops4j-base-store)
10127 ("io" ,java-ops4j-base-io)
10128 ("spi" ,java-ops4j-base-spi)
10129 ("osgi" ,java-osgi-core)
10130 ("slf4j" ,java-slf4j-api)
10131 ("tinybundles" ,java-ops4j-pax-tinybundles)))
10132 (native-inputs
10133 `(("mockito" ,java-mockito-1)
10134 ("junit" ,java-junit)
10135 ("hamcrest" ,java-hamcrest-core)
10136 ("cglib" ,java-cglib)
10137 ("objenesis" ,java-objenesis)))))
10138
10139(define-public java-ops4j-pax-exam-core-junit
10140 (package
10141 (inherit java-ops4j-pax-exam-core)
10142 (name "java-ops4j-pax-exam-core-junit")
10143 (arguments
10144 `(#:jar-name "ops4j-pax-exam-core-junit.jar"
10145 #:source-dir "drivers/pax-exam-junit4/src/main/java"
10146 #:tests? #f)); no tests
10147 (inputs
10148 `(("junit" ,java-junit)
10149 ("slf4j" ,java-slf4j-api)
10150 ("core" ,java-ops4j-pax-exam-core)
10151 ("spi" ,java-ops4j-pax-exam-core-spi)))
10152 (native-inputs '())))
10153
10154(define-public java-fasterxml-jackson-annotations
10155 (package
10156 (name "java-fasterxml-jackson-annotations")
10157 (version "2.9.4")
10158 (source (origin
10159 (method url-fetch)
10160 (uri (string-append "https://github.com/FasterXML/"
10161 "jackson-annotations/archive/"
10162 "jackson-annotations-" version ".tar.gz"))
10163 (sha256
10164 (base32
10165 "0mr95xd0da6a4g95zvrl1ryk5n5zv2rc696w3xnsr5hxk2gicfc4"))))
10166 (build-system ant-build-system)
10167 (arguments
10168 `(#:jar-name "jackson-annotations.jar"
10169 #:source-dir "src/main/java"
10170 #:test-dir "src/test"))
10171 (native-inputs
10172 `(("junit" ,java-junit)))
10173 (home-page "https://github.com/FasterXML/jackson-annotations")
10174 (synopsis "General purpose annotations for the Jackson Data Processor")
10175 (description "This package contains general purpose annotations for the
10176Jackson Data Processor, used on value and handler types. The only annotations
10177not included are ones that require dependency to the Databind package.")
10178 (license license:asl2.0)))
10179
10180(define-public java-fasterxml-jackson-core
10181 (package
10182 (name "java-fasterxml-jackson-core")
10183 (version "2.9.4")
10184 (source (origin
10185 (method url-fetch)
10186 (uri (string-append "https://github.com/FasterXML/"
10187 "jackson-core/archive/"
10188 "jackson-core-" version ".tar.gz"))
10189 (sha256
10190 (base32
10191 "159hsnk17jr1gyzkf01cxvsn45srnk37g949r7364qlsr527gjgd"))))
10192 (build-system ant-build-system)
10193 (arguments
10194 `(#:jar-name "jackson-core.jar"
10195 #:source-dir "src/main/java"
10196 #:test-dir "src/test"
10197 #:test-exclude
10198 (list
10199 ;; Expected failure. pom.xml excludes these
10200 "**/failing/**"
10201 ;; Base classes that have no constructor for junit
10202 "**/BaseTest.java"
10203 "**/ConcurrencyReadTest.java"
10204 "**/ManualCharAccessTest.java"
10205 "**/ManualCharAccessTest.java"
10206 "**/TrailingCommasTest.java"
10207 "**/AsyncMissingValuesInObjectTest.java"
10208 "**/AsyncMissingValuesInArrayTest.java")
10209 #:phases
10210 (modify-phases %standard-phases
10211 (add-before 'configure 'generate-PackageVersion.java
10212 (lambda _
10213 (let* ((out "src/main/java/com/fasterxml/jackson/core/json/PackageVersion.java")
10214 (in (string-append out ".in")))
10215 (copy-file in out)
10216 (substitute* out
10217 (("@package@") "com.fasterxml.jackson.core.json")
10218 (("@projectversion@") ,version)
10219 (("@projectgroupid@") "com.fasterxml.jackson.core")
10220 (("@projectartifactid@") "jackson-core")))
10221 #t))
10222 (add-before 'build 'copy-resources
10223 (lambda _
10224 (copy-recursively "src/main/resources"
10225 "build/classes")
10226 #t))
10227 (add-before 'check 'copy-test-resources
10228 (lambda _
10229 (copy-recursively "src/test/resources"
10230 "build/test-classes")
10231 #t)))))
10232 (native-inputs
10233 `(("junit" ,java-junit)
10234 ("hamcrest" ,java-hamcrest-core)))
10235 (home-page "https://github.com/FasterXML/jackson-core")
10236 (synopsis "Low-level streaming parser and generator abstractions")
10237 (description "This package contains core low-level incremental
10238(streaming) parser and generator abstractions used by the Jackson Data
10239Processor. It also includes the default implementation of handler types
10240(parser, generator) that handle JSON format.")
10241 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10242
10243(define-public java-fasterxml-jackson-databind
10244 (package
10245 (name "java-fasterxml-jackson-databind")
10246 (version "2.9.4")
10247 (source (origin
10248 (method url-fetch)
10249 (uri (string-append "https://github.com/FasterXML/"
10250 "jackson-databind/archive/"
10251 "jackson-databind-" version ".tar.gz"))
10252 (sha256
10253 (base32
10254 "1zd2cw4z6kdkbx8za96xh9pyicv2a2l7y0rkcx2fqd8hv6d47s08"))))
10255 (build-system ant-build-system)
10256 (arguments
10257 `(#:jar-name "jackson-databind.jar"
10258 #:source-dir "src/main/java"
10259 #:tests? #f; requires javax.measures for which I can't find a free implementation
10260 #:phases
10261 (modify-phases %standard-phases
10262 (add-before 'configure 'generate-PackageVersion.java
10263 (lambda _
10264 (let* ((out "src/main/java/com/fasterxml/jackson/databind/cfg/PackageVersion.java")
10265 (in (string-append out ".in")))
10266 (copy-file in out)
10267 (substitute* out
10268 (("@package@") "com.fasterxml.jackson.databind.cfg")
10269 (("@projectversion@") ,version)
10270 (("@projectgroupid@") "com.fasterxml.jackson.databind")
10271 (("@projectartifactid@") "jackson-databind")))
10272 #t))
10273 (add-before 'build 'copy-resources
10274 (lambda _
10275 (copy-recursively "src/main/resources" "build/classes")
10276 #t)))))
10277 (inputs
10278 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core))
10279 (home-page "https://github.com/FasterXML/jackson-databind")
10280 (synopsis "Data-binding functionality and tree-model for the Jackson Data Processor")
10281 (description "This package contains the general-purpose data-binding
10282functionality and tree-model for Jackson Data Processor. It builds on core
10283streaming parser/generator package, and uses Jackson Annotations for
10284configuration.")
10285 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10286
10287(define-public java-fasterxml-jackson-modules-base-jaxb
10288 (package
10289 (name "java-fasterxml-jackson-modules-base-jaxb")
10290 (version "2.9.4")
10291 (source (origin
10292 (method url-fetch)
10293 (uri (string-append "https://github.com/FasterXML/"
10294 "jackson-modules-base/archive/"
10295 "jackson-modules-base-" version ".tar.gz"))
10296 (sha256
10297 (base32
10298 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10299 (build-system ant-build-system)
10300 (arguments
10301 `(#:jar-name "jackson-modules-base-jaxb.jar"
10302 #:source-dir "jaxb/src/main/java"
10303 #:test-dir "jaxb/src/test"
10304 #:test-exclude
10305 ;; Base class for tests
10306 (list "**/BaseJaxbTest.java")
10307 #:phases
10308 (modify-phases %standard-phases
10309 (add-before 'configure 'generate-PackageVersion.java
10310 (lambda _
10311 (let* ((out (string-append "jaxb/src/main/java/com/fasterxml/"
10312 "jackson/module/jaxb/PackageVersion.java"))
10313 (in (string-append out ".in")))
10314 (copy-file in out)
10315 (substitute* out
10316 (("@package@") "com.fasterxml.jackson.module.jaxb")
10317 (("@projectversion@") ,version)
10318 (("@projectgroupid@") "com.fasterxml.jackson.module.jaxb")
10319 (("@projectartifactid@") "jackson-module-jaxb")))
10320 #t))
10321 (add-before 'build 'copy-resources
10322 (lambda _
10323 (copy-recursively "jaxb/src/main/resources" "build/classes")
10324 #t)))))
10325 (inputs
10326 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10327 java-fasterxml-jackson-databind))
10328 (native-inputs
10329 (list java-junit))
10330 (home-page "https://github.com/FasterXML/jackson-modules-base")
10331 (synopsis "Jaxb annotations jackson module")
10332 (description "This package is the jaxb annotations module for jackson.")
10333 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10334
10335(define-public java-fasterxml-jackson-modules-base-mrbean
10336 (package
10337 (name "java-fasterxml-jackson-modules-base-mrbean")
10338 (version "2.9.4")
10339 (source (origin
10340 (method url-fetch)
10341 (uri (string-append "https://github.com/FasterXML/"
10342 "jackson-modules-base/archive/"
10343 "jackson-modules-base-" version ".tar.gz"))
10344 (sha256
10345 (base32
10346 "1wws95xi8sppp6b0k2vvjdjyynl20r1a4dwrhai08lzlria6blp5"))))
10347 (build-system ant-build-system)
10348 (arguments
10349 `(#:jar-name "jackson-modules-base-mrbean.jar"
10350 #:source-dir "mrbean/src/main/java"
10351 #:test-dir "mrbean/src/test"
10352 #:test-exclude
10353 ;; Base class for tests
10354 (list "**/BaseTest.java")
10355 #:phases
10356 (modify-phases %standard-phases
10357 (add-before 'configure 'generate-PackageVersion.java
10358 (lambda _
10359 (let* ((out (string-append "mrbean/src/main/java/com/fasterxml/"
10360 "jackson/module/mrbean/PackageVersion.java"))
10361 (in (string-append out ".in")))
10362 (copy-file in out)
10363 (substitute* out
10364 (("@package@") "com.fasterxml.jackson.module.mrbean")
10365 (("@projectversion@") ,version)
10366 (("@projectgroupid@") "com.fasterxml.jackson.module.mrbean")
10367 (("@projectartifactid@") "jackson-module-mrbean")))
10368 #t)))))
10369 (inputs
10370 (list java-asm java-fasterxml-jackson-annotations
10371 java-fasterxml-jackson-core java-fasterxml-jackson-databind))
10372 (native-inputs
10373 (list java-junit))
10374 (home-page "https://github.com/FasterXML/jackson-modules-base")
10375 (synopsis "POJO type materialization for Java")
10376 (description "This package implements POJO type materialization.
10377Databinders can construct implementation classes for Java interfaces as part
10378of deserialization.")
10379 (license license:asl2.0)))
10380
10381(define-public java-snakeyaml
10382 (package
10383 (name "java-snakeyaml")
10384 (version "1.18")
10385 (source (origin
10386 (method url-fetch)
10387 (uri (string-append "https://bitbucket.org/asomov/snakeyaml/get/v"
10388 version ".tar.gz"))
10389 (file-name (string-append name "-" version ".tar.gz"))
10390 (sha256
10391 (base32
10392 "0474cqcv46zgv9bhms2vgawakq1vyj0hp3h3f1bfys46msia90bh"))))
10393 (build-system ant-build-system)
10394 (arguments
10395 `(#:jar-name "java-snakeyaml.jar"
10396 #:source-dir "src/main/java"
10397 ;; Tests require velocity, a cyclic dependency, and
10398 ;; java-spring-framework-context which is not packaged.
10399 #:tests? #f))
10400 (home-page "https://bitbucket.org/asomov/snakeyaml")
10401 (synopsis "YAML processor")
10402 (description "SnakeYAML is a YAML processor for the Java Virtual Machine.")
10403 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10404
10405(define-public java-fasterxml-jackson-dataformat-yaml
10406 (package
10407 (name "java-fasterxml-jackson-dataformat-yaml")
10408 (version "2.9.4")
10409 (source (origin
10410 (method url-fetch)
10411 (uri (string-append "https://github.com/FasterXML/"
10412 "jackson-dataformats-text/archive/"
10413 "jackson-dataformats-text-" version ".tar.gz"))
10414 (sha256
10415 (base32
10416 "1hikl06khaxbg439avf442qifcadap8w0lx13f0nnhp2vh3dkbz7"))))
10417 (build-system ant-build-system)
10418 (arguments
10419 `(#:jar-name "jackson-dataformat-yaml.jar"
10420 #:source-dir "yaml/src/main/java"
10421 #:test-dir "yaml/src/test"
10422 #:test-exclude (list "**/failing/**.java")
10423 #:phases
10424 (modify-phases %standard-phases
10425 (add-before 'configure 'generate-PackageVersion.java
10426 (lambda _
10427 (let* ((out "yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/PackageVersion.java")
10428 (in (string-append out ".in")))
10429 (copy-file in out)
10430 (substitute* out
10431 (("@package@") "com.fasterxml.jackson.dataformat.yaml")
10432 (("@projectversion@") ,version)
10433 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.yaml")
10434 (("@projectartifactid@") "jackson-dataformat-yaml")))
10435 #t)))))
10436 (inputs
10437 (list java-fasterxml-jackson-annotations java-fasterxml-jackson-core
10438 java-fasterxml-jackson-databind java-snakeyaml))
10439 (native-inputs
10440 `(("junit" ,java-junit)
10441 ("hamcrest" ,java-hamcrest-core)
10442 ("java-ops4j-pax-exam-core-spi" ,java-ops4j-pax-exam-core-spi)
10443 ("java-ops4j-pax-exam-core-junit" ,java-ops4j-pax-exam-core-junit)
10444 ("java-ops4j-pax-exam" ,java-ops4j-pax-exam-core)))
10445 (home-page "https://github.com/FasterXML/jackson-dataformats-text")
10446 (synopsis "Yaml backend for Jackson")
10447 (description "Dataformat backends are used to support format alternatives
10448to JSON, supported by default. This is done by sub-classing Jackson core
10449abstractions.")
10450 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10451
10452(define-public java-stax2-api
10453 (package
10454 (name "java-stax2-api")
10455 (version "4.0.0")
10456 (source (origin
10457 (method url-fetch)
10458 (uri (string-append "https://github.com/FasterXML/stax2-api/archive/"
10459 "stax2-api-" version ".tar.gz"))
10460 (sha256
10461 (base32
10462 "1amc1si0l0hyyw2sawmnzy4hkna3z6fp195y4nm5m9wb9ld5awkq"))))
10463 (build-system ant-build-system)
10464 (arguments
10465 `(#:jar-name "java-stax2-api.jar"
10466 #:source-dir "src/main/java"
10467 #:tests? #f)); no tests
10468 (home-page "https://github.com/FasterXML/stax2-api")
10469 (synopsis "Stax2 API")
10470 (description "Stax2 API is an extension to basic Stax 1.0 API that adds
10471significant new functionalities, such as full-featured bi-direction validation
10472interface and high-performance Typed Access API.")
10473 (license license:bsd-2)))
10474
10475(define-public java-woodstox-core
10476 (package
10477 (name "java-woodstox-core")
10478 (version "5.0.3")
10479 (source (origin
10480 (method git-fetch)
10481 (uri (git-reference
10482 (url "https://github.com/FasterXML/woodstox")
10483 (commit (string-append "woodstox-core-" version))))
10484 (file-name (git-file-name name version))
10485 (sha256
10486 (base32
10487 "0bfylk24a967hwxprxqbg6cdvm6n4ldcarp54yg980viwvjiglyp"))))
10488 (build-system ant-build-system)
10489 (arguments
10490 `(#:jar-name "woodstox.jar"
10491 #:test-exclude
10492 (list "**/Base*.java" "failing/**")
10493 #:phases
10494 (modify-phases %standard-phases
10495 (add-before 'build 'remove-msv-dep
10496 (lambda _
10497 ;; we don't need osgi, and it depends on msv
10498 (delete-file-recursively "src/main/java/com/ctc/wstx/osgi")
10499 ;; msv's latest release is from 2011 and we don't need it
10500 (delete-file-recursively "src/main/java/com/ctc/wstx/msv")
10501 (delete-file-recursively "src/test/java/wstxtest/osgi")
10502 (delete-file-recursively "src/test/java/wstxtest/msv")
10503 #t))
10504 (add-before 'build 'copy-resources
10505 (lambda _
10506 (copy-recursively "src/main/resources" "build/classes")
10507 #t)))))
10508 (inputs
10509 `(("stax2" ,java-stax2-api)))
10510 (native-inputs
10511 `(("junit" ,java-junit)))
10512 (home-page "https://github.com/FasterXML/woodstox")
10513 (synopsis "Stax XML API implementation")
10514 (description "Woodstox is a stax XML API implementation.")
10515 (license license:asl2.0)))
10516
10517(define-public java-fasterxml-jackson-dataformat-xml
10518 (package
10519 (name "java-fasterxml-jackson-dataformat-xml")
10520 (version "2.9.4")
10521 (source (origin
10522 (method git-fetch)
10523 (uri (git-reference
10524 (url "https://github.com/FasterXML/jackson-dataformat-xml")
10525 (commit (string-append "jackson-dataformat-xml-" version))))
10526 (file-name (git-file-name name version))
10527 (sha256
10528 (base32
10529 "0s1wl65mbs57c2hz2v8rnh8i04y5lpyyvnjz562j5j6b83vwwpfx"))))
10530 (build-system ant-build-system)
10531 (arguments
10532 `(#:jar-name "jackson-dataformat-xml.jar"
10533 #:source-dir "src/main/java"
10534 #:test-exclude
10535 (list "**/failing/**")
10536 #:phases
10537 (modify-phases %standard-phases
10538 (add-before 'configure 'generate-PackageVersion.java
10539 (lambda _
10540 (let* ((out "src/main/java/com/fasterxml/jackson/dataformat/xml/PackageVersion.java")
10541 (in (string-append out ".in")))
10542 (copy-file in out)
10543 (newline)
10544 (substitute* out
10545 (("@package@") "com.fasterxml.jackson.dataformat.xml")
10546 (("@projectversion@") ,version)
10547 (("@projectgroupid@") "com.fasterxml.jackson.dataformat.xml")
10548 (("@projectartifactid@") "jackson-dataformat-xml")))
10549 #t))
10550 (add-before 'build 'copy-resources
10551 (lambda _
10552 (copy-recursively "src/main/resources" "build/classes")
10553 #t)))))
10554 (inputs
10555 `(("jackson-annotations" ,java-fasterxml-jackson-annotations)
10556 ("jackson-core" ,java-fasterxml-jackson-core)
10557 ("jackson-modules-base-jaxb" ,java-fasterxml-jackson-modules-base-jaxb)
10558 ("jackson-databind" ,java-fasterxml-jackson-databind)
10559 ("stax2-api" ,java-stax2-api)
10560 ("woodstox" ,java-woodstox-core)))
10561 (native-inputs
10562 `(("junit" ,java-junit)
10563 ("hamcrest" ,java-hamcrest-core)))
10564 (home-page "https://github.com/FasterXML/jackson-dataformat-xml")
10565 (synopsis "Read and write XML")
10566 (description "This package contains Jackson extension component for reading
10567and writing XML encoded data.
10568
10569Further, the goal is to emulate how JAXB data-binding works with \"Code-first\"
10570approach (that is, no support is added for \"Schema-first\" approach). Support
10571for JAXB annotations is provided by JAXB annotation module; this module
10572provides low-level abstractions (@code{JsonParser}, @code{JsonGenerator},
10573@code{JsonFactory}) as well as small number of higher level overrides needed to
10574make data-binding work.")
10575 (license license:asl2.0))); found on wiki.fasterxml.com/JacksonLicensing
10576
10577(define-public java-hdrhistogram
10578 (package
10579 (name "java-hdrhistogram")
10580 (version "2.1.9")
10581 (source (origin
10582 (method git-fetch)
10583 (uri (git-reference
10584 (url "https://github.com/HdrHistogram/HdrHistogram")
10585 (commit (string-append "HdrHistogram-" version))))
10586 (file-name (git-file-name name version))
10587 (sha256
10588 (base32
10589 "1cw8aa1vk258k42xs6wpy72m4gbai540jq032qsa7c5586iawx2d"))))
10590 (build-system ant-build-system)
10591 (arguments
10592 `(#:jar-name "java-hdrhistogram.jar"
10593 #:source-dir "src/main/java"
10594 #:phases
10595 (modify-phases %standard-phases
10596 (add-after 'unpack 'make-files-writable
10597 (lambda _
10598 (for-each make-file-writable (find-files "."))
10599 #t))
10600 (add-before 'configure 'set-version
10601 (lambda _
10602 (let* ((version-java "src/main/java/org/HdrHistogram/Version.java")
10603 (template (string-append version-java ".template")))
10604 (copy-file template version-java)
10605 (substitute* version-java
10606 (("\\$VERSION\\$") ,version)
10607 (("\\$BUILD_TIME\\$") "0"))
10608 #t))))))
10609 (native-inputs
10610 `(("junit" ,java-junit)
10611 ("hamcrest" ,java-hamcrest-core)))
10612 (home-page "https://hdrhistogram.github.io/HdrHistogram")
10613 (synopsis "High dynamic range histogram")
10614 (description "Hdrhistogram creates histograms that support
10615recording and analyzing sampled data value counts across a configurable integer
10616value range with configurable value precision within the range. Value precision
10617is expressed as the number of significant digits in the value recording, and
10618provides control over value quantization behavior across the value range and
10619the subsequent value resolution at any given level.")
10620 (license license:public-domain)))
10621
10622(define-public java-cofoja
10623 (package
10624 (name "java-cofoja")
10625 (version "1.3")
10626 (source (origin
10627 (method git-fetch)
10628 (uri (git-reference
10629 (url "https://github.com/nhatminhle/cofoja")
10630 (commit (string-append "v" version))))
10631 (file-name (string-append "java-cofoja-" version "-checkout"))
10632 (sha256
10633 (base32
10634 "0p7sz8y5xgpi5rx1qwn6587fkd52qr3ha3ybh14gqcyxhikl525w"))))
10635 (build-system ant-build-system)
10636 (arguments
10637 `(#:build-target "dist"
10638 #:test-target "test"
10639 #:jdk ,icedtea-8
10640 #:make-flags
10641 (list "-Ddist.dir=dist")
10642 #:modules ((guix build ant-build-system)
10643 (guix build java-utils)
10644 (guix build utils)
10645 (srfi srfi-1)
10646 (ice-9 match))
10647 #:phases
10648 (modify-phases %standard-phases
10649 ;; The bulid system ignores the class path the ant-build-system sets
10650 ;; up and instead expects to find all dependencies in the "lib"
10651 ;; directory.
10652 (add-after 'unpack 'create-libdir
10653 (lambda* (#:key inputs #:allow-other-keys)
10654 (mkdir-p "lib")
10655 (for-each
10656 (lambda (file)
10657 (let ((target (string-append "lib/" (basename file))))
10658 (unless (file-exists? target)
10659 (symlink file target))))
10660 (append-map (match-lambda
10661 ((label . dir)
10662 (find-files dir "\\.jar$")))
10663 inputs))
10664 #t))
10665 (replace 'install (install-jars "dist")))))
10666 (inputs
10667 (list java-asm))
10668 (native-inputs
10669 (list java-junit))
10670 (home-page "https://github.com/nhatminhle/cofoja")
10671 (synopsis "Contracts for Java")
10672 (description "Contracts for Java, or Cofoja for short, is a contract
10673programming framework and test tool for Java, which uses annotation processing
10674and bytecode instrumentation to provide run-time checking. (In particular,
10675this is not a static analysis tool.)")
10676 (license license:lgpl3+)))
10677
10678(define-public java-aopalliance
10679 (package
10680 (name "java-aopalliance")
10681 (version "1.0")
10682 (source (origin
10683 (method git-fetch)
10684 ;; Note: this git repository is not official, but contains the
10685 ;; source code that is in the CVS repository. Downloading the
10686 ;; tarball from sourceforge is undeterministic, and the cvs download
10687 ;; fails.
10688 (uri (git-reference
10689 (url "https://github.com/hoverruan/aopalliance")
10690 (commit "0d7757ae204e5876f69431421fe9bc2a4f01e8a0")))
10691 (file-name (string-append name "-" version))
10692 (sha256
10693 (base32
10694 "0rsg2b0v3hxlq2yk1i3m2gw3xwq689j3cwx9wbxvqfpdcjbca0qr"))))
10695 (build-system ant-build-system)
10696 (arguments
10697 `(#:jar-name "java-aopalliance.jar"
10698 #:jdk ,icedtea-8
10699 #:tests? #f; no tests
10700 #:source-dir "aopalliance/src/main"
10701 #:phases
10702 (modify-phases %standard-phases
10703 (add-before 'install 'create-pom
10704 (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version))
10705 (replace 'install
10706 (install-from-pom "pom.xml")))))
10707 (home-page "https://aopalliance.sourceforge.net")
10708 (synopsis "Aspect-Oriented Programming")
10709 (description "The AOP Alliance project is a joint project between several
10710software engineering people who are interested in Aspect-Oriented Programming
10711(AOP) and Java.")
10712 (license license:public-domain)))
10713
10714(define-public java-javax-inject
10715 (package
10716 (name "java-javax-inject")
10717 (version "1")
10718 (source (origin
10719 (method git-fetch)
10720 (uri (git-reference
10721 (url "https://github.com/javax-inject/javax-inject")
10722 (commit version)))
10723 (file-name (git-file-name name version))
10724 (sha256
10725 (base32
10726 "1rspl0nkvk1jif6nccikw93xic6ljj2b6kpy2mffwi2mnvc13j7x"))))
10727 (build-system ant-build-system)
10728 (arguments
10729 `(#:jar-name "java-javax-inject.jar"
10730 #:tests? #f; no tests
10731 #:phases
10732 (modify-phases %standard-phases
10733 (replace 'install
10734 (install-from-pom "pom.xml")))))
10735 (home-page "https://github.com/javax-inject/javax-inject")
10736 (synopsis "JSR-330: Dependency Injection for Java")
10737 (description "This package specifies a means for obtaining objects in such
10738a way as to maximize reusability, testability and maintainability compared to
10739traditional approaches such as constructors, factories, and service locators
10740(e.g., JNDI). This process, known as dependency injection, is beneficial to
10741most nontrivial applications.
10742
10743Many types depend on other types. For example, a @var{Stopwatch} might depend
10744on a @var{TimeSource}. The types on which a type depends are known as its
10745dependencies. The process of finding an instance of a dependency to use at run
10746time is known as resolving the dependency. If no such instance can be found,
10747the dependency is said to be unsatisfied, and the application is broken.")
10748 (license license:asl2.0)))
10749
10750(define-public java-guice
10751 (package
10752 (name "java-guice")
10753 (version "4.1")
10754 (source (origin
10755 (method git-fetch)
10756 (uri (git-reference
10757 (url "https://github.com/google/guice")
10758 (commit version)))
10759 (file-name (git-file-name name version))
10760 (modules '((guix build utils)))
10761 (snippet
10762 `(begin
10763 (for-each delete-file (find-files "." ".*.jar")) #t))
10764 (sha256
10765 (base32
10766 "18im5hdfl4q1b9chww2s1ii60sn3ydyyar32a2sf2p2g8zlbdswq"))))
10767 (build-system ant-build-system)
10768 (arguments
10769 `(#:jar-name "java-guice.jar"
10770 #:jdk ,icedtea-8
10771 #:tests? #f; FIXME: tests are not in a java sub directory
10772 #:source-dir "core/src"
10773 #:phases
10774 (modify-phases %standard-phases
10775 (add-after 'unpack 'make-files-writable
10776 (lambda _
10777 (for-each make-file-writable (find-files "."))
10778 #t))
10779 (replace 'install
10780 (install-from-pom "core/pom.xml")))))
10781 (propagated-inputs
10782 (list java-aopalliance
10783 java-cglib
10784 java-guava
10785 java-javax-inject
10786 java-guice-parent-pom))
10787 (home-page "https://github.com/google/guice")
10788 (synopsis "Lightweight dependency injection framework")
10789 (description "Guice is a lightweight dependency injection framework for
10790Java 6 and above.")
10791 (license license:asl2.0)))
10792
10793(define-public java-guice-servlet
10794 (package
10795 (inherit java-guice)
10796 (name "java-guice-servlet")
10797 (arguments
10798 `(#:jar-name "guice-servlet.jar"
10799 #:source-dir "extensions/servlet/src/"
10800 #:jdk ,icedtea-8
10801 #:tests? #f ; FIXME: not in a java subdir
10802 #:phases
10803 (modify-phases %standard-phases
10804 (add-after 'unpack 'make-files-writable
10805 (lambda _
10806 (for-each make-file-writable (find-files "."))
10807 #t)))))
10808 (inputs
10809 `(("guice" ,java-guice)
10810 ("servlet" ,java-classpathx-servletapi)
10811 ,@(package-inputs java-guice)))))
10812
10813(define java-guice-parent-pom
10814 (package
10815 (inherit java-guice)
10816 (name "java-guice-parent-pom")
10817 (arguments
10818 `(#:tests? #f
10819 #:phases
10820 (modify-phases %standard-phases
10821 (delete 'configure)
10822 (delete 'build)
10823 (add-after 'install 'install-extensions
10824 (install-pom-file "extensions/pom.xml"))
10825 (replace 'install
10826 (install-pom-file "pom.xml")))))
10827 (propagated-inputs
10828 `(("java-google-parent-pom" ,java-google-parent-pom-5)))))
10829
10830(define java-google-parent-pom-5
10831 (package
10832 (name "java-google-parent-pom")
10833 (version "5")
10834 (source (origin
10835 (method git-fetch)
10836 (uri (git-reference
10837 (url "https://github.com/google/google-maven-parents")
10838 (commit (string-append "google-" version))))
10839 (file-name (git-file-name name version))
10840 (sha256
10841 (base32
10842 "0zb7hx24p8k8rfdvix2vsbfqn73jhrycdndvhf8j5gbii9wbqibv"))))
10843 (build-system ant-build-system)
10844 (arguments
10845 `(#:tests? #f
10846 #:phases
10847 (modify-phases %standard-phases
10848 (delete 'configure)
10849 (delete 'build)
10850 (replace 'install
10851 (install-pom-file "pom.xml")))))
10852 (home-page "https://github.com/google/google-maven-parents")
10853 (synopsis "Google parent pom")
10854 (description "This package contains the Maven parent POM for other Google
10855Java projects.")
10856 (license license:asl2.0)))
10857
10858(define-public java-assertj
10859 (package
10860 (name "java-assertj")
10861 (version "3.8.0")
10862 (source (origin
10863 (method git-fetch)
10864 (uri (git-reference
10865 (url "https://github.com/joel-costigliola/assertj-core")
10866 (commit (string-append "assertj-core-" version))))
10867 (file-name (git-file-name name version))
10868 (sha256
10869 (base32
10870 "1k35cg2in7pzk4pbdjryr0pll5lgk1r6ngrn0j8cdlgi7w8zh2d1"))))
10871 (build-system ant-build-system)
10872 (arguments
10873 `(#:jar-name "java-assertj.jar"
10874 #:jdk ,icedtea-8
10875 #:source-dir "src/main/java"
10876 #:tests? #f)); depends on tng-junit which depends on assertj
10877 (inputs
10878 `(("cglib" ,java-cglib)
10879 ("junit" ,java-junit)
10880 ("hamcrest" ,java-hamcrest-core)))
10881 (native-inputs
10882 `(("mockito" ,java-mockito-1)))
10883 (home-page "https://joel-costigliola.github.io/assertj/index.html")
10884 (synopsis "Fluent assertions for java")
10885 (description "AssertJ core is a Java library that provides a fluent
10886interface for writing assertions. Its main goal is to improve test code
10887readability and make maintenance of tests easier.")
10888 (license license:asl2.0)))
10889
10890(define-public java-jboss-javassist
10891 (package
10892 (name "java-jboss-javassist")
10893 (version "3.21.0")
10894 (source (origin
10895 (method git-fetch)
10896 (uri (git-reference
10897 (url "https://github.com/jboss-javassist/javassist")
10898 (commit
10899 (string-append "rel_"
10900 (string-map
10901 (lambda (x) (if (eq? x #\.) #\_ x)) version)
10902 "_ga"))))
10903 (file-name (git-file-name name version))
10904 (sha256
10905 (base32
10906 "0h3zlcyqiaq01fspm69h7vki67raw305w89p4ha8vlhpzw02qifm"))
10907 (modules '((guix build utils)))
10908 (snippet
10909 '(begin
10910 (delete-file "javassist.jar")))))
10911 (build-system ant-build-system)
10912 (arguments
10913 `(#:jar-name "java-jboss-javassist.jar"
10914 #:jdk ,icedtea-8
10915 #:source-dir "src/main"
10916 #:tests? #f; FIXME: requires junit-awtui and junit-swingui from junit3
10917 #:phases
10918 (modify-phases %standard-phases
10919 (add-after 'unpack 'make-files-writable
10920 (lambda _
10921 (for-each make-file-writable (find-files "."))
10922 #t)))))
10923 (native-inputs
10924 `(("junit" ,java-junit)))
10925 (home-page "https://github.com/jboss-javassist/javassist")
10926 (synopsis "Java bytecode engineering toolkit")
10927 (description "Javassist (JAVA programming ASSISTant) makes Java bytecode
10928manipulation simple. It is a class library for editing bytecodes in Java; it
10929enables Java programs to define a new class at runtime and to modify a class
10930file when the JVM loads it.")
10931 (license (list license:gpl2 license:cddl1.0)))); either gpl2 only or cddl.
10932
10933(define-public java-jcommander
10934 (package
10935 (name "java-jcommander")
10936 (version "1.71")
10937 (source (origin
10938 (method git-fetch)
10939 (uri (git-reference
10940 (url "https://github.com/cbeust/jcommander")
10941 (commit version)))
10942 (file-name (git-file-name name version))
10943 (sha256
10944 (base32
10945 "12vcpc19sd7jhvjgp7xz1qjanfix162xb3x2q5zah93rjklj1h57"))))
10946 (build-system ant-build-system)
10947 (arguments
10948 `(#:jar-name "java-jcommander.jar"
10949 #:jdk ,icedtea-8
10950 #:tests? #f; requires testng which depends on jcommander
10951 #:source-dir "src/main/java"))
10952 (home-page "https://jcommander.org")
10953 (synopsis "Command line parameters parser")
10954 (description "JCommander is a very small Java framework that makes it
10955trivial to parse command line parameters. Parameters are declared with
10956annotations.")
10957 (license license:asl2.0)))
10958
10959(define-public java-bsh
10960 (package
10961 (name "java-bsh")
10962 (version "2.1.1")
10963 (source (origin
10964 (method git-fetch)
10965 (uri (git-reference
10966 (url "https://github.com/beanshell/beanshell")
10967 (commit version)))
10968 (file-name (git-file-name name version))
10969 (sha256
10970 (base32
10971 "1a6y46yz2ba4mnlfv4bpd5pmzhgxrzk3s10xp05jz377nbp2izwg"))
10972 (modules '((guix build utils)))
10973 (snippet
10974 '(begin
10975 ;; Delete bundled third-party jar archives.
10976 (for-each delete-file (find-files "." ".*.jar$"))
10977 (for-each (lambda (file) (chmod file #o644))
10978 (find-files "." "."))
10979 #t))))
10980 (build-system ant-build-system)
10981 (arguments
10982 `(#:build-target "jarall"
10983 #:test-target "junit-tests-all"
10984 #:make-flags (list "-DDATE" "(no date for reproducibility)")
10985 #:phases
10986 (modify-phases %standard-phases
10987 (add-before 'check 'fix-test
10988 (lambda _
10989 (substitute* "tests/junitTests/src/bsh/Issue_55_Test.java"
10990 ((" BshScriptEngineFactory") " bsh.engine.BshScriptEngineFactory"))))
10991 (replace 'install
10992 (install-from-pom "pom.xml")))))
10993 (inputs
10994 (list java-classpathx-servletapi java-commons-bsf))
10995 (native-inputs
10996 (list java-junit javacc-3))
10997 (home-page "http://beanshell.org/")
10998 (synopsis "Lightweight Scripting for Java")
10999 (description "BeanShell is a small, free, embeddable Java source
11000interpreter with object scripting language features, written in Java.
11001BeanShell dynamically executes standard Java syntax and extends it with common
11002scripting conveniences such as loose types, commands, and method closures like
11003those in Perl and JavaScript.")
11004 (license license:asl2.0)))
11005
11006(define-public java-fest-util
11007 (package
11008 (name "java-fest-util")
11009 (version "1.2.5")
11010 (source (origin
11011 (method git-fetch)
11012 (uri (git-reference
11013 (url "https://github.com/alexruiz/fest-util/")
11014 (commit (string-append "fest-util-" version))))
11015 (file-name (git-file-name name version))
11016 (sha256
11017 (base32
11018 "02kgal7v85snyyvcsxvn4qphid455f4smh2wri1il8d9asw0djbz"))))
11019 (build-system ant-build-system)
11020 (arguments
11021 `(#:jar-name "java-fest-util.jar"
11022 #:source-dir "src/main/java"))
11023 (native-inputs
11024 `(("junit" ,java-junit)
11025 ("hamcrest" ,java-hamcrest-core)))
11026 (home-page "https://github.com/alexruiz/fest-util")
11027 (synopsis "FEST common utilities")
11028 (description "Common utilities used in all FEST module.")
11029 (license license:asl2.0)))
11030
11031(define-public java-fest-test
11032 (package
11033 (name "java-fest-test")
11034 (version "2.1.0")
11035 (source (origin
11036 (method git-fetch)
11037 (uri (git-reference
11038 (url "https://github.com/alexruiz/fest-test/")
11039 (commit (string-append "fest-test-" version))))
11040 (file-name (git-file-name name version))
11041 (sha256
11042 (base32
11043 "0mg1d2jfh7kbx2c40dchbjr6d8pv59snsyb13mfxsr7xk5n69qbn"))))
11044 (build-system ant-build-system)
11045 (arguments
11046 `(#:jar-name "java-fest-test.jar"
11047 #:source-dir "src/main/java"
11048 #:tests? #f)); no tests
11049 (inputs
11050 `(("junit" ,java-junit)))
11051 (home-page "https://github.com/alexruiz/fest-test")
11052 (synopsis "Common FEST testing infrastructure")
11053 (description "Fest-test contains the common FEST testing infrastructure.")
11054 (license license:asl2.0)))
11055
11056(define-public java-fest-assert
11057 (package
11058 (name "java-fest-assert")
11059 (version "2.0M10")
11060 (source (origin
11061 (method git-fetch)
11062 (uri (git-reference
11063 (url "https://github.com/alexruiz/fest-assert-2.x/")
11064 (commit (string-append "fest-assert-core-" version))))
11065 (file-name (git-file-name name version))
11066 (sha256
11067 (base32
11068 "1cp8zzyag3s85fz2w68sda9zzaal1y5f9wl8g72wkm12an40w6by"))))
11069 (build-system ant-build-system)
11070 (arguments
11071 `(#:jar-name "java-fest-assert.jar"
11072 #:source-dir "src/main/java"
11073 #:test-exclude
11074 (list
11075 "**/Abstract*.java"
11076 "**/*BaseTest.java"
11077 ;; Unable to set MockitoNamingPolicy on cglib generator which creates FastClasses
11078 "**/MessageFormatter_format_Test.java"
11079 "**/internal/*/*_assert*_Test.java")))
11080 (inputs
11081 (list java-fest-util))
11082 (native-inputs
11083 (list java-junit
11084 java-fest-test
11085 java-hamcrest-core
11086 java-mockito-1
11087 java-cglib
11088 java-objenesis))
11089 (home-page "https://github.com/alexruiz/fest-assert-2.x")
11090 (synopsis "FEST fluent assertions")
11091 (description "FEST-Assert provides a fluent interface for assertions.")
11092 (license license:asl2.0)))
11093
11094(define-public java-testng
11095 (package
11096 (name "java-testng")
11097 (version "6.14.3")
11098 (source (origin
11099 (method git-fetch)
11100 (uri (git-reference
11101 (url "https://github.com/cbeust/testng")
11102 (commit version)))
11103 (file-name (string-append name "-" version "-checkout"))
11104 (sha256
11105 (base32
11106 "0y6vq30i5g276kw0v2bhbvci22ijg7ax49ap2611yqlhbs4d6dqv"))))
11107 (build-system ant-build-system)
11108 (arguments
11109 (list
11110 #:jdk icedtea-8; java.util.function
11111 #:jar-name "java-testng.jar"
11112 #:source-dir "src/main/java"
11113 #:phases
11114 '(modify-phases %standard-phases
11115 (add-after 'unpack 'delete-failing-tests
11116 (lambda _
11117 ;; FIXME: I don't know why these tests fail
11118 (substitute* "src/test/resources/testng.xml"
11119 ;; expected:<[0]> but was:<[3]>
11120 (("<class name=\"test.configuration.github1625.TestRunnerIssue1625\"/>") "")
11121 ;; expected [3] but found [2]
11122 (("<class name=\"test.serviceloader.ServiceLoaderTest\" />") "")
11123 ;; This is a parallel test and we've observed that it fails
11124 ;; sometimes.
11125 (("<class name=\"test.dataprovider.DataProviderTest\"/>") ""))))
11126 ;; We don't have groovy
11127 (add-after 'unpack 'delete-groovy-tests
11128 (lambda _
11129 (delete-file-recursively "src/test/java/test/dependent/issue1648/")
11130 (substitute* "src/test/resources/testng.xml"
11131 (("<class name=\"test.dependent.issue1648.TestRunner\"/>") ""))))
11132 (add-before 'build 'copy-resources
11133 (lambda _
11134 (copy-recursively "src/main/resources" "build/classes")))
11135 (add-before 'check 'copy-test-resources
11136 (lambda _
11137 (copy-recursively "src/test/resources" "build/test-classes")))
11138 (replace 'check
11139 (lambda _
11140 (invoke "ant" "compile-tests")
11141 ;; we don't have groovy
11142 (substitute* "src/test/resources/testng.xml"
11143 (("<class name=\"test.groovy.GroovyTest\" />") ""))
11144 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11145 ":build/classes"
11146 ":build/test-classes")
11147 "-Dtest.resources.dir=src/test/resources"
11148 "org.testng.TestNG" "src/test/resources/testng.xml"))))))
11149 (propagated-inputs
11150 (list java-junit
11151 java-jsr305
11152 java-bsh
11153 java-jcommander
11154 java-guice
11155 java-snakeyaml))
11156 (native-inputs
11157 (list java-guava
11158 java-javax-inject
11159 java-hamcrest-all
11160 java-assertj
11161 java-mockito-1
11162 java-cglib
11163 java-aopalliance))
11164 (home-page "https://testng.org")
11165 (synopsis "Testing framework")
11166 (description "TestNG is a testing framework inspired from JUnit and NUnit
11167but introducing some new functionalities that make it more powerful and easier
11168to use.")
11169 (license license:asl2.0)))
11170
11171(define-public java-jnacl
11172 (let ((commit "094e819afdd63ea81a499b3bcb42a271006bebd9")
11173 (revision "2"))
11174 (package
11175 (name "java-jnacl")
11176 (version (string-append "0.1.0-" revision "." (string-take commit 7)))
11177 (source (origin
11178 (method git-fetch)
11179 (uri (git-reference
11180 (url "https://github.com/neilalexander/jnacl")
11181 (commit commit)))
11182 (file-name (git-file-name name version))
11183 (sha256
11184 (base32
11185 "1d6g6xhn83byv5943n7935wwjsk0ibk0qdvqgr699qqgqqmwisbb"))))
11186 (build-system ant-build-system)
11187 (arguments
11188 `(#:jar-name "jnacl.jar"
11189 #:source-dir "src/main/java"
11190 #:jdk ,icedtea-8
11191 #:phases
11192 (modify-phases %standard-phases
11193 (add-before 'build 'fix-tests
11194 (lambda _
11195 (substitute* '("src/test/java/com/neilalexander/jnacl/NaClTest.java"
11196 "src/test/java/com/neilalexander/jnacl/NaclSecretBoxTest.java")
11197 (("assertions.Assertions") "assertions.api.Assertions"))
11198 #t))
11199 (replace 'check
11200 (lambda _
11201 (invoke "ant" "compile-tests")
11202 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11203 ":build/classes"
11204 ":build/test-classes")
11205 "org.testng.TestNG" "-testclass"
11206 "build/test-classes/com/neilalexander/jnacl/NaclSecretBoxTest.class")
11207 (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
11208 ":build/classes"
11209 ":build/test-classes")
11210 "org.testng.TestNG" "-testclass"
11211 "build/test-classes/com/neilalexander/jnacl/NaClTest.class"))))))
11212 (native-inputs
11213 (list java-testng java-fest-util java-fest-assert))
11214 (home-page "https://github.com/neilalexander/jnacl")
11215 (synopsis "Java implementation of NaCl")
11216 (description "Pure Java implementation of the NaCl: Networking and
11217Cryptography library.")
11218 (license license:bsd-2))))
11219
11220(define-public java-mvel2
11221 (package
11222 (name "java-mvel2")
11223 (version "2.3.1")
11224 (source (origin
11225 (method url-fetch)
11226 (uri (string-append "https://github.com/mvel/mvel/archive/mvel2-"
11227 version ".Final.tar.gz"))
11228 (sha256
11229 (base32
11230 "01ph5s9gm16l2qz58lg21w6fna7xmmrj7f9bzqr1jim7h9557d3z"))))
11231 (build-system ant-build-system)
11232 (arguments
11233 `(#:jar-name "mvel2.jar"
11234 #:source-dir "src/main/java"
11235 #:test-exclude
11236 (list "**/Abstract*.java"
11237 ;; Base class with no tests
11238 "**/MVELThreadTest.java")
11239 #:phases
11240 (modify-phases %standard-phases
11241 (add-after 'install 'install-bin
11242 (lambda* (#:key outputs #:allow-other-keys)
11243 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
11244 (mkdir-p bin)
11245 (with-output-to-file (string-append bin "/mvel2")
11246 (lambda _
11247 (display
11248 (string-append
11249 "#!" (which "bash") "\n"
11250 "if [ \"$#\" -ne \"2\" ]; then\n"
11251 "echo 'Usage: mvel2 <script> <out.dir>'\n"
11252 "exit\n"
11253 "fi\n"
11254 "java -Dout.dir=$2 -cp " (getenv "CLASSPATH")
11255 ":" (assoc-ref outputs "out") "/share/java/mvel2.jar"
11256 " org.mvel2.sh.Main $1"))))
11257 (chmod (string-append bin "/mvel2") #o755))
11258 #t)))))
11259 (native-inputs
11260 `(("junit" ,java-junit)
11261 ("hamcrest" ,java-hamcrest-core)))
11262 (home-page "https://github.com/mvel/mvel")
11263 (synopsis "MVFLEX Expression Language")
11264 (description "MVEL has largely been inspired by Java syntax, but has some
11265fundamental differences aimed at making it more efficient as an expression
11266language, such as operators that directly support collection, array and string
11267matching, as well as regular expressions. MVEL is used to evaluate expressions
11268written using Java syntax.
11269
11270In addition to the expression language, MVEL serves as a templating language for
11271configuration and string construction.")
11272 (license license:asl2.0)))
11273
11274(define-public java-commons-jexl-2
11275 (package
11276 (name "java-commons-jexl")
11277 (version "2.1.1")
11278 (source (origin
11279 (method url-fetch)
11280 (uri (string-append "mirror://apache/commons/jexl/source/"
11281 "commons-jexl-" version "-src.tar.gz"))
11282 (sha256
11283 (base32
11284 "1ai7632bwwaxglb0nbpblpr2jw5g20afrsaq372ipkphi3ncy1jz"))))
11285 (build-system ant-build-system)
11286 (arguments
11287 `(#:jar-name "commons-jexl-2.jar"
11288 #:jdk ,icedtea-8
11289 #:source-dir "src/main/java"
11290 #:phases
11291 (modify-phases %standard-phases
11292 (add-before 'check 'disable-broken-tests
11293 (lambda* (#:key inputs #:allow-other-keys)
11294 (with-directory-excursion "src/test/java/org/apache/commons/jexl2/"
11295 (substitute* "ArithmeticTest.java"
11296 (("asserter.assertExpression\\(\"3 / 0\"") "//")
11297 (("asserter.assertExpression\\(\"imanull") "//"))
11298 ;; This test fails with "ambiguous method invocation"
11299 (delete-file "CacheTest.java")
11300 ;; This test doesn't have access to the temp directory
11301 (substitute* "ClassCreatorTest.java"
11302 (("java.io.tmpdir") "user.dir"))
11303 ;; This test fails in trying to detect whether it can run.
11304 (substitute* "ClassCreator.java"
11305 (("boolean canRun =.*") "boolean canRun = false;\n"))
11306 ;; ...and these tests depend on it.
11307 (delete-file "scripting/JexlScriptEngineOptionalTest.java")
11308 (delete-file "scripting/JexlScriptEngineTest.java"))
11309 #t))
11310 (add-before 'build 'run-javacc
11311 (lambda _
11312 (with-directory-excursion "src/main/java/org/apache/commons/jexl2/parser/"
11313 (invoke "java" "jjtree" "Parser.jjt")
11314 (invoke "java" "javacc" "Parser.jj"))
11315 #t)))))
11316 (inputs
11317 (list java-commons-logging-minimal))
11318 (native-inputs
11319 (list java-junit java-hamcrest-core javacc-4))
11320 (home-page "https://commons.apache.org/proper/commons-jexl/")
11321 (synopsis "Java Expression Language")
11322 (description "JEXL is a library intended to facilitate the implementation
11323of dynamic and scripting features in applications and frameworks written in
11324Java. JEXL implements an Expression Language based on some extensions to the
11325JSTL Expression Language supporting most of the constructs seen in
11326shell-script or ECMAScript. Its goal is to expose scripting features usable
11327by technical operatives or consultants working with enterprise platforms.")
11328 (license license:asl2.0)))
11329
11330(define-public java-lz4
11331 (package
11332 (name "java-lz4")
11333 (version "1.4.0")
11334 (source (origin
11335 (method git-fetch)
11336 (uri (git-reference
11337 (url "https://github.com/lz4/lz4-java")
11338 (commit version)))
11339 (file-name (git-file-name name version))
11340 (sha256
11341 (base32
11342 "0ydjakhv3cz34mfvv14qrh2ksdxifgjwwagjy7r46qr3f68hnf6y"))))
11343 (build-system ant-build-system)
11344 (arguments
11345 `(#:jar-name "lz4.jar"
11346 #:jdk ,icedtea-8
11347 #:source-dir "src/java:src/java-unsafe"
11348 #:tests? #f; FIXME: requires more dependencies
11349 #:phases
11350 (modify-phases %standard-phases
11351 (add-after 'unpack 'make-files-writable
11352 (lambda _
11353 (for-each make-file-writable (find-files "."))
11354 #t))
11355 (add-before 'configure 'generate-source
11356 (lambda _
11357 (with-directory-excursion "src/build/source_templates"
11358 (invoke "mvel2" "../gen_sources.mvel" "../../java"))
11359 #t)))))
11360 (native-inputs
11361 `(("mvel" ,java-mvel2)))
11362 (home-page "https://jpountz.github.io/lz4-java")
11363 (synopsis "Compression algorithm")
11364 (description "LZ4 - Java is a Java port of the popular lz4 compression
11365algorithms and xxHash hashing algorithm.")
11366 (license license:asl2.0)))
11367
11368(define-public java-bouncycastle
11369 (package
11370 (name "java-bouncycastle")
11371 (version "1.67")
11372 (source (origin
11373 (method git-fetch)
11374 (uri (git-reference
11375 (url "http://git.bouncycastle.org/repositories/bc-java")
11376 ;(url "https://github.com/bcgit/bc-java")
11377 (commit (string-append "r1rv" (substring version 2 4)))))
11378 (file-name (git-file-name name version))
11379 (sha256
11380 (base32
11381 "1449q7fyh03s1q0bqljcrhgacwcyqmg2bbvb3z084avgapwsainz"))
11382 (modules '((guix build utils)))
11383 (snippet
11384 '(begin
11385 (for-each delete-file
11386 (find-files "." "\\.jar$"))
11387 #t))))
11388 (build-system ant-build-system)
11389 (arguments
11390 `(#:jdk ,icedtea-8
11391 #:tests? #f
11392 #:phases
11393 (modify-phases %standard-phases
11394 (replace 'build
11395 (lambda _
11396 (invoke "ant" "-f" "ant/jdk15+.xml" "build-provider")
11397 (invoke "ant" "-f" "ant/jdk15+.xml" "build")))
11398 ;; FIXME: the tests freeze.
11399 ;; (replace 'check
11400 ;; (lambda _
11401 ;; (invoke "ant" "-f" "ant/jdk15+.xml" "test")))
11402 (replace 'install
11403 (install-jars "build/artifacts/jdk1.5/jars")))))
11404 (inputs
11405 (list java-javax-mail))
11406 (native-inputs
11407 `(("unzip" ,unzip)
11408 ("junit" ,java-junit)
11409 ("java-native-access" ,java-native-access)
11410 ("java-native-access-platform" ,java-native-access-platform)))
11411 (home-page "https://www.bouncycastle.org")
11412 (synopsis "Cryptographic library")
11413 (description "Bouncy Castle is a cryptographic library for the Java
11414programming language.")
11415 (license license:expat)))
11416
11417(define-public java-lmax-disruptor
11418 (package
11419 (name "java-lmax-disruptor")
11420 (version "3.4.4")
11421 (source (origin
11422 (method git-fetch)
11423 (uri (git-reference
11424 (url "https://github.com/LMAX-Exchange/disruptor")
11425 (commit version)))
11426 (file-name (git-file-name name version))
11427 (sha256
11428 (base32
11429 "02c5kp3n8a73dq9ay7ar53s1k3x61z9yzc5ikqb03m6snr1wpfqn"))))
11430 (build-system ant-build-system)
11431 (arguments
11432 `(#:jar-name "java-lmax-disruptor.jar"
11433 #:jdk ,icedtea-8
11434 #:tests? #f)); tests hang
11435 (inputs
11436 `(("junit" ,java-junit)
11437 ("java-hdrhistogram" ,java-hdrhistogram)
11438 ("java-jmock" ,java-jmock)
11439 ("java-jmock-legacy" ,java-jmock-legacy)
11440 ("java-jmock-junit4" ,java-jmock-junit4)
11441 ("java-hamcrest-all" ,java-hamcrest-all)))
11442 (native-inputs
11443 `(("cglib" ,java-cglib)
11444 ("objenesis" ,java-objenesis)))
11445 (home-page "https://www.lmax.com/disruptor")
11446 (synopsis "High performance inter-thread communication")
11447 (description "LMAX Disruptor is a software pattern and software component
11448for high performance inter-thread communication that avoids the need for
11449message queues or resource locking.")
11450 (license license:asl2.0)))
11451
11452(define-public java-conversant-disruptor
11453 (package
11454 (name "java-conversant-disruptor")
11455 (version "1.2.19")
11456 (source (origin
11457 (method git-fetch)
11458 (uri (git-reference
11459 (url "https://github.com/conversant/disruptor")
11460 (commit version)))
11461 (file-name (git-file-name name version))
11462 (sha256
11463 (base32
11464 "0gx1dm7sfg7pa05cs4qby10gfcplai5b5lf1f7ik1a76dh3vhl0g"))))
11465 (build-system ant-build-system)
11466 (arguments
11467 `(#:jar-name "java-conversant-disruptor.jar"
11468 #:source-dir "src/main/java"
11469 #:phases
11470 (modify-phases %standard-phases
11471 (add-before 'build 'copy-resources
11472 (lambda _
11473 (copy-recursively "src/main/resources" "build/classes")))
11474 (add-before 'build 'remove-module
11475 (lambda _
11476 (delete-file "src/main/java/module-info.java"))))))
11477 (native-inputs
11478 (list java-junit))
11479 (home-page "https://github.com/conversant/disruptor")
11480 (synopsis "High performance intra-thread communication")
11481 (description "Conversant Disruptor is the highest performing intra-thread
11482transfer mechanism available in Java. Conversant Disruptor is an implementation
11483of this type of ring buffer that has almost no overhead and that exploits a
11484particularly simple design.")
11485 (license license:asl2.0)))
11486
11487(define-public java-jctools-core-1
11488 (package
11489 (name "java-jctools-core")
11490 (version "1.2.1")
11491 (source (origin
11492 (method git-fetch)
11493 (uri (git-reference
11494 (url "https://github.com/JCTools/JCTools")
11495 (commit (string-append "v" version))))
11496 (file-name (git-file-name name version))
11497 (sha256
11498 (base32
11499 "105my29nwd4djvdllmq8s3jdzbyplbkxzwmddxiiilb4yqr1pghb"))))
11500 (build-system ant-build-system)
11501 (arguments
11502 `(#:jar-name "java-jctools-core.jar"
11503 #:source-dir "jctools-core/src/main/java"
11504 #:test-dir "jctools-core/src/test"
11505 ;; The tests timeout on some architectures.
11506 #:tests? ,(not (or (target-aarch64?)
11507 (%current-target-system)))))
11508 (native-inputs
11509 (list java-junit java-hamcrest-all))
11510 (home-page "https://github.com/JCTools/JCTools")
11511 (synopsis "Concurrency tools for Java")
11512 (description "This library implements concurrent data structures that are
11513not natively available in Java.")
11514 (license license:asl2.0)))
11515
11516(define-public java-commons-bcel
11517 (package
11518 (name "java-commons-bcel")
11519 (version "6.1")
11520 (source (origin
11521 (method url-fetch)
11522 (uri (string-append "mirror://apache/commons/bcel/source/bcel-"
11523 version "-src.tar.gz"))
11524 (sha256
11525 (base32
11526 "0j3x1rxd673k07psclk8k13rqh0x0mf2yy5qiwkiw4z3afa568jy"))))
11527 (build-system ant-build-system)
11528 (arguments
11529 `(#:jar-name "bcel.jar"
11530 #:jdk ,icedtea-8
11531 #:source-dir "src/main/java"
11532 #:test-dir "src/test/java"
11533 ;; FIXME: Tests require the unpackaged jna.
11534 #:tests? #f))
11535 (home-page "https://commons.apache.org/proper/commons-bcel/")
11536 (synopsis "Byte code engineering library")
11537 (description "The Byte Code Engineering Library (Apache Commons BCEL) is
11538intended to give users a convenient way to analyze, create, and
11539manipulate (binary) Java class files. Classes are represented by objects
11540which contain all the symbolic information of the given class: methods, fields
11541and byte code instructions, in particular.
11542
11543Such objects can be read from an existing file, be transformed by a
11544program (e.g. a class loader at run-time) and written to a file again. An
11545even more interesting application is the creation of classes from scratch at
11546run-time. The @dfn{Byte Code Engineering Library} (BCEL) may be also useful
11547if you want to learn about the @dfn{Java Virtual Machine} (JVM) and the format
11548of Java @code{.class} files.")
11549 (license license:asl2.0)))
11550
11551(define-public java-xerial-core
11552 (package
11553 (name "java-xerial-core")
11554 (version "2.1")
11555 (source (origin
11556 (method url-fetch)
11557 (uri (string-append "https://github.com/xerial/xerial-java/archive/"
11558 version ".tar.gz"))
11559 (file-name (string-append name "-" version ".tar.gz"))
11560 (sha256
11561 (base32
11562 "0d3g863i41bgalpa4xr3vm1h140l091n8iwgq5qvby5yivns9y8d"))))
11563 (build-system ant-build-system)
11564 (arguments
11565 `(#:jar-name "xerial-core.jar"
11566 #:source-dir "xerial-core/src/main/java"
11567 #:test-dir "xerial-core/src/test"
11568 #:phases
11569 (modify-phases %standard-phases
11570 (add-before 'build 'copy-resources
11571 (lambda _
11572 (copy-recursively "xerial-core/src/main/resources"
11573 "build/classes")
11574 #t)))))
11575 (native-inputs
11576 `(("junit" ,java-junit)
11577 ("hamcrest" ,java-hamcrest-core)))
11578 (home-page "https://github.com/xerial/xerial-java")
11579 (synopsis "Data management libraries for Java")
11580 (description "Xerial is a set of data management libraries for the Java
11581programming language. The ultimate goal of the Xerial project is to manage
11582everything as database, including class objects, text format data, data
11583streams, etc.")
11584 (license license:asl2.0)))
11585
11586(define-public java-byte-buddy-dep
11587 (package
11588 (name "java-byte-buddy-dep")
11589 (version "1.14.0")
11590 (source (origin
11591 (method git-fetch)
11592 (uri (git-reference
11593 (url "https://github.com/raphw/byte-buddy")
11594 (commit (string-append "byte-buddy-" version))))
11595 (file-name (git-file-name name version))
11596 (sha256
11597 (base32
11598 "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
11599 (build-system ant-build-system)
11600 (arguments
11601 `(#:jar-name "byte-buddy-dep.jar"
11602 #:source-dir "byte-buddy-dep/src/main/java"
11603 #:test-dir "byte-buddy-dep/src/test"
11604 #:tests? #f; would build java files that are incompatible with current jdk
11605 #:phases
11606 (modify-phases %standard-phases
11607 (add-before 'build 'remove-annotations
11608 (lambda _
11609 (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
11610 (substitute* (find-files "." ".*.java")
11611 (("@EqualsAndHashCode.*") "")
11612 (("import lombok.EqualsAndHashCode;") "")
11613 (("@SuppressFBWarnings.*") "")
11614 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
11615 (substitute* '("description/type/TypeDescription.java"
11616 "dynamic/loading/ClassInjector.java")
11617 (("^ *value = .*") "")
11618 (("^ *justification = .*") ""))))))))
11619 (inputs
11620 (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
11621 (home-page "http://bytebuddy.net/")
11622 (synopsis "Runtime code generation for the Java virtual machine")
11623 (description "Byte Buddy is a code generation and manipulation library for
11624creating and modifying Java classes during the runtime of a Java application
11625and without the help of a compiler.")
11626 (license license:asl2.0)))
11627
11628(define-public java-powermock-reflect
11629 (package
11630 (name "java-powermock-reflect")
11631 (version "2.0.9")
11632 (source (origin
11633 (method git-fetch)
11634 (uri (git-reference
11635 (url "https://github.com/powermock/powermock")
11636 (commit (string-append "powermock-" version))))
11637 (file-name (git-file-name name version))
11638 (sha256
11639 (base32
11640 "03y8szi9iwxnv431z2mn2ivc1ak30vcvfvkyrwmfq7wq93bj2c5v"))
11641 (patches
11642 (search-patches "java-powermock-fix-java-files.patch"))))
11643 (build-system ant-build-system)
11644 (arguments
11645 `(#:jar-name "java-powermock-reflect.jar"
11646 #:source-dir "powermock-reflect/src/main/java"
11647 #:test-dir "powermock-reflect/src/test"))
11648 (inputs
11649 (list java-asm-9 java-objenesis))
11650 (native-inputs
11651 (list java-assertj java-cglib java-hamcrest-core java-junit))
11652 (home-page "https://github.com/powermock/powermock")
11653 (synopsis "Mock library extension framework")
11654 (description "PowerMock is a framework that extends other mock libraries
11655such as EasyMock with more powerful capabilities. PowerMock uses a custom
11656classloader and bytecode manipulation to enable mocking of static methods,
11657constructors, final classes and methods, private methods, removal of static
11658initializers and more. By using a custom classloader no changes need to be
11659done to the IDE or continuous integration servers which simplifies adoption.")
11660 (license license:asl2.0)))
11661
11662(define-public java-powermock-core
11663 (package
11664 (inherit java-powermock-reflect)
11665 (name "java-powermock-core")
11666 (arguments
11667 `(#:jar-name "java-powermock-core.jar"
11668 #:source-dir "powermock-core/src/main/java"
11669 #:test-dir "powermock-core/src/test"
11670 #:tests? #f; requires powermock-api
11671 #:jdk ,icedtea-8
11672 #:phases
11673 (modify-phases %standard-phases
11674 (add-before 'build 'copy-resources
11675 (lambda _
11676 (copy-recursively "powermock-core/src/main/resources"
11677 "build/classes")
11678 #t)))))
11679 (inputs
11680 (list java-asm-9
11681 java-byte-buddy-dep
11682 java-jboss-javassist
11683 java-powermock-reflect))
11684 (native-inputs
11685 (list java-assertj java-mockito-1 java-junit))))
11686
11687(define-public java-powermock-api-support
11688 (package
11689 (inherit java-powermock-reflect)
11690 (name "java-powermock-api-support")
11691 (build-system ant-build-system)
11692 (arguments
11693 `(#:jar-name "java-powermock-api-support.jar"
11694 #:jdk ,icedtea-8
11695 #:source-dir "powermock-api/powermock-api-support/src/main/java"
11696 #:tests? #f)); no tests
11697 (inputs
11698 (list java-powermock-core java-powermock-reflect))))
11699
11700(define-public java-powermock-modules-junit4-common
11701 (package
11702 (inherit java-powermock-reflect)
11703 (name "java-powermock-modules-junit4-common")
11704 (build-system ant-build-system)
11705 (arguments
11706 `(#:jar-name "java-powermock-modules-junit4-common.jar"
11707 #:jdk ,icedtea-8
11708 #:source-dir "powermock-modules/powermock-module-junit4-common/src/main/java"
11709 #:test-dir "powermock-modules/powermock-module-junit4-common/src/test"))
11710 (inputs
11711 (list java-cglib
11712 java-easymock
11713 java-hamcrest-core
11714 java-powermock-core
11715 java-powermock-reflect))))
11716
11717(define-public java-powermock-modules-junit4
11718 (package
11719 (inherit java-powermock-reflect)
11720 (name "java-powermock-modules-junit4")
11721 (build-system ant-build-system)
11722 (arguments
11723 `(#:jar-name "java-powermock-modules-junit4.jar"
11724 #:tests? #f; require easymock 4, which introduces a loop with testng
11725 #:source-dir "powermock-modules/powermock-module-junit4/src/main/java"
11726 #:test-dir "powermock-modules/powermock-module-junit4/src/test"
11727 #:phases
11728 (modify-phases %standard-phases
11729 (add-before 'build 'fix-junit-detection
11730 (lambda _
11731 ;; Our junit version is 4.12-SNAPSHOT
11732 (substitute* (find-files "powermock-modules/powermock-module-junit4"
11733 "PowerMockJUnit4MethodValidator.java")
11734 (("4.12") "4.12-SNAPSHOT"))
11735 #t)))))
11736 (inputs
11737 (list java-cglib
11738 java-powermock-core
11739 java-powermock-reflect
11740 java-powermock-modules-junit4-common))
11741 (native-inputs
11742 (list java-easymock
11743 java-hamcrest-core
11744 java-junit
11745 java-objenesis))))
11746
11747(define-public java-powermock-api-easymock
11748 (package
11749 (inherit java-powermock-reflect)
11750 (name "java-powermock-api-easymock")
11751 (build-system ant-build-system)
11752 (arguments
11753 `(#:jar-name "java-powermock-api-easymock.jar"
11754 #:jdk ,icedtea-8
11755 #:source-dir "powermock-api/powermock-api-easymock/src/main/java"
11756 #:tests? #f; no tests
11757 #:phases
11758 (modify-phases %standard-phases
11759 (add-before 'build 'fix-file
11760 (lambda _
11761 ;; FIXME: This looks wrong, but it fixes a build error.
11762 (with-directory-excursion "powermock-api/powermock-api-easymock"
11763 (substitute* "src/main/java/org/powermock/api/easymock/PowerMock.java"
11764 (("classLoader instanceof MockClassLoader") "false")
11765 (("\\(\\(MockClassLoader\\) classLoader\\).*;") ";")))
11766 #t)))))
11767 (inputs
11768 (list java-cglib
11769 java-easymock
11770 java-powermock-api-support
11771 java-powermock-core
11772 java-powermock-reflect))))
11773
11774(define-public java-jboss-jms-api-spec
11775 (package
11776 (name "java-jboss-jms-api-spec")
11777 (version "2.0")
11778 (source (origin
11779 (method url-fetch)
11780 (uri (string-append "https://github.com/jboss/jboss-jms-api_spec/"
11781 "archive/jboss-jms-api_" version
11782 "_spec-1.0.1.Final.tar.gz"))
11783 (sha256
11784 (base32
11785 "07bqblw9kq2i8q92bz70fvavq5xjfkaixl8xa0m0cypjgy82rb7m"))))
11786 (build-system ant-build-system)
11787 (arguments
11788 `(#:jar-name "java-jboss-jms-api_spec.jar"
11789 #:jdk ,icedtea-8
11790 #:source-dir "."
11791 #:tests? #f)); no tests
11792 (home-page "https://github.com/jboss/jboss-jms-api_spec")
11793 (synopsis "Java Message Service API specification")
11794 (description "Java Message Service (JMS) API is used to send messages
11795messages between two or more clients. It is a messaging standard that allows
11796application components to create, send, receive, and read messages.")
11797 ; either gpl2 only with GPL Classpath Exception, or cddl.
11798 (license (list license:gpl2 license:cddl1.0))))
11799
11800(define-public java-mail
11801 (package
11802 (name "java-mail")
11803 (version "1.6.0")
11804 (source (origin
11805 (method url-fetch)
11806 (uri (string-append "https://github.com/javaee/javamail/archive/"
11807 "JAVAMAIL-1_6_0.tar.gz"))
11808 (sha256
11809 (base32
11810 "1b4rg7fpj50ld90a71iz2m4gm3f5cnw18p3q3rbrrryjip46kx92"))))
11811 (build-system ant-build-system)
11812 (arguments
11813 `(#:jar-name "java-mail.jar"
11814 #:jdk ,icedtea-8
11815 #:source-dir "mail/src/main/java"
11816 #:test-dir "mail/src/test"
11817 #:test-exclude
11818 (list "**/CollectorFormatterTest.java"
11819 "**/CompactFormatterTest.java"
11820 "**/DurationFilterTest.java"
11821 "**/MailHandlerTest.java"
11822 "**/GetLocalAddressTest.java"
11823 ;; SSLHandshakeException: No appropriate protocol
11824 "**/WriteTimeoutSocketTest.java"
11825 ;; FIXME: both end with:
11826 ;; java.lang.ClassNotFoundException:
11827 ;; javax.mail.internet.MimeMultipartParseTest
11828 "**/MimeMultipartParseTest.java"
11829 "**/SearchTermSerializationTest.java")
11830 #:phases
11831 (modify-phases %standard-phases
11832 (add-before 'configure 'move-version.java
11833 (lambda _
11834 (copy-file "mail/src/main/resources/javax/mail/Version.java"
11835 "mail/src/main/java/javax/mail/Version.java")))
11836 (add-before 'build 'copy-resources
11837 (lambda _
11838 (copy-recursively "mail/src/main/resources/META-INF"
11839 "build/classes/META-INF"))))))
11840 (native-inputs
11841 (list java-junit java-hamcrest-core))
11842 (home-page "https://javaee.github.io/javamail/")
11843 (synopsis "Mail-related functionality in Java")
11844 (description "The JavaMail API provides a platform-independent and
11845protocol-independent framework to build mail and messaging applications.")
11846 ;; General Public License Version 2 only ("GPL") or the Common Development
11847 ;; and Distribution License("CDDL")
11848 (license (list license:cddl1.1
11849 license:gpl2)))); with classpath exception
11850
11851(define-public java-mapdb
11852 (package
11853 (name "java-mapdb")
11854 (version "1.0.9")
11855 (source (origin
11856 (method git-fetch)
11857 (uri (git-reference
11858 (url "https://github.com/jankotek/mapdb")
11859 (commit (string-append "mapdb-" version))))
11860 (file-name (git-file-name name version))
11861 (sha256
11862 (base32
11863 "1slb4h282jqvk16896lcvgm65pj3v6crcp2wvjdvad7nx7d2f1kv"))))
11864 (build-system ant-build-system)
11865 (arguments
11866 (list #:jar-name "mapdb.jar"
11867 #:source-dir "src/main/java"
11868 #:test-dir "src/test"
11869 #:test-exclude (list "**/ClosedThrowsExceptionTest.java"
11870 "**/ConcurrentMapInterfaceTest.java"
11871 "**/EngineTest.java"
11872 "**/Issue664Test.java"
11873 "**/MapInterfaceTest.java")
11874 #:phases #~(modify-phases %standard-phases
11875 (replace 'install (install-from-pom "pom.xml")))))
11876 (native-inputs (list java-junit))
11877 (home-page "https://mapdb.org/")
11878 (synopsis "Concurrent data structures")
11879 (description "MapDB provides concurrent maps, sets and queues backed by
11880disk storage or off-heap memory.")
11881 (license license:bsd-3)))
11882
11883(define-public java-jeromq
11884 (package
11885 (name "java-jeromq")
11886 (version "0.4.3")
11887 (source (origin
11888 (method git-fetch)
11889 (uri (git-reference
11890 (url "https://github.com/zeromq/jeromq")
11891 (commit (string-append "v" version))))
11892 (file-name (string-append name "-" version "-checkout"))
11893 (sha256
11894 (base32
11895 "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
11896 (patches (search-patches "java-jeromq-fix-tests.patch"))))
11897 (build-system ant-build-system)
11898 (arguments
11899 `(#:jar-name "java-jeromq.jar"
11900 #:source-dir "src/main/java"
11901 #:jdk ,icedtea-8
11902 #:test-exclude
11903 (list
11904 "**/Abstract*.java"
11905 ;; Requires network
11906 "**/ZBeaconTest.java"
11907 ;; Failures
11908 "**/DealerSpecTest.java"
11909 "**/CustomDecoderTest.java"
11910 "**/CustomEncoderTest.java"
11911 "**/ConnectRidTest.java"
11912 "**/ReqSpecTest.java"
11913 "**/PushPullSpecTest.java"
11914 "**/PubSubHwmTest.java"
11915 "**/RouterSpecTest.java"
11916 "**/ProxyTest.java")))
11917 (inputs
11918 (list java-jnacl))
11919 (native-inputs
11920 `(("java-hamcrest-core" ,java-hamcrest-core)
11921 ("junit" ,java-junit)))
11922 (home-page "https://zeromq.org/bindings:java")
11923 (synopsis "Java binding for 0MQ")
11924 (description "Jeromq provides the java bindings for 0MQ.")
11925 (license license:mpl2.0)))
11926
11927(define-public java-kafka-clients
11928 (package
11929 (name "java-kafka-clients")
11930 (version "1.1.1")
11931 (source (origin
11932 (method url-fetch)
11933 (uri (string-append "mirror://apache/kafka/" version "/kafka-"
11934 version "-src.tgz"))
11935 (sha256
11936 (base32
11937 "1jn62q7z383nwhzv4ippsddf98sa1gnkszjjncj4ii3r8rzgw566"))))
11938 (build-system ant-build-system)
11939 (arguments
11940 `(#:jar-name "java-kafka-clients.jar"
11941 #:jdk ,icedtea-8
11942 #:source-dir "clients/src/main/java"
11943 #:test-dir "clients/src/test"
11944 #:test-exclude
11945 (list
11946 ;; This file does not contain a class
11947 "**/IntegrationTest.java"
11948 ;; Requires network
11949 "**/ClientUtilsTest.java"
11950 ;; This test fails on i686
11951 "**/SerializationTest.java"
11952 ;; "protocol is disabled or cipher suites are inappropriate"
11953 "**/SslTransportLayerTest.java"
11954 ;; End with errors that seem related to our powermock
11955 "**/KafkaProducerTest.java"
11956 "**/BufferPoolTest.java"
11957 ;; Undeterministic failure, seems to affect mostly ci
11958 "**/GarbageCollectedMemoryPoolTest.java")))
11959 (inputs
11960 (list java-slf4j-api java-lz4))
11961 (native-inputs
11962 (list java-bouncycastle
11963 java-cglib
11964 java-easymock
11965 java-hamcrest-all
11966 java-jboss-javassist
11967 java-junit
11968 java-objenesis
11969 java-powermock-api-easymock
11970 java-powermock-api-support
11971 java-powermock-core
11972 java-powermock-modules-junit4
11973 java-powermock-modules-junit4-common
11974 java-snappy))
11975 (home-page "https://kafka.apache.org")
11976 (synopsis "Distributed streaming platform")
11977 (description "Kafka is a distributed streaming platform, which means:
11978@itemize
11979@item it can publish and subscribe to streams of records;
11980@item it can store streams of records in a fault-tolerant way;
11981@item it can process streams of records as they occur.
11982@end itemize")
11983 ;; Either cddl or gpl2 only.
11984 (license (list license:cddl1.1; actually cddl1.1
11985 license:gpl2)))); with classpath exception
11986
11987(define-public java-jdom
11988 (package
11989 (name "java-jdom")
11990 (version "1.1.3")
11991 (source (origin
11992 (method url-fetch)
11993 (uri (string-append "http://jdom.org/dist/binary/archive/jdom-"
11994 version ".tar.gz"))
11995 (sha256
11996 (base32
11997 "07wdpm3jwwc9q38kmdw40fvbmv6jzjrkrf8m0zqs58f79a672wfl"))))
11998 (build-system ant-build-system)
11999 (arguments
12000 `(#:build-target "package"
12001 #:tests? #f; tests are run as part of the build process
12002 #:phases
12003 (modify-phases %standard-phases
12004 (replace 'install
12005 (install-jars "build")))))
12006 (home-page "http://jdom.org/")
12007 (synopsis "Access, manipulate, and output XML data")
12008 (description "Java-based solution for accessing, manipulating, and
12009outputting XML data from Java code.")
12010 (license license:bsd-4)))
12011
12012(define-public java-geronimo-xbean-reflect
12013 (package
12014 (name "java-geronimo-xbean-reflect")
12015 (version "4.5")
12016 (source (origin
12017 (method svn-fetch)
12018 (uri (svn-reference
12019 (url "https://svn.apache.org/repos/asf/geronimo/xbean/tags/xbean-4.5/")
12020 (revision 1807396)))
12021 (file-name (string-append name "-" version))
12022 (sha256
12023 (base32
12024 "0zjqmsad4xk0iar23hdyvx19nxczybd2bh0i35xrafli5cmh720k"))))
12025 (build-system ant-build-system)
12026 (arguments
12027 `(#:jar-name "geronimo-xbean-reflect.jar"
12028 #:source-dir "xbean-reflect/src/main/java"
12029 #:test-dir "xbean-reflect/src/test"
12030 #:jdk ,icedtea-8
12031 #:test-exclude
12032 (list "**/Abstract*.java" "**/AsmParameterNameLoaderTest.java"
12033 "**/ObjectRecipeTest.java" "**/ParameterNameLoaderTest.java"
12034 "**/RecipeHelperTest.java" "**/XbeanAsmParameterNameLoaderTest.java")
12035 #:phases
12036 (modify-phases %standard-phases
12037 (add-before 'build 'fix-source
12038 (lambda _
12039 (let ((dir "xbean-reflect/src/main/java/org/apache/xbean/recipe/"))
12040 ;; org.apache.xbean.asm6 is actually repackaged java-asm
12041 (substitute* (string-append dir "XbeanAsmParameterNameLoader.java")
12042 (("org.apache.xbean.asm5") "org.objectweb.asm"))
12043 #t)))
12044 (replace 'install (install-from-pom "xbean-reflect/pom.xml")))))
12045 (inputs
12046 `(("asm" ,java-asm)
12047 ("log4j" ,java-log4j-api)
12048 ("log4j-1.2" ,java-log4j-1.2-api)
12049 ("log4j-core" ,java-log4j-core)
12050 ("logging" ,java-commons-logging-minimal)))
12051 (propagated-inputs
12052 (list java-geronimo-parent-pom))
12053 (native-inputs
12054 `(("junit" ,java-junit)))
12055 (home-page "https://geronimo.apache.org/maven/xbean/3.6/xbean-reflect/")
12056 (synopsis "Dependency injection helper")
12057 (description "Xbean-reflect provides very flexible ways to create objects
12058and graphs of objects for dependency injection frameworks")
12059 (license license:asl2.0)))
12060
12061(define java-geronimo-genesis-2.1
12062 (package
12063 (name "java-geronimo-genesis")
12064 (version "2.1")
12065 (source (origin
12066 (method svn-fetch)
12067 (uri (svn-reference
12068 (url (string-append "https://svn.apache.org/repos/asf/"
12069 "geronimo/genesis/tags/genesis-"
12070 version))
12071 (revision 1807396)))
12072 (file-name (string-append name "-" version "-source"))
12073 (sha256
12074 (base32
12075 "1mky4zyl2xsqlgrkairaj5971byvhwk2z9bq8snsgvlr11ydc0zf"))))
12076 (build-system ant-build-system)
12077 (arguments
12078 `(#:tests? #f
12079 #:phases
12080 (modify-phases %standard-phases
12081 (delete 'configure)
12082 (delete 'build)
12083 (replace 'install
12084 (install-pom-file "pom.xml"))
12085 (add-after 'install 'install-enforcer-rules
12086 (install-pom-file "genesis-enforcer-rules/pom.xml"))
12087 (add-after 'install 'install-flava
12088 (install-pom-file "genesis-default-flava/pom.xml"))
12089 (add-after 'install 'install-packaging
12090 (install-pom-file "genesis-packaging/pom.xml"))
12091 (add-after 'install-flava 'install-flava-java4
12092 (install-pom-file "genesis-default-flava/genesis-java1.4-flava/pom.xml"))
12093 (add-after 'install-flava 'install-flava-java5
12094 (install-pom-file "genesis-default-flava/genesis-java5-flava/pom.xml"))
12095 (add-after 'install-flava 'install-flava-java6
12096 (install-pom-file "genesis-default-flava/genesis-java6-flava/pom.xml")))))
12097 (propagated-inputs
12098 `(("apache-parent-pom" ,apache-parent-pom-13)))
12099 (home-page "https://geronimo.apache.org")
12100 (synopsis "Collection of maven POM files for the Geronimo project")
12101 (description "Apache Geronimo is a server runtime. This package contains
12102only pom files used by other components in the Geronimo project.")
12103 (license license:asl2.0)))
12104
12105(define java-geronimo-parent-pom
12106 (package
12107 (inherit java-geronimo-xbean-reflect)
12108 (name "java-geronimo-parent-pom")
12109 (arguments
12110 `(#:tests? #f
12111 #:phases
12112 (modify-phases %standard-phases
12113 (delete 'configure)
12114 (delete 'build)
12115 (replace 'install
12116 (install-pom-file "pom.xml")))))
12117 (propagated-inputs
12118 `(("java-geronimo-genesis" ,java-geronimo-genesis-2.1)))))
12119
12120(define-public java-geronimo-xbean-bundleutils
12121 (package
12122 (inherit java-geronimo-xbean-reflect)
12123 (name "java-geronimo-xbean-bundleutils")
12124 (arguments
12125 `(#:jar-name "geronimo-xbean-bundleutils.jar"
12126 #:source-dir "xbean-bundleutils/src/main/java"
12127 #:test-dir "xbean-bundleutils/src/test"
12128 #:phases
12129 (modify-phases %standard-phases
12130 (add-before 'build 'fix-java
12131 (lambda _
12132 ;; We use a more recent version of osgi, so this file requires
12133 ;; more interface method implementations.
12134 (substitute* "xbean-bundleutils/src/main/java/org/apache/xbean/osgi/bundle/util/DelegatingBundleContext.java"
12135 (("import org.osgi.framework.ServiceRegistration;")
12136 "import org.osgi.framework.ServiceRegistration;
12137import org.osgi.framework.ServiceFactory;
12138import java.util.Collection;
12139import org.osgi.framework.ServiceObjects;")
12140 (("public Bundle getBundle\\(\\)")
12141 "@Override
12142public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
12143 throw new UnsupportedOperationException();
12144}
12145@Override
12146public <S> ServiceRegistration<S> registerService(Class<S> clazz,
12147 ServiceFactory<S> factory, Dictionary<String, ?> properties) {
12148 throw new UnsupportedOperationException();
12149}
12150public Bundle getBundle()"))
12151 #t)))))
12152 (inputs
12153 `(("java-slf4j" ,java-slf4j-api)
12154 ("java-asm" ,java-asm)
12155 ("java-osgi-framework" ,java-osgi-framework)
12156 ("java-eclipse-osgi" ,java-eclipse-osgi)
12157 ("java-osgi-service-packageadmin" ,java-osgi-service-packageadmin)))))
12158
12159(define-public java-geronimo-xbean-asm-util
12160 (package
12161 (inherit java-geronimo-xbean-reflect)
12162 (name "java-geronimo-xbean-asm-util")
12163 (arguments
12164 `(#:jar-name "geronimo-xbean-asm-util.jar"
12165 #:source-dir "xbean-asm-util/src/main/java"
12166 #:tests? #f)); no tests
12167 (inputs
12168 (list java-asm))
12169 (native-inputs '())))
12170
12171(define-public java-geronimo-xbean-finder
12172 (package
12173 (inherit java-geronimo-xbean-reflect)
12174 (name "java-geronimo-xbean-finder")
12175 (arguments
12176 `(#:jar-name "geronimo-xbean-finder.jar"
12177 #:source-dir "xbean-finder/src/main/java"
12178 #:test-dir "xbean-finder/src/test"))
12179 (inputs
12180 (list java-slf4j-api
12181 java-asm
12182 java-geronimo-xbean-bundleutils
12183 java-geronimo-xbean-asm-util
12184 java-osgi-service-packageadmin
12185 java-osgi-framework))
12186 (native-inputs
12187 (list java-junit java-hamcrest-core))))
12188
12189(define-public java-gson
12190 (package
12191 (name "java-gson")
12192 (version "2.8.2")
12193 (source (origin
12194 (method url-fetch)
12195 (uri (string-append "https://github.com/google/gson/archive/"
12196 "gson-parent-" version ".tar.gz"))
12197 (sha256
12198 (base32
12199 "1j4qnp7v046q0k48c4kyf69sxaasx2h949d3cqwsm3kzxms3x0f9"))))
12200 (build-system ant-build-system)
12201 (arguments
12202 `(#:jar-name "gson.jar"
12203 #:source-dir "gson/src/main/java"
12204 #:test-dir "gson/src/test"))
12205 (native-inputs
12206 (list java-junit java-hamcrest-core))
12207 (home-page "https://github.com/google/gson")
12208 (synopsis "Java serialization/deserialization library from/to JSON")
12209 (description "Gson is a Java library that can be used to convert Java
12210Objects into their JSON representation. It can also be used to convert a JSON
12211string to an equivalent Java object. Gson can work with arbitrary Java objects
12212including pre-existing objects that you do not have source-code of.")
12213 (license license:asl2.0)))
12214
12215;; This requires a different Java version than 2.8.2 above
12216(define-public java-gson-2.8.6
12217 (package
12218 (inherit java-gson)
12219 (name "java-gson")
12220 (version "2.8.6")
12221 (source (origin
12222 (method git-fetch)
12223 (uri (git-reference
12224 (url "https://github.com/google/gson")
12225 (commit (string-append "gson-parent-" version))))
12226 (file-name (git-file-name name version))
12227 (sha256
12228 (base32
12229 "0kk5p3vichdb0ph1lzknrcpbklgnmq455mngmjpxvvj29p3rgpk3"))))
12230 (arguments
12231 `(#:jar-name "gson.jar"
12232 #:jdk ,openjdk11
12233 #:source-dir "gson/src/main/java"
12234 #:test-dir "gson/src/test"
12235 #:phases
12236 (modify-phases %standard-phases
12237 ;; avoid Maven dependency
12238 (add-before 'build 'fill-template
12239 (lambda _
12240 (with-directory-excursion "gson/src/main"
12241 (copy-file "java-templates/com/google/gson/internal/GsonBuildConfig.java"
12242 "java/com/google/gson/internal/GsonBuildConfig.java")
12243 (substitute* "java/com/google/gson/internal/GsonBuildConfig.java"
12244 (("\\$\\{project.version\\}") ,version))))))))))
12245
12246(define-public java-hawtjni
12247 (package
12248 (name "java-hawtjni")
12249 (version "1.15")
12250 (source (origin
12251 (method url-fetch)
12252 (uri (string-append "https://github.com/fusesource/hawtjni/archive/"
12253 "hawtjni-project-" version ".tar.gz"))
12254 (sha256
12255 (base32
12256 "1bqfd732rmh6svyx17fpw9175gc9gzkcbyps2yyrf50c3zzjas6g"))))
12257 (build-system ant-build-system)
12258 (arguments
12259 `(#:jar-name "hawtjni.jar"
12260 #:source-dir "hawtjni-generator/src/main/java:hawtjni-runtime/src/main/java"
12261 #:tests? #f; no tests
12262 #:phases
12263 (modify-phases %standard-phases
12264 (add-before 'build 'build-native
12265 (lambda* (#:key inputs #:allow-other-keys)
12266 (let ((include (string-append "-I" (assoc-ref inputs "jdk") "/include/linux")))
12267 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12268 (invoke "gcc" "-c" "hawtjni.c" "-o" "hawtjni.o"
12269 "-fPIC" "-O2" include)
12270 (invoke "gcc" "-c" "hawtjni-callback.c" "-o" "hawtjni-callback.o"
12271 "-fPIC" "-O2" include)
12272 (invoke "gcc" "-o" "libhawtjni.so" "-shared"
12273 "hawtjni.o" "hawtjni-callback.o")))
12274 #t))
12275 (add-after 'install 'install-native
12276 (lambda* (#:key outputs #:allow-other-keys)
12277 (let* ((out (assoc-ref outputs "out"))
12278 (lib (string-append out "/lib"))
12279 (inc (string-append out "/include")))
12280 (with-directory-excursion "hawtjni-generator/src/main/resources/"
12281 (install-file "libhawtjni.so" lib)
12282 (install-file "hawtjni.h" inc)))
12283 #t))
12284 (add-before 'install 'install-parent
12285 (install-pom-file "pom.xml"))
12286 (replace 'install
12287 (install-from-pom "hawtjni-runtime/pom.xml")))))
12288 (inputs
12289 (list java-commons-cli java-asm java-geronimo-xbean-finder))
12290 (home-page "https://fusesource.github.io/hawtjni/")
12291 (synopsis "JNI code generator")
12292 (description "HawtJNI is a code generator that produces the JNI code needed
12293to implement Java native methods. It is based on the jnigen code generator
12294that is part of the SWT Tools project.")
12295 (license license:asl2.0)))
12296
12297(define-public java-jansi-native
12298 (package
12299 (name "java-jansi-native")
12300 (version "1.7")
12301 (source (origin
12302 (method url-fetch)
12303 (uri (string-append "https://github.com/fusesource/jansi-native/"
12304 "archive/jansi-native-" version ".tar.gz"))
12305 (sha256
12306 (base32
12307 "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))))
12308 (build-system ant-build-system)
12309 (arguments
12310 `(#:jar-name "jansi-native.jar"
12311 #:source-dir "src/main/java"
12312 #:tests? #f; no tests
12313 #:phases
12314 (modify-phases %standard-phases
12315 (add-before 'build 'build-native
12316 (lambda* (#:key inputs #:allow-other-keys)
12317 ;; there are more required files for windows in windows/
12318 (with-directory-excursion "src/main/native-package/src"
12319 (substitute* "jansi_ttyname.c"
12320 (("#include \"jansi_.*") ""))
12321 (invoke "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname.o"
12322 (string-append "-I" (assoc-ref inputs "java-hawtjni")
12323 "/include")
12324 (string-append "-I" (assoc-ref inputs "jdk")
12325 "/include/linux")
12326 "-fPIC" "-O2")
12327 (invoke "gcc" "-o" "libjansi.so" "-shared" "jansi_ttyname.o"))))
12328 (add-before 'build 'install-native
12329 (lambda _
12330 (let ((dir (string-append "build/classes/META-INF/native/"
12331 ,(match (%current-system)
12332 ((or "i686-linux" "armhf-linux")
12333 "linux32")
12334 ((or "x86_64-linux" "aarch64-linux"
12335 "mips64el-linux")
12336 "linux64")
12337 (_ "unknown-kernel")))))
12338 (install-file "src/main/native-package/src/libjansi.so" dir))
12339 #t))
12340 (add-after 'install 'install-native
12341 (lambda* (#:key outputs #:allow-other-keys)
12342 (install-file "src/main/native-package/src/jansi.h"
12343 (string-append (assoc-ref outputs "out") "/include"))
12344 #t))
12345 (add-before 'install 'fix-pom
12346 (lambda _
12347 ;; pom contains variables to complete name, but we don't support that
12348 (substitute* "pom.xml"
12349 (("\\$\\{platform\\}") "native"))
12350 #t))
12351 (replace 'install
12352 (install-from-pom "pom.xml")))))
12353 (propagated-inputs
12354 (list java-hawtjni))
12355 (home-page "https://fusesource.github.io/jansi/")
12356 (synopsis "Native library for jansi")
12357 (description "This package provides the native library for jansi, a small
12358Java library that allows you to use ANSI escape sequences to format your
12359console output.")
12360 (license license:asl2.0)))
12361
12362(define-public java-jansi
12363 (package
12364 (name "java-jansi")
12365 (version "2.4.0")
12366 (source (origin
12367 (method git-fetch)
12368 (uri (git-reference
12369 (url "https://github.com/fusesource/jansi")
12370 (commit (string-append "jansi-" version))))
12371 (file-name (git-file-name name version))
12372 (sha256
12373 (base32
12374 "1s6fva06990798b5fyxqzr30zwyj1byq5wrm54j2larcydaryggf"))
12375 (modules '((guix build utils)))
12376 (snippet
12377 ;; contains pre-compiled libraries
12378 '(delete-file-recursively
12379 "src/main/resources/org/fusesource/jansi/internal"))))
12380 (build-system ant-build-system)
12381 (arguments
12382 `(#:jar-name "jansi.jar"
12383 #:source-dir "src/main/java"
12384 #:test-dir "src/test"
12385 #:tests? #f; require junit 3
12386 #:phases
12387 (modify-phases %standard-phases
12388 (add-before 'build 'build-native
12389 (lambda* (#:key inputs #:allow-other-keys)
12390 (with-directory-excursion "src/main/native"
12391 (for-each
12392 (lambda (cfile)
12393 (let ((cfile (basename cfile))
12394 (ofile (string-append (basename cfile ".c") ".o")))
12395 (invoke ,(cc-for-target) "-c" cfile "-o" ofile
12396 (string-append "-I" (assoc-ref inputs "jdk")
12397 "/include/linux")
12398 "-fPIC" "-O2")))
12399 (find-files "." "\\.c$"))
12400 (apply invoke ,(cc-for-target) "-o" "libjansi.so" "-shared"
12401 (find-files "." "\\.o$")))))
12402 (add-before 'build 'install-native
12403 (lambda _
12404 (let ((dir (string-append "build/classes/org/fusesource/"
12405 "jansi/internal/native/"
12406 ,(match (or (%current-target-system) (%current-system))
12407 ("i686-linux" "Linux/x86")
12408 ("x86_64-linux" "Linux/x86_64")
12409 ("armhf-linux" "Linux/armv7")
12410 ("aarch64-linux" "Linux/arm64")
12411 ("mips64el-linux" "Linux/mips64")
12412 (_ "unknown-kernel")))))
12413 (install-file "src/main/native/libjansi.so" dir))))
12414 (add-before 'build 'copy-resources
12415 (lambda _
12416 (copy-recursively "src/main/resources" "build/classes")))
12417 (replace 'install
12418 (install-from-pom "pom.xml")))))
12419 (home-page "https://fusesource.github.io/jansi/")
12420 (synopsis "Portable ANSI escape sequences")
12421 (description "Jansi is a Java library that allows you to use ANSI escape
12422sequences to format your console output which works on every platform.")
12423 (license license:asl2.0)))
12424
12425(define-public java-jansi-1
12426 (package
12427 (inherit java-jansi)
12428 (version "1.16")
12429 (source (origin
12430 (method git-fetch)
12431 (uri (git-reference
12432 (url "https://github.com/fusesource/jansi")
12433 (commit (string-append "jansi-project-" version))))
12434 (file-name (git-file-name "jansi" version))
12435 (sha256
12436 (base32
12437 "0ikk0x352gh30b42qn1jd89xwsjj0mavrc5kms7fss15bd8vsayx"))))
12438 (arguments
12439 `(#:jar-name "jansi.jar"
12440 #:source-dir "jansi/src/main/java"
12441 #:test-dir "jansi/src/test"
12442 #:phases
12443 (modify-phases %standard-phases
12444 (add-after 'check 'clear-term
12445 (lambda _
12446 (invoke "echo" "-e" "\\e[0m")))
12447 (add-before 'install 'install-parent
12448 (install-pom-file "pom.xml"))
12449 (add-before 'install 'fix-pom
12450 (lambda _
12451 ;; pom adds jansi native versions for different platforms, but we
12452 ;; only need one, so use native instead
12453 (substitute* "jansi/pom.xml"
12454 (("windows32") "native")
12455 (("windows64") "native")
12456 (("osx") "native")
12457 (("linux32") "native")
12458 (("linux64") "native")
12459 (("freebsd32") "native")
12460 (("freebsd64") "native"))
12461 #t))
12462 (replace 'install
12463 (install-from-pom "jansi/pom.xml")))))
12464 (propagated-inputs
12465 (list java-jansi-native))
12466 (native-inputs
12467 (list java-junit java-hamcrest-core))))
12468
12469(define-public java-jboss-el-api-spec
12470 (package
12471 (name "java-jboss-el-api-spec")
12472 (version "3.0")
12473 (source (origin
12474 (method url-fetch)
12475 (uri (string-append "https://github.com/jboss/jboss-el-api_spec/"
12476 "archive/jboss-el-api_" version
12477 "_spec-1.0.7.Final.tar.gz"))
12478 (sha256
12479 (base32
12480 "1j45ljxalwlibxl7g7iv952sjxkw275m8vyxxij8l6wdd5pf0pdh"))))
12481 (build-system ant-build-system)
12482 (arguments
12483 `(#:jar-name "java-jboss-el-api_spec.jar"
12484 #:phases
12485 (modify-phases %standard-phases
12486 ;; the origin of javax.el:javax.el-api is unknown, so we use this package
12487 ;; instead, which implements the same thing. We override the pom file
12488 ;; to "rename" the package so it can be found by maven.
12489 (add-before 'install 'override-pom
12490 (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0"
12491 #:name "el-api"))
12492 (replace 'install
12493 (install-from-pom "pom.xml")))))
12494 (inputs
12495 (list java-junit))
12496 (home-page "https://github.com/jboss/jboss-el-api_spec")
12497 (synopsis "JSR-341 expression language 3.0 API")
12498 (description "This package contains an implementation of the JSR-341
12499specification for the expression language 3.0. It implements an expression
12500language inspired by ECMAScript and XPath. This language is used with
12501JavaServer Pages (JSP).")
12502 ;; Either GPL2 only or CDDL.
12503 (license (list license:gpl2 license:cddl1.1))))
12504
12505(define-public java-jboss-interceptors-api-spec
12506 (package
12507 (name "java-jboss-interceptors-api-spec")
12508 (version "1.2")
12509 (source (origin
12510 (method url-fetch)
12511 (uri (string-append "https://github.com/jboss/jboss-interceptors-api_spec/"
12512 "archive/jboss-interceptors-api_" version
12513 "_spec-1.0.0.Final.tar.gz"))
12514 (sha256
12515 (base32
12516 "0wv8x0jp9a5qxlrgkhb5jdk2gr6vi87b4j4kjb8ryxiy9gn8g51z"))))
12517 (build-system ant-build-system)
12518 (arguments
12519 `(#:jar-name "java-jboss-interceptors-api_spec.jar"
12520 #:jdk ,icedtea-8
12521 #:source-dir "."
12522 #:tests? #f; no tests
12523 #:phases
12524 (modify-phases %standard-phases
12525 ;; the origin of javax.interceptor:javax.interceptor-api is unknown,
12526 ;; so we use this package instead, which implements the same thing.
12527 ;; We override the pom file to "rename" the package so it can be found
12528 ;; by maven.
12529 (add-before 'install 'override-pom
12530 (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api"
12531 "3.0" #:name "interceptor-api"))
12532 (replace 'install
12533 (install-from-pom "pom.xml")))))
12534 (home-page "https://github.com/jboss/jboss-interceptors-api_spec")
12535 (synopsis "Interceptors 1.2 API classes from JSR 318")
12536 (description "Java-jboss-interceptors-api-spec implements the Interceptors
12537API. Interceptors are used to interpose on business method invocations and
12538specific events.")
12539 ;; Either GPL2 only or CDDL.
12540 (license (list license:gpl2 license:cddl1.1))))
12541
12542(define-public java-cdi-api
12543 (package
12544 (name "java-cdi-api")
12545 (version "2.0")
12546 (source (origin
12547 (method url-fetch)
12548 (uri (string-append "https://github.com/cdi-spec/cdi/archive/"
12549 version ".tar.gz"))
12550 (file-name (string-append name "-" version ".tar.gz"))
12551 (sha256
12552 (base32
12553 "1iv8b8bp07c5kmqic14jsr868vycjv4qv02lf3pkgp9z21mnfg5y"))))
12554 (build-system ant-build-system)
12555 (arguments
12556 `(#:source-dir "api/src/main/java"
12557 #:jar-name "java-cdi-api.jar"
12558 #:test-dir "api/src/test"
12559 #:jdk ,icedtea-8
12560 #:tests? #f; Tests fail because we don't have a CDI provider yet
12561 #:phases
12562 (modify-phases %standard-phases
12563 (replace 'install
12564 (install-from-pom "api/pom.xml")))))
12565 (propagated-inputs
12566 (list java-javax-inject java-jboss-el-api-spec
12567 java-jboss-interceptors-api-spec java-weld-parent-pom))
12568 (native-inputs
12569 (list java-testng java-hamcrest-core))
12570 (home-page "https://cdi-spec.org/")
12571 (synopsis "Contexts and Dependency Injection APIs")
12572 (description "Java-cdi-api contains the required APIs for Contexts and
12573Dependency Injection (CDI).")
12574 (license license:asl2.0)))
12575
12576(define-public java-joda-convert
12577 (package
12578 (name "java-joda-convert")
12579 (version "1.9.2")
12580 (source (origin
12581 (method url-fetch)
12582 (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v"
12583 version ".tar.gz"))
12584 (file-name (string-append name "-" version ".tar.gz"))
12585 (sha256
12586 (base32
12587 "0vp346xz7dh9br4q7xazhc7hvzf76a6hf95fki9bg67q5jr0kjh7"))))
12588 (build-system ant-build-system)
12589 (arguments
12590 `(#:jar-name (string-append ,name "-" ,version ".jar")
12591 #:source-dir "src/main/java"
12592 #:test-include (list "**/Test*.java")
12593 ;; Contains only interfaces and base classes (no test)
12594 #:test-exclude (list "**/test*/**.java")))
12595 (inputs
12596 (list java-guava))
12597 (native-inputs
12598 (list java-junit java-hamcrest-core))
12599 (home-page "https://www.joda.org/joda-convert/")
12600 (synopsis "Conversion between Objects and Strings")
12601 (description "Joda-Convert provides a small set of classes to aid
12602conversion between Objects and Strings. It is not intended to tackle the
12603wider problem of Object to Object transformation.")
12604 (license license:asl2.0)))
12605
12606(define-public java-joda-time
12607 (package
12608 (name "java-joda-time")
12609 (version "2.9.9")
12610 (source (origin
12611 (method url-fetch)
12612 (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v"
12613 version ".tar.gz"))
12614 (file-name (string-append name "-" version ".tar.gz"))
12615 (sha256
12616 (base32
12617 "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1"))))
12618 (build-system ant-build-system)
12619 (arguments
12620 `(#:jar-name "java-joda-time.jar"
12621 #:source-dir "src/main/java"
12622 #:test-include (list "**/Test*.java")
12623 ;; There is no runnable test in these files
12624 #:test-exclude (list "**/Test*Chronology.java" "**/Test*Field.java")
12625 #:phases
12626 (modify-phases %standard-phases
12627 (add-after 'build 'build-resources
12628 (lambda _
12629 (mkdir-p "build/classes/org/joda/time/tz/data")
12630 (mkdir-p "build/classes/org/joda/time/format")
12631 ;; This will produce the following exception:
12632 ;; java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap"
12633 ;; which is normal, because it doesn't exist yet. It still generates
12634 ;; the same file as in the binary one can find on maven.
12635 (invoke "java" "-cp"
12636 (string-append "build/classes:" (getenv "CLASSPATH"))
12637 "org.joda.time.tz.ZoneInfoCompiler"
12638 "-src" "src/main/java/org/joda/time/tz/src"
12639 "-dst" "build/classes/org/joda/time/tz/data"
12640 "africa" "antarctica" "asia" "australasia"
12641 "europe" "northamerica" "southamerica"
12642 "pacificnew" "etcetera" "backward" "systemv")
12643 (for-each (lambda (f)
12644 (copy-file f (string-append
12645 "build/classes/org/joda/time/format/"
12646 (basename f))))
12647 (find-files "src/main/java/org/joda/time/format" ".*.properties"))
12648 #t))
12649 (add-before 'install 'regenerate-jar
12650 (lambda _
12651 ;; We need to regenerate the jar file to add generated data.
12652 (delete-file "build/jar/java-joda-time.jar")
12653 (invoke "ant" "jar")))
12654 (add-before 'check 'copy-test-resources
12655 (lambda _
12656 (mkdir-p "build/test-classes/org/joda/time/tz/data")
12657 (copy-file "src/test/resources/tzdata/ZoneInfoMap"
12658 "build/test-classes/org/joda/time/tz/data/ZoneInfoMap")
12659 (copy-recursively "src/test/resources" "build/test-classes")
12660 #t)))))
12661 (inputs
12662 (list java-joda-convert))
12663 (native-inputs
12664 (list java-junit java-hamcrest-core tzdata))
12665 (home-page "https://www.joda.org/joda-time/")
12666 (synopsis "Replacement for the Java date and time classes")
12667 (description "Joda-Time is a replacement for the Java date and time
12668classes prior to Java SE 8.")
12669 (license license:asl2.0)))
12670
12671(define-public java-xerces
12672 (package
12673 (name "java-xerces")
12674 (version "2.12.2")
12675 (source
12676 (origin
12677 (method url-fetch)
12678 (uri (string-append "mirror://apache/xerces/j/source/"
12679 "Xerces-J-src." version ".tar.gz"))
12680 (sha256
12681 (base32 "1s2fnfx5flmhs3q30bxdsa6vs52m6vbnqd3m4cc5r4wfr3afplbd"))
12682 (patches (search-patches
12683 "java-xerces-xjavac_taskdef.patch"
12684 "java-xerces-build_dont_unzip.patch"
12685 "java-xerces-bootclasspath.patch"))))
12686 (build-system ant-build-system)
12687 (arguments
12688 `(#:tests? #f;; Test files are not present
12689 #:test-target "test"
12690 #:jdk ,icedtea-8
12691 #:phases
12692 (modify-phases %standard-phases
12693 (add-after 'unpack 'create-build.properties
12694 (lambda* (#:key inputs #:allow-other-keys)
12695 (let ((jaxp (assoc-ref inputs "java-jaxp"))
12696 (resolver (assoc-ref inputs "java-apache-xml-commons-resolver")))
12697 (with-output-to-file "build.properties"
12698 (lambda _
12699 (format #t
12700 "jar.jaxp = ~a/share/java/jaxp.jar~@
12701 jar.apis-ext = ~a/share/java/jaxp.jar~@
12702 jar.resolver = ~a/share/java/xml-resolver.jar~%"
12703 jaxp jaxp resolver)))
12704 ;; Make xerces use our version of jaxp in tests
12705 (substitute* "build.xml"
12706 (("xml-apis.jar")
12707 (string-append jaxp "/share/java/jaxp.jar"))
12708 (("\\$\\{tools.dir\\}/\\$\\{jar.apis\\}")
12709 "${jar.apis}")))
12710 #t))
12711 (replace 'install (install-jars "build")))))
12712 (inputs
12713 (list java-apache-xml-commons-resolver java-jaxp))
12714 (home-page "https://xerces.apache.org/xerces2-j/")
12715 (synopsis "Validating XML parser for Java with DOM level 3 support")
12716 (description "The Xerces2 Java parser is the reference implementation of
12717XNI, the Xerces Native Interface, and also a fully conforming XML Schema
12718processor.
12719
12720Xerces2-J supports the following standards and APIs:
12721
12722@itemize
12723@item eXtensible Markup Language (XML) 1.0 Second Edition Recommendation
12724@item Namespaces in XML Recommendation
12725@item Document Object Model (DOM) Level 2 Core, Events, and Traversal and
12726 Range Recommendations
12727@item Simple API for XML (SAX) 2.0.1 Core and Extension
12728@item Java APIs for XML Processing (JAXP) 1.2.01
12729@item XML Schema 1.0 Structures and Datatypes Recommendations
12730@item Experimental implementation of the Document Object Model (DOM) Level 3
12731 Core and Load/Save Working Drafts
12732@item Provides a partial implementation of the XML Inclusions (XInclude) W3C
12733 Candidate Recommendation
12734@end itemize
12735
12736Xerces is now able to parse documents written according to the XML 1.1
12737Candidate Recommendation, except that it does not yet provide an option to
12738enable normalization checking as described in section 2.13 of this
12739specification. It also handles namespaces according to the XML Namespaces 1.1
12740Candidate Recommendation, and will correctly serialize XML 1.1 documents if
12741the DOM level 3 load/save API's are in use.")
12742 (license license:asl2.0)))
12743
12744(define-public java-jakarta-regexp
12745 (package
12746 (name "java-jakarta-regexp")
12747 (version "1.5")
12748 (source
12749 (origin
12750 (method url-fetch)
12751 (uri (string-append
12752 "https://archive.apache.org/dist/jakarta/regexp/jakarta-regexp-"
12753 version ".tar.gz"))
12754 (sha256
12755 (base32
12756 "0zg9rmyif48dck0cv6ynpxv23mmcsx265am1fnnxss7brgw0ms3r"))))
12757 (build-system ant-build-system)
12758 (arguments
12759 `(#:test-target "test"
12760 #:phases
12761 (modify-phases %standard-phases
12762 (replace 'install
12763 (lambda* (#:key outputs #:allow-other-keys)
12764 (let* ((out (assoc-ref outputs "out"))
12765 (out-share (string-append out "/share/java")))
12766 (mkdir-p out-share)
12767 (for-each (lambda (name)
12768 (install-file name out-share))
12769 (find-files "build" "^jakarta-regexp-.*\\.jar$"))
12770 #t))))))
12771 (home-page "https://attic.apache.org/projects/jakarta-regexp.html")
12772 (synopsis "Regular expression parser generator for Java")
12773 (description "@code{jakarta-regexp} is an old regular expression parser
12774generator for Java.")
12775 (license license:asl2.0)))
12776
12777(define-public java-jline
12778 (package
12779 (name "java-jline")
12780 (version "1.0")
12781 (source (origin
12782 (method url-fetch)
12783 (uri (string-append "https://github.com/jline/jline1/archive/jline-"
12784 version ".tar.gz"))
12785 (sha256
12786 (base32
12787 "0bi3p6vrh7a6v0fbpb6rx9plpmx5zk3lr352xzdbz2jcxg499wir"))))
12788 (build-system ant-build-system)
12789 (arguments
12790 `(#:jar-name "jline.jar"
12791 #:source-dir "src/main/java"
12792 #:test-dir "src/test"
12793 #:phases
12794 (modify-phases %standard-phases
12795 (add-before 'build 'copy-resources
12796 (lambda _
12797 (copy-recursively "src/main/resources" "build/classes")
12798 #t)))))
12799 (native-inputs
12800 (list java-junit))
12801 (home-page "https://jline.github.io")
12802 (synopsis "Console input handling library")
12803 (description "JLine is a Java library for handling console input. It is
12804similar in functionality to BSD editline and GNU readline but with additional
12805features that bring it on par with the Z shell line editor.")
12806 (license license:bsd-3)))
12807
12808(define-public java-jline-2
12809 (package
12810 (inherit java-jline)
12811 (version "2.14.5")
12812 (source (origin
12813 (method url-fetch)
12814 (uri (string-append "https://github.com/jline/jline2/archive/jline-"
12815 version ".tar.gz"))
12816 (sha256
12817 (base32
12818 "1c6qa26mf0viw8hg4jnv72s7i1qb1gh1l8rrzcdvqhqhx82rkdlf"))))
12819 (arguments
12820 `(#:jdk ,icedtea-8
12821 ,@(package-arguments java-jline)))
12822 (inputs
12823 (list java-jansi-1 java-jansi-native))
12824 (native-inputs
12825 (list java-powermock-modules-junit4
12826 java-powermock-modules-junit4-common
12827 java-powermock-api-easymock
12828 java-powermock-api-support
12829 java-powermock-core
12830 java-powermock-reflect
12831 java-easymock
12832 java-jboss-javassist
12833 java-objenesis
12834 java-hamcrest-core
12835 java-cglib
12836 java-junit
12837 java-hawtjni))))
12838
12839(define-public java-jline-terminal
12840 (package
12841 (name "java-jline-terminal")
12842 (version "3.14.1")
12843 (source (origin
12844 (method git-fetch)
12845 (uri (git-reference
12846 (url "https://github.com/jline/jline3")
12847 (commit (string-append "jline-parent-" version))))
12848 (file-name (git-file-name name version))
12849 (sha256
12850 (base32
12851 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
12852 (build-system ant-build-system)
12853 (arguments
12854 `(#:jar-name "jline-terminal.jar"
12855 #:jdk ,openjdk11
12856 #:tests? #f; TODO: tests fail on *.caps resource lookups
12857 #:source-dir "terminal/src/main/java"
12858 #:test-dir "terminal/src/test"
12859 #:phases
12860 (modify-phases %standard-phases
12861 (add-after 'unpack 'remove-build-file
12862 (lambda _
12863 ;; Conflicts with build directory generated by ant-build-system.
12864 (delete-file "build")))
12865 (add-after 'unpack 'patch-paths
12866 (lambda* (#:key inputs #:allow-other-keys)
12867 (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java"
12868 (("= \"infocmp\"")
12869 (string-append "= \"" (assoc-ref inputs "ncurses")
12870 "/bin/infocmp\""))
12871 (("= \"(s?tty)\"" _ cmd)
12872 (string-append "= \"" (assoc-ref inputs "coreutils")
12873 "/bin/" cmd "\"")))))
12874 ;; Resources are not added to the JAR by ant-build-system.
12875 (add-after 'build 'add-resources
12876 (lambda* (#:key jar-name source-dir #:allow-other-keys)
12877 (let ((build (string-append (getcwd) "/build")))
12878 (with-directory-excursion
12879 (string-append source-dir "/../resources")
12880 (apply invoke "jar" "-uvf"
12881 (string-append build "/jar/" jar-name)
12882 (find-files ".")))))))))
12883 (inputs
12884 (list ncurses)); infocmp
12885 (home-page "https://github.com/jline/jline3")
12886 (synopsis "Java JLine Terminal API and implementations")
12887 (description "JLine is a Java library for handling console input. It is
12888similar in functionality to BSD editline and GNU readline but with additional
12889features that bring it in par with ZSH line editor. People familiar with the
12890readline/editline capabilities for modern shells (such as bash and tcsh) will
12891find most of the command editing features of JLine to be familiar.
12892
12893This package includes the @var{Terminal} API and implementations.")
12894 (license license:bsd-3)))
12895
12896(define-public java-jline-reader
12897 (package
12898 (name "java-jline-reader")
12899 (version "3.14.1")
12900 (source (origin
12901 (method git-fetch)
12902 (uri (git-reference
12903 (url "https://github.com/jline/jline3")
12904 (commit (string-append "jline-parent-" version))))
12905 (file-name (git-file-name name version))
12906 (sha256
12907 (base32
12908 "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr"))))
12909 (build-system ant-build-system)
12910 (arguments
12911 `(#:jar-name "jline-reader.jar"
12912 #:jdk ,openjdk11
12913 #:source-dir "reader/src/main/java"
12914 #:test-dir "reader/src/test"
12915 #:phases
12916 (modify-phases %standard-phases
12917 (add-before 'build 'remove-build-file
12918 (lambda _
12919 ;; conflicts with build directory generated by ant-build-system
12920 (delete-file "build"))))))
12921 (native-inputs
12922 (list java-junit java-easymock))
12923 (inputs
12924 (list java-jline-terminal))
12925 (home-page "https://github.com/jline/jline3")
12926 (synopsis "Java JLine line reader")
12927 (description "JLine is a Java library for handling console input. It is
12928similar in functionality to BSD editline and GNU readline but with additional
12929features that bring it in par with ZSH line editor. People familiar with the
12930readline/editline capabilities for modern shells (such as bash and tcsh) will
12931find most of the command editing features of JLine to be familiar.
12932
12933This package includes the line reader.")
12934 (license license:bsd-3)))
12935
12936(define-public java-xmlunit
12937 (package
12938 (name "java-xmlunit")
12939 (version "2.5.1")
12940 (source (origin
12941 (method url-fetch)
12942 (uri (string-append "https://github.com/xmlunit/xmlunit/archive/v"
12943 version ".tar.gz"))
12944 (file-name (string-append name "-" version ".tar.gz"))
12945 (sha256
12946 (base32
12947 "035rivlnmwhfqj0fzviciv0bkh1h95ps1iwnh2kjcvdbk5nccm4z"))))
12948 (build-system ant-build-system)
12949 (arguments
12950 `(#:jar-name "java-xmlunit.jar"
12951 #:source-dir "xmlunit-core/src/main/java"
12952 #:test-dir "xmlunit-core/src/test"
12953 #:phases
12954 (modify-phases %standard-phases
12955 (add-before 'check 'copy-test-resources
12956 (lambda* (#:key inputs #:allow-other-keys)
12957 (copy-recursively (assoc-ref inputs "resources") "../test-resources")
12958 #t)))))
12959 (native-inputs
12960 `(("java-junit" ,java-junit)
12961 ("java-mockito-1" ,java-mockito-1)
12962 ("java-hamcrest-all" ,java-hamcrest-all)
12963 ("java-objenesis" ,java-objenesis)
12964 ("java-cglib" ,java-cglib)
12965 ("resources"
12966 ,(origin
12967 (method git-fetch)
12968 (uri (git-reference
12969 (url "https://github.com/xmlunit/test-resources")
12970 (commit "a590d2ae865c3e0455691d76ba8eefccc2215aec")))
12971 (file-name "java-xmlunit-test-resources")
12972 (sha256
12973 (base32
12974 "0r0glj37pg5l868yjz78gckr91cs8fysxxbp9p328dssssi91agr"))))))
12975 (home-page "https://www.xmlunit.org/")
12976 (synopsis "XML output testing")
12977 (description "XMLUnit provides you with the tools to verify the XML you
12978emit is the one you want to create. It provides helpers to validate against
12979an XML Schema, assert the values of XPath queries or compare XML documents
12980against expected outcomes.")
12981 (license license:asl2.0)))
12982
12983(define-public java-xmlunit-legacy
12984 (package
12985 (inherit java-xmlunit)
12986 (name "java-xmlunit-legacy")
12987 (arguments
12988 `(#:jar-name "java-xmlunit-legacy.jar"
12989 #:source-dir "xmlunit-legacy/src/main/java"
12990 #:test-dir "xmlunit-legacy/src/test"))
12991 (inputs
12992 (list java-xmlunit java-junit))
12993 (native-inputs
12994 `(("java-mockito-1" ,java-mockito-1)))))
12995
12996(define-public java-xmlunit-matchers
12997 (package
12998 (inherit java-xmlunit)
12999 (name "java-xmlunit-matchers")
13000 (arguments
13001 `(#:jar-name "java-xmlunit-matchers.jar"
13002 #:source-dir "xmlunit-matchers/src/main/java"
13003 #:test-dir "xmlunit-matchers/src/test"
13004 #:test-exclude
13005 ;; Cannot open xsd for http://www.xmlunit.org/test-support/Book.xsd
13006 (list "**/ValidationMatcherTest.java")
13007 #:phases
13008 (modify-phases %standard-phases
13009 (add-before 'build 'copy-test-class
13010 (lambda _
13011 (copy-file "xmlunit-core/src/test/java/org/xmlunit/TestResources.java"
13012 "xmlunit-matchers/src/test/java/org/xmlunit/TestResources.java")
13013 #t))
13014 (add-before 'build 'fix-test-resources-path
13015 (lambda _
13016 (substitute* (find-files "xmlunit-matchers/src/test" ".*.java")
13017 (("../test-resources") "test-resources"))
13018 #t))
13019 (add-before 'check 'copy-test-resources
13020 (lambda* (#:key inputs #:allow-other-keys)
13021 (copy-recursively (assoc-ref inputs "resources") "test-resources")
13022 #t)))))
13023 (inputs
13024 (list java-xmlunit java-junit))))
13025
13026(define-public java-openchart2
13027 (package
13028 (name "java-openchart2")
13029 (version "1.4.3")
13030 (source (origin
13031 (method url-fetch)
13032 (uri (string-append "http://download.approximatrix.com/openchart2/"
13033 "openchart2-" version ".source.zip"))
13034 (sha256
13035 (base32
13036 "1xq96zm5r02n1blja0072jmmsifmxc40lbyfbnmcnr6mw42frh4g"))))
13037 (build-system ant-build-system)
13038 (arguments
13039 `(#:test-target "test"
13040 #:phases
13041 (modify-phases %standard-phases
13042 (add-after 'unpack 'fix-junit-errors
13043 (lambda _
13044 (with-directory-excursion "unittest/src/com/approximatrix/charting/"
13045 (substitute* '("coordsystem/ticklocator/NumericXTickLocatorTest.java"
13046 "coordsystem/ticklocator/NumericYTickLocatorTest.java"
13047 "coordsystem/ticklocator/ObjectXTickLocatorTest.java"
13048 "model/DefaultChartDataModelConstraintsTest.java"
13049 "model/MultiScatterDataModelConstraintsTest.java"
13050 "model/threedimensional/DotPlotDataModelConstraintsTest.java")
13051 (("(assertEquals[^;]+);" before _)
13052 (string-append (string-drop-right before 2) ", 1E-6);"))))
13053 #t))
13054 (replace 'install (install-jars ".")))))
13055 (native-inputs
13056 (list unzip java-junit java-hamcrest-core))
13057 (home-page "https://approximatrix.com/products/openchart2/")
13058 (synopsis "Simple plotting for Java")
13059 (description "Openchart2 provides a simple, yet powerful, interface for
13060Java programmers to create two-dimensional charts and plots. The library
13061features an assortment of graph styles, including advanced scatter plots, bar
13062graphs, and pie charts.")
13063 (license license:lgpl2.1+)))
13064
13065(define-public java-commons-httpclient
13066 (package
13067 (name "java-commons-httpclient")
13068 (version "3.1")
13069 (source (origin
13070 (method url-fetch)
13071 (uri (string-append "mirror://apache/httpcomponents/"
13072 "commons-httpclient/source/commons-httpclient-"
13073 version "-src.tar.gz"))
13074 (sha256
13075 (base32
13076 "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
13077 (build-system ant-build-system)
13078 (arguments
13079 `(#:build-target "compile"
13080 #:test-target "test"
13081 #:tests? #f; requires junit-textui (junit 3)
13082 #:phases
13083 (modify-phases %standard-phases
13084 (add-before 'build 'fix-accent
13085 (lambda _
13086 (for-each (lambda (file)
13087 (with-fluids ((%default-port-encoding "ISO-8859-1"))
13088 (substitute* file
13089 (("\\* @author Ortwin .*") "* @author Ortwin Glueck\n"))))
13090 '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
13091 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
13092 "src/test/org/apache/commons/httpclient/TestHttps.java"
13093 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))
13094 #t))
13095 (replace 'install
13096 (lambda* (#:key outputs #:allow-other-keys)
13097 (invoke "ant" "dist"
13098 (string-append "-Ddist.home=" (assoc-ref outputs "out")
13099 "/share/java"))
13100 #t)))))
13101 (propagated-inputs
13102 `(("java-commons-logging" ,java-commons-logging-minimal)
13103 ("java-commons-codec" ,java-commons-codec)))
13104 (home-page "https://hc.apache.org")
13105 (synopsis "HTTP/1.1 compliant HTTP agent implementation")
13106 (description "This package contains an HTTP/1.1 compliant HTTP agent
13107implementation. It also provides reusable components for client-side
13108authentication, HTTP state management, and HTTP connection management.")
13109 (license license:asl2.0)))
13110
13111(define-public java-commons-vfs
13112 (package
13113 (name "java-commons-vfs")
13114 (version "2.2")
13115 (source (origin
13116 (method url-fetch)
13117 (uri (string-append "mirror://apache/commons/vfs/source/"
13118 "commons-vfs2-distribution-" version "-src.tar.gz"))
13119 (file-name (string-append name "-" version ".tar.gz"))
13120 (sha256
13121 (base32
13122 "1cnq1iaghbp4cslpnvwbp83i5v234x87irssqynhwpfgw7caf1s3"))
13123 (modules '((guix build utils)))
13124 (snippet
13125 '(begin
13126 (for-each delete-file
13127 (find-files "." "\\.jar$"))
13128 #t))))
13129 (build-system ant-build-system)
13130 (arguments
13131 `(#:jar-name "commons-vfs.jar"
13132 #:source-dir "commons-vfs2/src/main/java"
13133 #:test-dir "commons-vfs2/src/test"
13134 ; FIXME: tests depend on many things: apache sshd, hadoop, ftpserver, ...
13135 #:tests? #f
13136 #:phases
13137 (modify-phases %standard-phases
13138 (add-before 'build 'remove-hadoop-and-webdav
13139 ; Remove these files as they are not required and depend on difficult
13140 ; packages.
13141 (lambda _
13142 (for-each delete-file-recursively
13143 '("commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/webdav"
13144 "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/hdfs"))
13145 #t)))))
13146 (inputs
13147 (list java-commons-collections4
13148 java-commons-compress
13149 java-commons-httpclient
13150 java-commons-logging-minimal
13151 java-commons-net
13152 java-jsch))
13153 (home-page "https://commons.apache.org/proper/commons-vfs/")
13154 (synopsis "Java file system library")
13155 (description "Commons VFS provides a single API for accessing various
13156different file systems. It presents a uniform view of the files from various
13157different sources, such as the files on local disk, on an HTTP server, or
13158inside a Zip archive.")
13159 (license license:asl2.0)))
13160
13161(define-public java-jakarta-oro
13162 (package
13163 (name "java-jakarta-oro")
13164 (version "2.0.8")
13165 (source (origin
13166 (method url-fetch)
13167 (uri (string-append "mirror://apache/jakarta/oro/"
13168 "jakarta-oro-" version ".tar.gz"))
13169 (sha256
13170 (base32
13171 "0rpmnsskiwmsy8r0sckz5n5dbvh3vkxx8hpm177c754r8xy3qksc"))
13172 (modules '((guix build utils)))
13173 (snippet
13174 `(begin
13175 (delete-file (string-append "jakarta-oro-" ,version ".jar"))
13176 #t))))
13177 (build-system ant-build-system)
13178 (arguments
13179 `(#:build-target "package"
13180 #:make-flags (list "-DDATE" "(no recorded date for reproducibility)")
13181 #:tests? #f; tests are run as part of the build process
13182 #:phases
13183 (modify-phases %standard-phases
13184 (replace 'install
13185 (install-jars ,(string-append "jakarta-oro-" version))))))
13186 (home-page "https://jakarta.apache.org/oro/")
13187 (synopsis "Text-processing for Java")
13188 (description "The Jakarta-ORO Java classes are a set of text-processing
13189Java classes that provide Perl5 compatible regular expressions, AWK-like
13190regular expressions, glob expressions, and utility classes for performing
13191substitutions, splits, filtering filenames, etc. This library is the successor
13192of the OROMatcher, AwkTools, PerlTools, and TextTools libraries originally
13193from ORO, Inc.")
13194 (license license:asl1.1)))
13195
13196(define-public java-native-access
13197 (package
13198 (name "java-native-access")
13199 (version "4.5.1")
13200 (source (origin
13201 (method url-fetch)
13202 (uri (string-append "https://github.com/java-native-access/jna/"
13203 "archive/" version ".tar.gz"))
13204 (file-name (string-append name "-" version ".tar.gz"))
13205 (sha256
13206 (base32
13207 "0zrpzkib6b905i018a9pqlzkqinphywr6y4jwv6mwp63jjqvqkd9"))
13208 (modules '((guix build utils)))
13209 (snippet
13210 `(begin
13211 (for-each delete-file (find-files "." ".*.jar"))
13212 (delete-file-recursively "native/libffi")
13213 (delete-file-recursively "dist")
13214 #t))))
13215 (build-system ant-build-system)
13216 (arguments
13217 `(#:tests? #f; FIXME: tests require reflections.jar
13218 #:test-target "test"
13219 #:make-flags (list "-Ddynlink.native=true")
13220 #:phases
13221 (modify-phases %standard-phases
13222 (add-before 'build 'fix-build.xml
13223 (lambda* (#:key inputs #:allow-other-keys)
13224 (substitute* "build.xml"
13225 ;; Since we removed the bundled ant.jar, give the correct path
13226 (("lib/ant.jar") (search-input-file inputs "/lib/ant.jar"))
13227 ;; We removed generated native libraries. We can only rebuild one
13228 ;; so don't fail if we can't find a native library for another architecture.
13229 (("zipfileset") "zipfileset erroronmissingarchive=\"false\""))
13230 ;; Copy test dependencies
13231 (copy-file (car (find-files (assoc-ref inputs "java-junit") "jar$"))
13232 "lib/junit.jar")
13233 (copy-file (car (find-files (assoc-ref inputs "java-hamcrest-core")
13234 "jar$"))
13235 "lib/hamcrest-core.jar")
13236 ;; FIXME: once reflections.jar is built, copy it to lib/test.
13237 #t))
13238 (add-before 'build 'build-native
13239 (lambda _
13240 (invoke "ant" "-Ddynlink.native=true" "native")
13241 #t))
13242 (replace 'install
13243 (install-jars "build")))))
13244 (inputs
13245 (list libffi libx11 libxt))
13246 (native-inputs
13247 (list gcc-7 java-junit java-hamcrest-core))
13248 (home-page "https://github.com/java-native-access/jna")
13249 (synopsis "Access to native shared libraries from Java")
13250 (description "JNA provides Java programs easy access to native shared
13251libraries without writing anything but Java code - no JNI or native code is
13252required. JNA allows you to call directly into native functions using natural
13253Java method invocation.")
13254 ;; Java Native Access project (JNA) is dual-licensed under 2
13255 ;; alternative Free licenses: LGPL 2.1 or later and Apache License 2.0.
13256 (license (list
13257 license:asl2.0
13258 license:lgpl2.1+))))
13259
13260(define-public java-native-access-platform
13261 (package
13262 (inherit java-native-access)
13263 (name "java-native-access-platform")
13264 (arguments
13265 `(#:test-target "test"
13266 #:tests? #f; require jna-test.jar
13267 #:phases
13268 (modify-phases %standard-phases
13269 (add-before 'build 'chdir
13270 (lambda _
13271 (chdir "contrib/platform")
13272 #t))
13273 (add-after 'chdir 'fix-ant
13274 (lambda* (#:key inputs #:allow-other-keys)
13275 (substitute* "nbproject/project.properties"
13276 (("../../build/jna.jar")
13277 (search-input-file inputs "/share/java/jna.jar"))
13278 (("../../lib/hamcrest-core-.*.jar")
13279 (car (find-files (assoc-ref inputs "java-hamcrest-core")
13280 "jar$")))
13281 (("../../lib/junit.jar")
13282 (car (find-files (assoc-ref inputs "java-junit")
13283 "jar$"))))
13284 #t))
13285 (replace 'install
13286 (install-jars "dist")))))
13287 (inputs
13288 (list java-native-access))
13289 (synopsis "Cross-platform mappings for jna")
13290 (description "java-native-access-platform has cross-platform mappings
13291and mappings for a number of commonly used platform functions, including a
13292large number of Win32 mappings as well as a set of utility classes that
13293simplify native access.")))
13294
13295(define-public java-jsch-agentproxy-core
13296 (package
13297 (name "java-jsch-agentproxy-core")
13298 (version "0.0.8")
13299 (source (origin
13300 (method url-fetch)
13301 (uri (string-append "https://github.com/ymnk/jsch-agent-proxy/archive/"
13302 version ".tar.gz"))
13303 (file-name (string-append name "-" version ".tar.gz"))
13304 (sha256
13305 (base32
13306 "02iqg6jbc1kxvfzqcg6wy9ygqxfm82bw5rf6vnswqy4y572niz4q"))))
13307 (build-system ant-build-system)
13308 (arguments
13309 `(#:jar-name "jsch-agentproxy-core.jar"
13310 #:source-dir "jsch-agent-proxy-core/src/main/java"
13311 #:tests? #f)); no tests
13312 (home-page "https://github.com/ymnk/jsch-agent-proxy")
13313 (synopsis "Core component of the proxy to ssh-agent and Pageant in Java")
13314 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13315and Pageant included Putty. It will be easily integrated into JSch, and users
13316will be allowed to use these programs for authentication.")
13317 (license license:bsd-3)))
13318
13319(define-public java-jsch-agentproxy-sshagent
13320 (package
13321 (inherit java-jsch-agentproxy-core)
13322 (name "java-jsch-agentproxy-sshagent")
13323 (arguments
13324 `(#:jar-name "jsch-agentproxy-sshagent.jar"
13325 #:source-dir "jsch-agent-proxy-sshagent/src/main/java"
13326 #:tests? #f)); no tests
13327 (inputs
13328 (list java-jsch-agentproxy-core))
13329 (synopsis "Proxy to ssh-agent")
13330 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13331and Pageant included in Putty. This component contains the code for a proxy to
13332ssh-agent.")))
13333
13334(define-public java-jsch-agentproxy-usocket-jna
13335 (package
13336 (inherit java-jsch-agentproxy-core)
13337 (name "java-jsch-agentproxy-usocket-jna")
13338 (arguments
13339 `(#:jar-name "jsch-agentproxy-usocket-jna.jar"
13340 #:source-dir "jsch-agent-proxy-usocket-jna/src/main/java"
13341 #:tests? #f)); no tests
13342 (inputs
13343 (list java-jsch-agentproxy-core java-native-access))
13344 (synopsis "USocketFactory implementation using JNA")
13345 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13346and Pageant included in Putty. This component contains an implementation of
13347USocketFactory using @dfn{JNA} (Java Native Access).")))
13348
13349(define-public java-jsch-agentproxy-pageant
13350 (package
13351 (inherit java-jsch-agentproxy-core)
13352 (name "java-jsch-agentproxy-pageant")
13353 (arguments
13354 `(#:jar-name "jsch-agentproxy-pageant.jar"
13355 #:source-dir "jsch-agent-proxy-pageant/src/main/java"
13356 #:tests? #f)); no tests
13357 (inputs
13358 (list java-jsch-agentproxy-core java-native-access
13359 java-native-access-platform))
13360 (synopsis "Proxy to pageant")
13361 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13362and Pageant included in Putty. This component contains the code for a proxy to
13363pageant.")))
13364
13365(define-public java-jsch-agentproxy-usocket-nc
13366 (package
13367 (inherit java-jsch-agentproxy-core)
13368 (name "java-jsch-agentproxy-usocket-nc")
13369 (arguments
13370 `(#:jar-name "jsch-agentproxy-usocket-nc.jar"
13371 #:source-dir "jsch-agent-proxy-usocket-nc/src/main/java"
13372 #:tests? #f)); no tests
13373 (inputs
13374 (list java-jsch-agentproxy-core))
13375 (synopsis "USocketFactory implementation using netcat")
13376 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13377and Pageant included in Putty. This component contains an implementation of
13378USocketFactory using netcat.")))
13379
13380(define-public java-jsch-agentproxy-connector-factory
13381 (package
13382 (inherit java-jsch-agentproxy-core)
13383 (name "java-jsch-agentproxy-connector-factory")
13384 (arguments
13385 `(#:jar-name "jsch-agentproxy-connector-factory.jar"
13386 #:source-dir "jsch-agent-proxy-connector-factory/src/main/java"
13387 #:tests? #f)); no tests
13388 (inputs
13389 (list java-jsch-agentproxy-core java-jsch-agentproxy-sshagent
13390 java-jsch-agentproxy-usocket-jna java-jsch-agentproxy-pageant
13391 java-jsch-agentproxy-usocket-nc))
13392 (synopsis "Connector factory for jsch agent proxy")
13393 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13394and Pageant included in Putty. This component contains a connector factory.")))
13395
13396(define-public java-jsch-agentproxy-jsch
13397 (package
13398 (inherit java-jsch-agentproxy-core)
13399 (name "java-jsch-agentproxy-jsch")
13400 (arguments
13401 `(#:jar-name "jsch-agentproxy-jsch.jar"
13402 #:source-dir "jsch-agent-proxy-jsch/src/main/java"
13403 #:tests? #f)); no tests
13404 (inputs
13405 (list java-jsch java-jsch-agentproxy-core))
13406 (synopsis "JSch integration library for agentproxy")
13407 (description "jsch-agent-proxy is a proxy program to OpenSSH's ssh-agent
13408and Pageant included in Putty. This component contains a library to use
13409jsch-agent-proxy with JSch.")))
13410
13411(define-public java-apache-ivy
13412 (package
13413 (name "java-apache-ivy")
13414 (version "2.4.0")
13415 (source (origin
13416 (method url-fetch)
13417 (uri (string-append "mirror://apache//ant/ivy/" version
13418 "/apache-ivy-" version "-src.tar.gz"))
13419 (sha256
13420 (base32
13421 "1xkfn57g2m7l6y0xdq75x5rnrgk52m9jx2xah70g3ggl8750hbr0"))
13422 (patches
13423 (search-patches
13424 "java-apache-ivy-port-to-latest-bouncycastle.patch"))))
13425 (build-system ant-build-system)
13426 (arguments
13427 `(#:jar-name "ivy.jar"
13428 #:tests? #f
13429 #:phases
13430 (modify-phases %standard-phases
13431 (add-before 'build 'remove-example
13432 (lambda _
13433 (delete-file-recursively "src/example")
13434 #t))
13435 (add-before 'build 'copy-resources
13436 (lambda _
13437 (with-directory-excursion "src/java"
13438 (for-each (lambda (file)
13439 (install-file file (string-append "../../build/classes/" (dirname file))))
13440 (append
13441 (find-files "." ".*.css")
13442 (find-files "." ".*.ent")
13443 (find-files "." ".*.html")
13444 (find-files "." ".*.properties")
13445 (find-files "." ".*.xsd")
13446 (find-files "." ".*.xsl")
13447 (find-files "." ".*.xml"))))
13448 #t))
13449 (add-before 'build 'fix-vfs
13450 (lambda _
13451 (substitute*
13452 '("src/java/org/apache/ivy/plugins/repository/vfs/VfsRepository.java"
13453 "src/java/org/apache/ivy/plugins/repository/vfs/VfsResource.java")
13454 (("import org.apache.commons.vfs") "import org.apache.commons.vfs2"))
13455 #t))
13456 (add-before 'install 'copy-manifest
13457 (lambda _
13458 (install-file "META-INF/MANIFEST.MF" "build/classes/META-INF")
13459 #t))
13460 (add-before 'install 'repack
13461 (lambda _
13462 (invoke "jar" "-cmf" "build/classes/META-INF/MANIFEST.MF" "build/jar/ivy.jar"
13463 "-C" "build/classes" ".")))
13464 (add-after 'install 'install-bin
13465 (lambda* (#:key outputs #:allow-other-keys)
13466 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
13467 (ivy (string-append bin "/ivy"))
13468 (jar (string-append (assoc-ref outputs "out") "/share/java/ivy.jar")))
13469 (mkdir-p bin)
13470 (with-output-to-file ivy
13471 (lambda _
13472 (display (string-append
13473 "#!" (which "sh") "\n"
13474 "if [[ -z $CLASSPATH ]]; then\n"
13475 " cp=\"" (getenv "CLASSPATH") ":" jar "\"\n"
13476 "else\n"
13477 " cp=\"" (getenv "CLASSPATH") ":" jar ":$CLASSPATH\"\n"
13478 "fi\n"
13479 (which "java") " -cp $cp org.apache.ivy.Main $@\n"))))
13480 (chmod ivy #o755)
13481 #t))))))
13482 (inputs
13483 (list java-bouncycastle
13484 java-commons-cli
13485 java-commons-collections
13486 java-commons-httpclient
13487 java-commons-lang
13488 java-commons-vfs
13489 java-jakarta-oro
13490 java-jsch
13491 java-jsch-agentproxy-core
13492 java-jsch-agentproxy-connector-factory
13493 java-jsch-agentproxy-jsch
13494 java-junit))
13495 (home-page "https://ant.apache.org/ivy")
13496 (synopsis "Dependency manager for the Java programming language")
13497 (description "Ivy is a tool for managing (recording, tracking, resolving
13498and reporting) project dependencies. It is characterized by the following:
13499
13500@itemize
13501@item flexibility and configurability - Ivy is essentially process agnostic
13502 and is not tied to any methodology or structure. Instead it provides the
13503 necessary flexibility and configurability to be adapted to a broad range
13504 of dependency management and build processes.
13505@item tight integration with Apache Ant - while available as a standalone tool,
13506 Ivy works particularly well with Apache Ant providing a number of
13507 powerful Ant tasks ranging from dependency resolution to dependency
13508 reporting and publication.
13509@end itemize")
13510 (license license:asl2.0)))
13511
13512(define-public java-eclipse-sisu-inject
13513 (package
13514 (name "java-eclipse-sisu-inject")
13515 (version "0.3.5")
13516 (source (origin
13517 (method git-fetch)
13518 (uri (git-reference
13519 (url "https://github.com/eclipse/sisu.inject/")
13520 (commit (string-append "releases/" version))))
13521 (file-name (git-file-name name version))
13522 (sha256
13523 (base32
13524 "1yh434b8pi8cwmpk825fbvbnkkk2cwd4gxxjaygg8i9j0q3l9zp3"))))
13525 (build-system ant-build-system)
13526 (arguments
13527 `(#:jar-name "eclipse-sisu-inject.jar"
13528 #:source-dir "org.eclipse.sisu.inject/src"
13529 #:tests? #f; no tests
13530 #:phases
13531 (modify-phases %standard-phases
13532 (replace 'install
13533 (install-from-pom "org.eclipse.sisu.inject/pom.xml")))))
13534 (propagated-inputs
13535 (list java-guice java-sisu-inject-parent-pom))
13536 (inputs
13537 (list java-guice-servlet
13538 java-javax-inject
13539 java-javaee-servletapi
13540 java-junit
13541 java-slf4j-api
13542 java-jsr305
13543 java-jsr250
13544 java-cdi-api
13545 java-osgi-framework
13546 java-osgi-util-tracker
13547 java-testng))
13548 (home-page "https://www.eclipse.org/sisu/")
13549 (synopsis "Classpath scanning, auto-binding, and dynamic auto-wiring")
13550 (description "Sisu is a modular JSR330-based container that supports
13551classpath scanning, auto-binding, and dynamic auto-wiring. Sisu uses
13552Google-Guice to perform dependency injection and provide the core JSR330
13553support, but removes the need to write explicit bindings in Guice modules.
13554Integration with other containers via the Eclipse Extension Registry and the
13555OSGi Service Registry is a goal of this project.")
13556 (license license:epl1.0)))
13557
13558(define java-sisu-inject-parent-pom
13559 (package
13560 (inherit java-eclipse-sisu-inject)
13561 (name "java-sisu-inject-parent-pom")
13562 (arguments
13563 `(#:tests? #f
13564 #:phases
13565 (modify-phases %standard-phases
13566 (delete 'configure)
13567 (delete 'build)
13568 (replace 'install
13569 (install-pom-file "pom.xml")))))
13570 (propagated-inputs '())))
13571
13572(define-public java-eclipse-sisu-plexus
13573 (package
13574 (name "java-eclipse-sisu-plexus")
13575 (version "0.3.5")
13576 (source (origin
13577 (method git-fetch)
13578 (uri (git-reference
13579 (url "https://github.com/eclipse/sisu.plexus")
13580 (commit (string-append "releases/" version))))
13581 (file-name (git-file-name name version))
13582 (sha256
13583 (base32
13584 "0lm5h0dmh41ffcwd32qnk3a87d360am36yq7168ikkyqa8jxkx28"))
13585 (modules '((guix build utils)))
13586 (snippet
13587 '(begin
13588 (for-each delete-file (find-files "." ".*.jar"))
13589 (rename-file "org.eclipse.sisu.plexus.tests/src"
13590 "org.eclipse.sisu.plexus.tests/java")
13591 #t))))
13592 (build-system ant-build-system)
13593 (arguments
13594 `(#:jar-name "eclipse-sisu-plexus.jar"
13595 #:source-dir "org.eclipse.sisu.plexus/src"
13596 #:test-dir "org.eclipse.sisu.plexus.tests"
13597 #:test-exclude
13598 (list
13599 ;; This test fails probably because we can't generate the necessary
13600 ;; meta-inf files.
13601 "**/PlexusLoggingTest.*"
13602 ;; FIXME: This test fails because of some injection error
13603 "**/PlexusRequirementTest.*")
13604 #:jdk ,icedtea-8
13605 #:phases
13606 (modify-phases %standard-phases
13607 (add-before 'build 'copy-resources
13608 (lambda _
13609 (install-file "org.eclipse.sisu.plexus/META-INF/plexus/components.xml"
13610 "build/classes/META-INF/plexus")
13611 #t))
13612 (add-before 'check 'build-test-jar
13613 (lambda _
13614 (with-directory-excursion "org.eclipse.sisu.plexus.tests/resources/component-jar/src/main/"
13615 (mkdir "build")
13616 (with-directory-excursion "java"
13617 (apply invoke "javac" "-cp"
13618 (string-append (getenv "CLASSPATH")
13619 ":../../../../../build/classes")
13620 (find-files "." ".*.java"))
13621 (for-each (lambda (file) (install-file file (string-append "../build/" file)))
13622 (find-files "." ".*.jar")))
13623 (mkdir-p "build/META-INF/plexus")
13624 (copy-file "resources/META-INF/plexus/components.xml"
13625 "build/META-INF/plexus/components.xml")
13626 (with-directory-excursion "build"
13627 (invoke "jar" "cf" "../../../component-jar-0.1.jar" ".")))
13628 (with-directory-excursion "org.eclipse.sisu.plexus.tests/"
13629 (copy-recursively "META-INF" "../build/test-classes/META-INF")
13630 (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java"
13631 (("resources/component-jar")
13632 "org.eclipse.sisu.plexus.tests/resources/component-jar")))
13633 #t))
13634 (replace 'install
13635 (install-from-pom "org.eclipse.sisu.plexus/pom.xml")))))
13636 (propagated-inputs
13637 (list java-jsr250
13638 java-plexus-classworlds
13639 java-plexus-utils
13640 java-plexus-component-annotations
13641 java-cdi-api
13642 java-eclipse-sisu-inject
13643 java-sisu-plexus-parent-pom))
13644 (inputs
13645 (list java-osgi-framework
13646 java-slf4j-api
13647 java-javax-inject
13648 java-guice
13649 java-guava
13650 java-aopalliance
13651 java-cglib))
13652 (native-inputs
13653 (list java-junit))
13654 (home-page "https://www.eclipse.org/sisu/")
13655 (synopsis "Plexus support for the sisu container")
13656 (description "Sisu is a modular JSR330-based container that supports
13657classpath scanning, auto-binding, and dynamic auto-wiring. This package
13658adds Plexus support to the Sisu-Inject container.")
13659 (license license:epl1.0)))
13660
13661(define java-sisu-plexus-parent-pom
13662 (package
13663 (inherit java-eclipse-sisu-plexus)
13664 (name "java-sisu-plexus-parent-pom")
13665 (arguments
13666 `(#:tests? #f
13667 #:phases
13668 (modify-phases %standard-phases
13669 (delete 'configure)
13670 (delete 'build)
13671 (replace 'install
13672 (install-pom-file "pom.xml")))))
13673 (propagated-inputs
13674 `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9)))))
13675
13676(define-public java-commons-compiler
13677 (package
13678 (name "java-commons-compiler")
13679 (version "3.0.8")
13680 (source (origin
13681 (method git-fetch)
13682 (uri (git-reference
13683 (url "https://github.com/janino-compiler/janino")
13684 (commit "91aa95686d1e4ca3b16a984a03a38686572331b2")))
13685 (file-name (string-append name "-" version))
13686 (sha256
13687 (base32
13688 "04hfdl59sgh20qkxzgnibvs8f9hy6n7znxwpk611y5d89977y62r"))
13689 (modules '((guix build utils)))
13690 (snippet
13691 '(begin
13692 (for-each delete-file
13693 (find-files "." "\\.jar$"))
13694 #t))))
13695 (build-system ant-build-system)
13696 (arguments
13697 `(#:jar-name "commons-compiler.jar"
13698 #:source-dir "commons-compiler/src/main"
13699 #:tests? #f)); no tests
13700 (home-page "https://github.com/janino-compiler/janino")
13701 (synopsis "Java compiler")
13702 (description "Commons-compiler contains an API for janino, including the
13703@code{IExpressionEvaluator}, @code{IScriptEvaluator}, @code{IClassBodyEvaluator}
13704and @code{ISimpleCompiler} interfaces.")
13705 (license license:bsd-3)))
13706
13707(define-public java-janino
13708 (package
13709 (inherit java-commons-compiler)
13710 (name "java-janino")
13711 (arguments
13712 `(#:jar-name "janino.jar"
13713 #:source-dir "src/main/java"
13714 #:phases
13715 (modify-phases %standard-phases
13716 (add-before 'configure 'chdir
13717 (lambda _
13718 (chdir "janino")
13719 #t)))))
13720 (inputs
13721 (list java-commons-compiler))
13722 (native-inputs
13723 (list java-junit java-hamcrest-core))
13724 (description "Janino is a Java compiler. Janino can compile a set of
13725source files to a set of class files like @code{javac}, but also compile a
13726Java expression, block, class body or source file in memory, load the bytecode
13727and execute it directly in the same JVM. @code{janino} can also be used for
13728static code analysis or code manipulation.")))
13729
13730(define-public java-logback-core
13731 (package
13732 (name "java-logback-core")
13733 (version "1.2.3")
13734 (source (origin
13735 (method git-fetch)
13736 (uri (git-reference
13737 (url "https://github.com/qos-ch/logback/")
13738 (commit (string-append "v_" version))))
13739 (file-name (git-file-name name version))
13740 (sha256
13741 (base32
13742 "055jbfpg3l5qw7pw2snkdag0gjkb4vcxfg9110cqqyc40k2nd17z"))
13743 (modules '((guix build utils)))
13744 (snippet
13745 '(delete-file-recursively "logback-access/lib"))))
13746 (build-system ant-build-system)
13747 (arguments
13748 `(#:jar-name "logback.jar"
13749 #:source-dir "src/main/java"
13750 #:test-dir "src/test"
13751 #:test-exclude
13752 ;; These tests fail with Unable to set MockitoNamingPolicy on cglib generator
13753 ;; which creates FastClasses
13754 (list "**/AllCoreTest.*"
13755 "**/AutoFlushingObjectWriterTest.*"
13756 "**/PackageTest.*"
13757 "**/ResilientOutputStreamTest.*"
13758 ;; And we still don't want to run abstract classes
13759 "**/Abstract*.*")
13760 #:phases
13761 (modify-phases %standard-phases
13762 (add-before 'configure 'chdir
13763 (lambda _ (chdir "logback-core"))))))
13764 (inputs
13765 (list java-javax-mail
13766 java-javaee-servletapi
13767 java-commons-compiler
13768 java-janino))
13769 (native-inputs
13770 (list java-junit
13771 java-hamcrest-core
13772 java-mockito-1
13773 java-cglib
13774 java-objenesis
13775 java-joda-time))
13776 (home-page "https://logback.qos.ch")
13777 (synopsis "Logging for java")
13778 (description "Logback is intended as a successor to the popular log4j project.
13779This module lays the groundwork for the other two modules.")
13780 ;; Either epl1.0 or lgpl2.1
13781 (license (list license:epl1.0
13782 license:lgpl2.1))))
13783
13784(define-public java-logback-classic
13785 (package
13786 (inherit java-logback-core)
13787 (name "java-logback-classic")
13788 (arguments
13789 `(#:jar-name "logback-classic.jar"
13790 #:source-dir "src/main/java"
13791 #:test-dir "src/test"
13792 #:tests? #f; tests require more packages: h2, greenmail, hsql, subethamail, slf4j, log4j, felix
13793 #:jdk ,icedtea-8
13794 #:phases
13795 (modify-phases %standard-phases
13796 (add-before 'configure 'chdir
13797 (lambda _
13798 (chdir "logback-classic")
13799 #t))
13800 (replace 'build
13801 (lambda* (#:key inputs #:allow-other-keys)
13802 (mkdir-p "build/classes")
13803 (setenv "CLASSPATH"
13804 (string-join
13805 (apply append (map (lambda (input)
13806 (find-files (assoc-ref inputs input)
13807 ".*.jar"))
13808 '("java-logback-core" "java-slf4j-api"
13809 "java-commons-compiler" "java-javaee-servletapi"
13810 "groovy")))
13811 ":"))
13812 (apply invoke "groovyc" "-d" "build/classes" "-j"
13813 (find-files "src/main/" ".*\\.(groovy|java)$"))
13814 (invoke "ant" "jar")
13815 #t)))))
13816 (inputs
13817 (modify-inputs (package-inputs java-logback-core)
13818 (prepend java-logback-core java-slf4j-api)))
13819 (native-inputs
13820 (list groovy))
13821 (description "Logback is intended as a successor to the popular log4j project.
13822This module can be assimilated to a significantly improved version of log4j.
13823Moreover, @code{logback-classic} natively implements the slf4j API so that you
13824can readily switch back and forth between logback and other logging frameworks
13825such as log4j or @code{java.util.logging} (JUL).")))
13826
13827(define-public java-jgit
13828 (package
13829 (name "java-jgit")
13830 (version "4.7.0.201704051617-r")
13831 (source (origin
13832 (method url-fetch)
13833 (uri (string-append "https://repo1.maven.org/maven2/"
13834 "org/eclipse/jgit/org.eclipse.jgit/"
13835 version "/org.eclipse.jgit-"
13836 version "-sources.jar"))
13837 (sha256
13838 (base32
13839 "13ii4jn02ynzq6i7gsyi21k2i94jpc85wf6bcm31q4cyvzv0mk4k"))))
13840 (build-system ant-build-system)
13841 (arguments
13842 `(#:tests? #f ; There are no tests to run.
13843 #:jar-name "jgit.jar"
13844 ;; JGit must be built with a JDK supporting Java 8.
13845 #:jdk ,icedtea-8
13846 ;; Target our older default JDK.
13847 #:make-flags (list "-Dtarget=1.7")
13848 #:phases
13849 (modify-phases %standard-phases
13850 ;; The jar file generated by the default build.xml does not include
13851 ;; the text properties files, so we need to add them.
13852 (add-after 'build 'add-properties
13853 (lambda* (#:key jar-name #:allow-other-keys)
13854 (with-directory-excursion "src"
13855 (apply invoke "jar" "-uf"
13856 (string-append "../build/jar/" jar-name)
13857 (find-files "." "\\.properties$")))
13858 #t)))))
13859 (inputs
13860 (list java-classpathx-servletapi java-javaewah java-jsch
13861 java-slf4j-api))
13862 (home-page "https://eclipse.org/jgit/")
13863 (synopsis "Java library implementing the Git version control system")
13864 (description "JGit is a lightweight, pure Java library implementing the
13865Git version control system, providing repository access routines, support for
13866network protocols, and core version control algorithms.")
13867 (license license:edl1.0)))
13868
13869;; For axoloti.
13870(define-public java-jgit-4.2
13871 (package (inherit java-jgit)
13872 (version "4.2.0.201601211800-r")
13873 (source (origin
13874 (method url-fetch)
13875 (uri (string-append "https://repo1.maven.org/maven2/"
13876 "org/eclipse/jgit/org.eclipse.jgit/"
13877 version "/org.eclipse.jgit-"
13878 version "-sources.jar"))
13879 (sha256
13880 (base32
13881 "15gm537iivhnzlkjym4x3wn5jqdjdragsw9pdpzqqg21nrc817mm"))))
13882 (build-system ant-build-system)
13883 (arguments
13884 (substitute-keyword-arguments (package-arguments java-jgit)
13885 ((#:phases phases)
13886 `(modify-phases ,phases
13887 (add-after 'unpack 'use-latest-javaewah-API
13888 (lambda _
13889 (substitute* "src/org/eclipse/jgit/internal/storage/file/BitmapIndexImpl.java"
13890 (("wordinbits") "WORD_IN_BITS"))))))))
13891 (inputs
13892 (list java-javaewah java-jsch java-slf4j-api))))
13893
13894(define-public abcl
13895 (package
13896 (name "abcl")
13897 (version "1.9.3")
13898 (source
13899 (origin
13900 (method url-fetch)
13901 (uri (string-append "https://abcl.org/releases/"
13902 version "/abcl-src-" version ".tar.gz"))
13903 (sha256
13904 (base32
13905 "1zxjpwv98bq2yd5qg08sbkajj17m7b8xmzqhw296161s7lia215v"))
13906 (patches
13907 (search-patches
13908 "abcl-fix-build-xml.patch"))))
13909 (build-system ant-build-system)
13910 (native-inputs
13911 (list java-junit))
13912 (arguments
13913 `(#:build-target "abcl.jar"
13914 #:test-target "abcl.test"
13915 #:phases
13916 (modify-phases %standard-phases
13917 (replace 'install
13918 (lambda* (#:key outputs #:allow-other-keys)
13919 (let ((share (string-append (assoc-ref outputs "out")
13920 "/share/java/"))
13921 (bin (string-append (assoc-ref outputs "out")
13922 "/bin/")))
13923 (mkdir-p share)
13924 (install-file "dist/abcl.jar" share)
13925 (install-file "dist/abcl-contrib.jar" share)
13926 (mkdir-p bin)
13927 (with-output-to-file (string-append bin "abcl")
13928 (lambda _
13929 (let ((classpath (string-append
13930 share "abcl.jar"
13931 ":"
13932 share "abcl-contrib.jar")))
13933 (display (string-append
13934 "#!" (which "bash") "\n"
13935 "if [[ -z $CLASSPATH ]]; then\n"
13936 " cp=\"" classpath "\"\n"
13937 "else\n"
13938 " cp=\"" classpath ":$CLASSPATH\"\n"
13939 "fi\n"
13940 "exec " (which "java")
13941 " -cp \"$cp\" org.armedbear.lisp.Main \"$@\"\n")))))
13942 (chmod (string-append bin "abcl") #o755)
13943 #t))))))
13944 (home-page "https://abcl.org/")
13945 (synopsis "Common Lisp Implementation on the JVM")
13946 (description
13947 "@dfn{Armed Bear Common Lisp} (ABCL) is a full implementation of the Common
13948Lisp language featuring both an interpreter and a compiler, running in the
13949JVM. It supports JSR-223 (Java scripting API): it can be a scripting engine
13950in any Java application. Additionally, it can be used to implement (parts of)
13951the application using Java to Lisp integration APIs.")
13952 (native-search-paths
13953 (list (search-path-specification
13954 (variable "XDG_DATA_DIRS")
13955 (files '("share")))))
13956 (license (list license:gpl2+
13957 ;; named-readtables is released under 3 clause BSD
13958 license:bsd-3
13959 ;; jfli is released under CPL 1.0
13960 license:cpl1.0))))
13961
13962(define-public java-jsonp-api
13963 (package
13964 (name "java-jsonp-api")
13965 (version "1.1.6")
13966 (source (origin
13967 (method git-fetch)
13968 (uri (git-reference
13969 (url "https://github.com/eclipse-ee4j/jsonp")
13970 (commit (string-append "1.1-" version "-RELEASE"))))
13971 (file-name (git-file-name name version))
13972 (sha256
13973 (base32
13974 "0zrj03hkr3jdmqlb4ipjr37cqpp2q2814qpmxi7srlwpdqs0ibgc"))))
13975 (build-system ant-build-system)
13976 (arguments
13977 `(#:jar-name "jsonp-api.jar"
13978 #:tests? #f
13979 #:source-dir "api/src/main/java"
13980 #:test-dir "api/src/test"))
13981 (home-page "https://eclipse-ee4j.github.io/jsonp/")
13982 (synopsis "JSON Processing in Java")
13983 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
13984parse, generate, transform and query) JSON messages. It produces and
13985consumes JSON text in a streaming fashion (similar to StAX API for XML)
13986and allows building a Java object model for JSON text using API classes
13987(similar to DOM API for XML).")
13988 ;; either gpl2 only with classpath exception, or epl2.0.
13989 (license (list license:gpl2
13990 license:epl2.0))))
13991
13992(define-public java-jsonp-impl
13993 (package
13994 (inherit java-jsonp-api)
13995 (name "java-jsonp-impl")
13996 (arguments
13997 `(#:jar-name "jsonp-impl.jar"
13998 #:tests? #f
13999 #:source-dir "impl/src/main/java"
14000 #:test-dir "impl/src/test"
14001 #:phases
14002 (modify-phases %standard-phases
14003 (add-before 'build 'copy-resources
14004 (lambda _
14005 (copy-recursively
14006 "impl/src/main/resources/"
14007 "build/classes")
14008 #t)))))
14009 (propagated-inputs
14010 (list java-jsonp-api))
14011 (description "JSON Processing (JSON-P) is a Java API to process (e.g.
14012parse, generate, transform and query) JSON messages. This package contains
14013a reference implementation of that API.")))
14014
14015(define-public java-jakarta-json
14016 (package
14017 (name "java-jakarta-json")
14018 (version "2.1.3")
14019 (source (origin
14020 (method git-fetch)
14021 (uri (git-reference
14022 (url "https://github.com/jakartaee/jsonp-api")
14023 (commit (string-append version "-RELEASE"))))
14024 (file-name (git-file-name name version))
14025 (sha256
14026 (base32
14027 "1q600harqfhlf763l75j4fx7ai7ybp7ga06aiky2a2hg8mhz0s5f"))))
14028 (build-system ant-build-system)
14029 (arguments
14030 `(#:jar-name "jakarta-json.jar"
14031 #:source-dir "api/src/main/java"
14032 #:tests? #f; no tests
14033 #:jdk ,openjdk11))
14034 (home-page "https://github.com/jakartaee/jsonp-api")
14035 (synopsis "Portable API for JSON handling in Java")
14036 (description "This project contains API and Compatible Implementation of
14037Jakarta JSON Processing specification. Jakarta JSON Processing provides
14038portable APIs to parse, generate, transform, and query JSON documents.")
14039 ;; with classpath exception
14040 (license license:epl2.0)))
14041
14042(define-public java-parsson
14043 (package
14044 (name "java-parsson")
14045 (version "1.1.5")
14046 (source (origin
14047 (method git-fetch)
14048 (uri (git-reference
14049 (url "https://github.com/eclipse-ee4j/parsson")
14050 (commit version)))
14051 (file-name (git-file-name name version))
14052 (sha256
14053 (base32
14054 "06vvr6qv1ihnk212gdxg4x0sd61lgxk7wf062s7gym5k2h7fms0p"))))
14055 (build-system ant-build-system)
14056 (arguments
14057 `(#:jar-name "parsson.jar"
14058 #:source-dir "impl/src/main/java"
14059 #:test-dir "impl/src/test"
14060 #:use-java-modules? #t
14061 #:jdk ,openjdk11
14062 #:phases
14063 (modify-phases %standard-phases
14064 (add-after 'unpack 'copy-resources
14065 (lambda _
14066 (copy-recursively "impl/src/main/resources"
14067 "build/classes"))))))
14068 (inputs
14069 (list java-jakarta-json))
14070 (native-inputs
14071 (list java-junit))
14072 (home-page "https://github.com/eclipse-ee4j/parsson")
14073 (synopsis "Implementation of Jakarta JSON API")
14074 (description "Eclipse Parsson is an implementation of the Jakarta JSON
14075Processing specification.")
14076 ;; with classpath exception
14077 (license license:epl2.0)))
14078
14079(define-public java-jakarta-annotations-api
14080 (package
14081 (name "java-jakarta-annotations-api")
14082 (version "2.1.1")
14083 (source (origin
14084 (method git-fetch)
14085 (uri (git-reference
14086 (url "https://github.com/jakartaee/common-annotations-api")
14087 (commit version)))
14088 (file-name (git-file-name name version))
14089 (sha256
14090 (base32
14091 "0xq2n2pijal5p75vl9dz10i6hhdmaxw5q8j3aza717xkpxxby9p6"))))
14092 (build-system ant-build-system)
14093 (arguments
14094 `(#:jar-name "jakarta-annotations-api.jar"
14095 #:source-dir "api/src/main/java"
14096 #:tests? #f; no tests
14097 #:jdk ,openjdk11))
14098 (home-page "https://github.com/jakartaee/common-annotations-api")
14099 (synopsis "Collection of Java annotations")
14100 (description "Jakarta Annotations defines a collection of annotations
14101representing common semantic concepts that enable a declarative style of
14102programming that applies across a variety of Java technologies.")
14103 ;; with classpath exception
14104 (license (list license:epl2.0
14105 license:gpl2))))
14106
14107(define-public java-xmp
14108 (package
14109 (name "java-xmp")
14110 (version "5.1.3")
14111 (source (origin
14112 (method url-fetch)
14113 (uri (string-append "http://download.macromedia.com/pub/developer"
14114 "/xmp/sdk/XMPCoreJava-" version ".zip"))
14115 (sha256
14116 (base32
14117 "14nai2mmsg7l5ya2y5mx4w4lr1az3sk2fjz6hiy4zdrsavgvl1g7"))))
14118 (build-system ant-build-system)
14119 (arguments
14120 `(#:build-target "build"
14121 #:tests? #f; no tests
14122 #:phases
14123 (modify-phases %standard-phases
14124 (add-after 'unpack 'chdir
14125 (lambda _
14126 (chdir "XMPCore")
14127 #t))
14128 (add-before 'build 'fix-timestamp
14129 (lambda _
14130 (substitute* "build.xml"
14131 (("\\$\\{BuildDate\\}") "1970 Jan 01 00:00:00-GMT"))
14132 #t))
14133 (replace 'install
14134 (install-jars "."))
14135 (add-after 'install 'install-doc
14136 (lambda* (#:key outputs #:allow-other-keys)
14137 (copy-recursively
14138 "docs"
14139 (string-append (assoc-ref outputs "out") "/share/doc/java-xmp"))
14140 #t)))))
14141 (native-inputs
14142 (list unzip))
14143 (home-page "https://www.adobe.com/devnet/xmp.html")
14144 (synopsis "Extensible Metadat Platform (XMP) support in Java")
14145 (description "Adobe's Extensible Metadata Platform (XMP) is a labeling
14146technology that allows you to embed data about a file, known as metadata,
14147into the file itself. The XMP Toolkit for Java is based on the C++ XMPCore
14148library and the API is similar.")
14149 (license license:bsd-3)))
14150
14151(define-public java-args4j
14152 (package
14153 (name "java-args4j")
14154 (version "2.33")
14155 (source (origin
14156 (method git-fetch)
14157 (uri (git-reference
14158 (url "https://github.com/kohsuke/args4j")
14159 (commit (string-append "args4j-site-" version))))
14160 (file-name (git-file-name name version))
14161 (sha256
14162 (base32
14163 "0w061fg65qrsm1a0lz0vyprsyidj31krjb459qi2lw0y78xza26s"))))
14164 (build-system ant-build-system)
14165 (arguments
14166 `(#:jar-name "args4j.jar"
14167 #:source-dir "args4j/src"
14168 #:test-dir "args4j/test"
14169 #:test-exclude
14170 (list "**/ExampleTest.*"
14171 "**/ExternalConfiguredTest.*" ; fails to find a file
14172 ;; We still don't want to run abstract classes
14173 "**/Abstract*.*")
14174 #:phases
14175 (modify-phases %standard-phases
14176 (add-before 'check 'fix-test-dir
14177 (lambda _
14178 (substitute* "build.xml"
14179 (("/java\">") "\">"))
14180 #t))
14181 (add-before 'build 'copy-resources
14182 (lambda _
14183 (let ((from-prefix "args4j/src/org/kohsuke/args4j/")
14184 (to-prefix "build/classes/org/kohsuke/args4j/"))
14185 (for-each (lambda (f)
14186 (install-file
14187 (string-append from-prefix f)
14188 (string-append to-prefix (dirname f))))
14189 (list "Messages.properties"
14190 "Messages_de.properties"
14191 "Messages_en.properties"
14192 "Messages_ru.properties"
14193 "spi/Messages.properties"
14194 "spi/Messages_de.properties"
14195 "spi/Messages_en.properties"
14196 "spi/Messages_ru.properties")))
14197 #t)))))
14198 (native-inputs
14199 (list java-junit))
14200 (home-page "https://args4j.kohsuke.org/")
14201 (synopsis "Command line parser library")
14202 (description "Args4j is a small Java class library that makes it easy to
14203parse command line options/arguments in your CUI application.")
14204 (license license:expat)))
14205
14206(define-public java-argparse4j
14207 (package
14208 (name "java-argparse4j")
14209 (version "0.9.0")
14210 (source (origin
14211 (method git-fetch)
14212 (uri (git-reference
14213 (url "https://github.com/argparse4j/argparse4j")
14214 (commit (string-append "argparse4j-" version))))
14215 (file-name (git-file-name name version))
14216 (sha256
14217 (base32
14218 "1i0j3zs1ln48n0g8a90vqbv6528mcswhzys6252yp0c8w1ai64fb"))))
14219 (build-system ant-build-system)
14220 (arguments
14221 (list #:jar-name "java-argparse4j.jar"
14222 #:source-dir "main/src/main/"
14223 #:test-dir "main/src/test/"
14224 #:jdk openjdk11
14225 #:phases #~(modify-phases %standard-phases
14226 (add-after 'unpack 'copy-resources
14227 (lambda _
14228 (copy-recursively "main/src/test/resources"
14229 "target/test-classes")
14230 (copy-recursively "main/src/main/resources"
14231 "build/classes")))
14232 (replace 'install
14233 (install-from-pom "pom.xml")))))
14234 (inputs (list java-junit))
14235 (home-page "https://argparse4j.github.io/")
14236 (synopsis "Java command-line argument parser library")
14237 (description "Argparse4j is a command line argument parser library for
14238Java based on Python's @code{argparse} module.")
14239 (license license:expat)))
14240
14241(define-public java-metadata-extractor
14242 (package
14243 (name "java-metadata-extractor")
14244 (version "2.19.0")
14245 (source (origin
14246 (method git-fetch)
14247 (uri (git-reference
14248 (url "https://github.com/drewnoakes/metadata-extractor")
14249 (commit version)))
14250 (file-name (git-file-name name version))
14251 (sha256
14252 (base32
14253 "1axnw47n06a116g8bml2l6rxx92grxp935gspyhz4pz868m7hrna"))))
14254 (build-system ant-build-system)
14255 (arguments
14256 `(#:jar-name "metadata-extractor.jar"
14257 #:source-dir "Source"
14258 #:test-dir "Tests"
14259 #:phases
14260 (modify-phases %standard-phases
14261 (add-before 'build 'fix-xmp-path
14262 (lambda _
14263 ;; This version of metadata-extractor depends on java-xmp 6, which
14264 ;; is non-free. These changes allow using java-xmp 5, which is
14265 ;; the last free-software version of java-xmp.
14266 (substitute* (find-files "." ".*.java")
14267 (("com.adobe.internal.xmp") "com.adobe.xmp"))
14268 (substitute* "Source/com/drew/metadata/xmp/XmpReader.java"
14269 (("\\.setXMPNodesToLimit.*") ";"))
14270 ;; Test failure, most likely because we use a different java-xmp
14271 ;; version.
14272 (delete-file "Tests/com/drew/metadata/xmp/XmpReaderTest.java")))
14273 (add-before 'check 'fix-test-dir
14274 (lambda _
14275 (substitute* "build.xml"
14276 (("/java\">") "\">"))
14277 #t)))))
14278 (propagated-inputs
14279 (list java-xmp))
14280 (native-inputs
14281 (list java-hamcrest-core java-junit))
14282 (home-page "https://github.com/drewnoakes/metadata-extractor")
14283 (synopsis "Extract metadata from image and video files")
14284 (description "Metadata-extractor is a straightforward Java library for
14285reading metadata from image files. It is able to read metadata in Exif,
14286IPTC, XMP, ICC and more formats.")
14287 (license license:asl2.0)))
14288
14289(define-public java-svg-salamander
14290 (package
14291 (name "java-svg-salamander")
14292 (version "1.1.2")
14293 (source (origin
14294 (method git-fetch)
14295 (uri (git-reference
14296 (url "https://github.com/blackears/svgSalamander")
14297 (commit (string-append "v" version))))
14298 (file-name (git-file-name name version))
14299 (sha256
14300 (base32
14301 "1zv3kjdkf6iqf02x6ln76254y634j2ji448y706a65lsbfjmmicf"))
14302 (modules '((guix build utils)))
14303 (snippet
14304 '(begin
14305 (for-each delete-file (find-files "." ".*.jar"))
14306 #t))
14307 (patches
14308 (search-patches "java-svg-salamander-Fix-non-det.patch"))))
14309 (build-system ant-build-system)
14310 (arguments
14311 `(#:tests? #f; no tests
14312 #:phases
14313 (modify-phases %standard-phases
14314 (add-after 'unpack 'chdir
14315 (lambda _
14316 (chdir "svg-core")
14317 #t))
14318 (add-before 'build 'copy-jars
14319 (lambda* (#:key inputs #:allow-other-keys)
14320 (copy-file (car (find-files (assoc-ref inputs "javacc") "\\.jar$"))
14321 "../libraries/javacc.jar")
14322 (copy-file (car (find-files (assoc-ref inputs "ant") "ant\\.jar$"))
14323 "../libraries/ant.jar")
14324 #t))
14325 (replace 'install
14326 (install-jars "dist")))))
14327 (native-inputs
14328 (list javacc))
14329 (home-page "https://github.com/blackears/svgSalamander")
14330 (synopsis "SVG engine for Java")
14331 (description "SVG Salamander is an SVG engine for Java that's designed
14332to be small, fast, and allow programmers to use it with a minimum of fuss.
14333It's in particular targeted for making it easy to integrate SVG into Java
14334games and making it much easier for artists to design 2D game content - from
14335rich interactive menus to charts and graphcs to complex animations.")
14336 (license license:bsd-2)))
14337
14338(define-public java-jboss-transaction-api-spec
14339 (package
14340 (name "java-jboss-transaction-api-spec")
14341 (version "1.2+1.1.1")
14342 (source (origin
14343 (method git-fetch)
14344 (uri (git-reference
14345 (url "https://github.com/jboss/jboss-transaction-api_spec")
14346 (commit "jboss-transaction-api_1.2_spec-1.1.1.Final")))
14347 (file-name (git-file-name name version))
14348 (sha256
14349 (base32
14350 "1xbfq5hvb86izflydxrqqv3k26c1ba2m0ap6m97shqrsdi9by4wy"))))
14351 (build-system ant-build-system)
14352 (arguments
14353 `(#:jar-name "java-jboss-transaction-api_spec.jar"
14354 #:source-dir "src/main/java"
14355 #:tests? #f)); no tests
14356 (inputs
14357 (list java-cdi-api java-jboss-interceptors-api-spec))
14358 (home-page "https://github.com/jboss/jboss-transaction-api_spec")
14359 (synopsis "Generic transaction management API in Java")
14360 (description "Java-jboss-transaction-api-spec implements the Transactions
14361API. A transaction is a unit of work containing one or more operations
14362involving one or more shared resources having ACID (Atomicity, Consistency,
14363Isolation and Durability) properties.")
14364 ;; either gpl2 only with classpath exception or cddl.
14365 (license (list license:gpl2 license:cddl1.0))))
14366
14367(define-public java-picocli
14368 (package
14369 (name "java-picocli")
14370 (version "4.3.2")
14371 (source (origin
14372 (method git-fetch)
14373 (uri (git-reference
14374 (url "https://github.com/remkop/picocli")
14375 (commit (string-append "v" version))))
14376 (file-name (git-file-name name version))
14377 (sha256
14378 (base32
14379 "1sxp6rxjfgjd98ly14b3d15dvxkm5wg4g46w12jyhmr0kmkaca3c"))))
14380 (build-system ant-build-system)
14381 (arguments
14382 `(#:jar-name "picocli.jar"
14383 #:source-dir "src/main/java"
14384 ;; Tests require missing dependencies (junitparams, system-rules)
14385 #:tests? #f))
14386 (home-page "https://picocli.info")
14387 (synopsis "REPL for the JVM")
14388 (description "Picocli is a framework for building command line applications
14389for the JVM. It supports colors, autocompletion, subcommands, and more. Written
14390in Java, usable from Groovy, Kotlin, Scala, etc.")
14391 (license license:asl2.0)))
14392
14393(define-public java-pj
14394 (package
14395 (name "java-pj")
14396 (version "20150107")
14397 (source (origin
14398 (method url-fetch)
14399 (uri (string-append "https://www.cs.rit.edu/~ark/pjsrc"
14400 version ".jar"))
14401 (sha256
14402 (base32
14403 "078xwaivl2qqjc07r0vk6kzpqlcb1bcar80p8r5qigh34hpr86d3"))
14404 (modules '((guix build utils)))
14405 (snippet
14406 '(for-each delete-file
14407 (find-files "." "\\.class$")))))
14408 (build-system ant-build-system)
14409 (arguments
14410 (list
14411 #:tests? #false ;there are none
14412 #:phases
14413 #~(modify-phases %standard-phases
14414 (add-after 'unpack 'chdir
14415 (lambda _ (chdir "src/pj")))
14416 (add-after 'chdir 'patch-source-directory
14417 (lambda _
14418 (substitute* "compile"
14419 (("SRCDIR1=/home/ark/public_html/pj/lib")
14420 (string-append "SRCDIR1=" (getcwd) "/lib")))))
14421 (replace 'build
14422 (lambda _
14423 (invoke "bash" "./compile" "linux")
14424 (with-directory-excursion "lib"
14425 (apply invoke "jar" "cf" (string-append "pj" #$version ".jar")
14426 (find-files "." "\\.class$")))))
14427 (replace 'install (install-jars ".")))))
14428 (home-page "https://www.cs.rit.edu/~ark/pj.shtml")
14429 (synopsis "Parallel programming in Java")
14430 (description "Parallel Java (PJ) is an API and middleware for parallel
14431programming in 100% Java on shared memory multiprocessor (SMP) parallel
14432computers, cluster parallel computers, and hybrid SMP cluster parallel
14433computers.")
14434 (license license:gpl3+)))
14435
14436(define-public java-jetbrains-annotations
14437 (package
14438 (name "java-jetbrains-annotations")
14439 (version "19.0.0")
14440 (source (origin
14441 (method git-fetch)
14442 (uri (git-reference
14443 (url "https://github.com/JetBrains/java-annotations")
14444 (commit version)))
14445 (file-name (git-file-name name version))
14446 (sha256
14447 (base32
14448 "0z6i1xs60cd5ffz23c49sq68wn5mphhs3xpar1n93ppama2ng80v"))))
14449 (build-system ant-build-system)
14450 (arguments
14451 `(#:jar-name "jetbrains-annotations.jar"
14452 #:source-dir "common/src/main/java:java8/src/main/java"
14453 #:tests? #f)); no tests
14454 (home-page "https://github.com/JetBrains/java-annotations")
14455 (synopsis "Annotations for Java and other JVM languages")
14456 (description "This package contains a set of Java annotations which can be
14457used in JVM-based languages. They serve as an additional documentation and
14458can be interpreted by IDEs and static analysis tools to improve code analysis.")
14459 (license license:expat)))
14460
14461(define-public java-javaparser
14462 (package
14463 (name "java-javaparser")
14464 (version "3.16.1")
14465 (source (origin
14466 (method git-fetch)
14467 (uri (git-reference
14468 (url "https://github.com/javaparser/javaparser")
14469 (commit (string-append "javaparser-parent-" version))))
14470 (file-name (git-file-name name version))
14471 (sha256
14472 (base32
14473 "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
14474 (modules '((guix build utils)))
14475 (snippet
14476 '(begin
14477 (for-each delete-file
14478 (find-files "." "\\.jar$"))
14479 #t))))
14480 (build-system ant-build-system)
14481 (arguments
14482 `(#:tests? #f; tests require jbehave and junit5
14483 #:phases
14484 (modify-phases %standard-phases
14485 (add-before 'build 'fill-template
14486 (lambda _
14487 (with-directory-excursion "javaparser-core/src/main"
14488 (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
14489 "java/com/github/javaparser/JavaParserBuild.java")
14490 (substitute* "java/com/github/javaparser/JavaParserBuild.java"
14491 (("\\$\\{project.version\\}") ,version)
14492 (("\\$\\{project.name\\}") "javaparser")
14493 (("\\$\\{project.build.finalName\\}") "javaparser")
14494 (("\\$\\{maven.version\\}") "fake")
14495 (("\\$\\{maven.build.version\\}") "fake")
14496 (("\\$\\{build.timestamp\\}") "0")
14497 (("\\$\\{java.vendor\\}") "Guix")
14498 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
14499 (("\\$\\{java.version\\}") "1.8")
14500 (("\\$\\{os.arch\\}") "any")
14501 (("\\$\\{os.name\\}") "Guix")
14502 (("\\$\\{os.version\\}") "not available")))
14503 #t))
14504 (add-before 'build 'generate-javacc
14505 (lambda _
14506 (with-directory-excursion "javaparser-core/src/main/java"
14507 (invoke "java" "javacc" "../javacc/java.jj"))
14508 #t))
14509 (add-before 'build 'copy-javacc-support
14510 (lambda _
14511 (with-directory-excursion "javaparser-core/src/main"
14512 (copy-recursively "javacc-support" "java"))
14513 #t))
14514 (replace 'build
14515 (lambda _
14516 (define (build name)
14517 (format #t "Building ~a~%" name)
14518 (delete-file-recursively "build/classes")
14519 (mkdir-p "build/classes")
14520 (apply invoke "javac"
14521 "-cp" (string-append (getenv "CLASSPATH") ":"
14522 (string-join (find-files "build/jar" ".")
14523 ":"))
14524 "-d" "build/classes"
14525 (find-files (string-append name "/src/main/java")
14526 ".*.java"))
14527 (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
14528 "-C" "build/classes" "."))
14529 (mkdir-p "build/classes")
14530 (mkdir-p "build/test-classes")
14531 (mkdir-p "build/jar")
14532 (build "javaparser-core")
14533 (build "javaparser-core-serialization")
14534 (build "javaparser-core-generators")
14535 (build "javaparser-core-metamodel-generator")
14536 (build "javaparser-symbol-solver-core")
14537 #t))
14538 (replace 'install
14539 (install-jars "build/jar")))))
14540 (inputs
14541 (list java-guava java-jboss-javassist java-jsonp-api))
14542 (native-inputs
14543 (list javacc))
14544 (home-page "https://javaparser.org/")
14545 (synopsis "Parser for Java")
14546 (description
14547 "This project contains a set of libraries implementing a Java 1.0 - Java
1454811 Parser with advanced analysis functionalities.")
14549 (license (list
14550 ;; either lgpl or asl
14551 license:lgpl3+
14552 license:asl2.0))))
14553
14554(define-public tla2tools
14555 ;; This package was originally based on the "v1.8.0" tag, but that merely
14556 ;; points to the moving master branch. That might be because the ‘latest
14557 ;; release’ at GitHub is currently 1.7.1. We'll see! For now, rather than
14558 ;; downgrade to 1.7.1 proper, use the commit that we originally dubbed 1.8.0.
14559 (let* ((release "1.7.1")
14560 (revision "0")
14561 (commit "6932e19083fc6df42473464857fc1280cb5aaecc"))
14562 (package
14563 (name "tla2tools")
14564 (version (git-version release revision commit))
14565 (source (origin
14566 (method git-fetch)
14567 (uri (git-reference
14568 (url "https://github.com/tlaplus/tlaplus")
14569 (commit commit)))
14570 (file-name (git-file-name name version))
14571 (sha256
14572 (base32
14573 "1hhx8gmn81k8qrkx4p7ppinmygxga9fqffd626wkvhjgg2ky8lhs"))
14574 (patches
14575 (search-patches "tla2tools-build-xml.patch"))
14576 (modules '((guix build utils)))
14577 (snippet
14578 '(begin
14579 ;; Remove packaged libraries (see 'replace-libs below)
14580 (for-each delete-file (find-files "." ".*.jar$"))))))
14581 (build-system ant-build-system)
14582 (arguments
14583 (let* ((tlatools "tlatools/org.lamport.tlatools/")
14584 (build-xml (string-append tlatools "customBuild.xml")))
14585 `(#:jdk ,openjdk11
14586 #:modules ((guix build ant-build-system)
14587 (guix build utils)
14588 (ice-9 match)
14589 (srfi srfi-26))
14590 #:make-flags '("-f" ,build-xml)
14591 #:phases
14592 (modify-phases %standard-phases
14593 ;; Replace packed libs with references to jars in store
14594 (add-after 'unpack 'replace-libs
14595 (lambda* (#:key inputs #:allow-other-keys)
14596 (define (input-jar input)
14597 (car (find-files (assoc-ref inputs input) "\\.jar$")))
14598 (for-each
14599 (match-lambda
14600 ((file . input)
14601 (symlink (input-jar input)
14602 (string-append ,tlatools "/lib/" file))))
14603 '(("gson/gson-2.8.6.jar" . "java-gson")
14604 ("javax.mail/mailapi-1.6.3.jar" . "java-javax-mail")
14605 ("jline/jline-terminal-3.14.1.jar" . "java-jline-terminal")
14606 ("jline/jline-reader-3.14.1.jar" . "java-jline-reader")
14607 ("lsp/org.eclipse.lsp4j.debug-0.10.0.jar" .
14608 "java-eclipse-lsp4j-debug")
14609 ("lsp/org.eclipse.lsp4j.jsonrpc-0.10.0.jar" .
14610 "java-eclipse-lsp4j-jsonrpc")
14611 ("lsp/org.eclipse.lsp4j.jsonrpc.debug-0.10.0.jar" .
14612 "java-eclipse-lsp4j-jsonrpc-debug")
14613 ("junit-4.12.jar" . "java-junit")
14614 ("easymock-3.3.1.jar" . "java-easymock")))
14615 ;; Retain a tiny subset of the original X-Git-*
14616 ;; manifest values just to aid in debugging.
14617 (substitute* ,build-xml
14618 (("\\$\\{git.tag\\}") (string-append "v" ,release)))))
14619 (add-before 'check 'prepare-tests
14620 (lambda _
14621 ;; The pcal tests write to .cfg files.
14622 (for-each (cut chmod <> #o644)
14623 (find-files (string-append ,tlatools
14624 "/test-model/pcal")
14625 "\\.cfg$"))))
14626 (replace 'install
14627 (lambda* (#:key inputs outputs #:allow-other-keys)
14628 (let* ((share (string-append (assoc-ref outputs "out") "/share/java"))
14629 (jar-name "tla2tools.jar"); set in project.properties
14630 (jar (string-append ,tlatools
14631 "/dist/" jar-name))
14632 (java-cp (string-append share "/" jar-name))
14633 (bin (string-append (assoc-ref outputs "out") "/bin"))
14634 (java (search-input-file inputs "/bin/java")))
14635 (install-file jar share)
14636 (mkdir-p bin)
14637 ;; Generate wrapper scripts for bin/, which invoke common
14638 ;; commands within tla2tools.jar. Users can still invoke
14639 ;; tla2tools.jar for the rest.
14640 (for-each
14641 (match-lambda
14642 ((wrapper . class)
14643 (let ((file (string-append bin "/" wrapper)))
14644 (begin
14645 (with-output-to-file file
14646 (lambda _
14647 (display
14648 (string-append
14649 "#!/bin/sh\n"
14650 java " -XX:+UseParallelGC " " -cp " java-cp " " class " \"$@\""))))
14651 (chmod file #o755)))))
14652 ;; bin/wrapper . java-class
14653 '(("pcal" . "pcal.trans")
14654 ("tlatex" . "tla2tex.TLA")
14655 ("tla2sany" . "tla2sany.SANY")
14656 ("tlc2" . "tlc2.TLC")
14657 ("tlc2-repl" . "tlc2.REPL"))))))))))
14658 (native-inputs
14659 (list java-junit java-easymock))
14660 (inputs
14661 (list java-javax-mail
14662 java-gson-2.8.6
14663 java-jline-terminal
14664 java-jline-reader
14665 java-eclipse-lsp4j-jsonrpc
14666 java-eclipse-lsp4j-jsonrpc-debug
14667 java-eclipse-lsp4j-debug))
14668 (home-page "https://lamport.azurewebsites.net/tla/tools.html")
14669 (synopsis "TLA+ tools (analyzer, TLC, TLATeX, PlusCal translator)")
14670 (description "TLA+ is a high-level language for modeling programs and
14671systems---especially concurrent and distributed ones. It's based on the idea
14672that the best way to describe things precisely is with simple
14673mathematics. TLA+ and its tools are useful for eliminating fundamental design
14674errors, which are hard to find and expensive to correct in code.
14675
14676The following TLA+ tools are available in this distribution:
14677
14678@itemize
14679@item The Syntactic Analyzer: A parser and syntax checker for
14680 TLA+ specifications;
14681@item TLC: A model checker and simulator for a subclass of \"executable\" TLA+
14682 specifications;
14683@item TLATeX: A program for typesetting TLA+ specifications;
14684@item Beta test versions of 1-3 for the TLA+2 language; and
14685@item The PlusCal translator.
14686@end itemize")
14687 (license license:expat))))
14688
14689;;;
14690;;; Avoid adding new packages to the end of this file. To reduce the chances
14691;;; of a merge conflict, place them above by existing packages with similar
14692;;; functionality or similar names.
14693;;;