java.scm
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
3 | ;;; |
4 | ;;; This file is part of GNU Guix. |
5 | ;;; |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
7 | ;;; under the terms of the GNU General Public License as published by |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
9 | ;;; your option) any later version. |
10 | ;;; |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | ;;; GNU General Public License for more details. |
15 | ;;; |
16 | ;;; You should have received a copy of the GNU General Public License |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
18 | |
19 | (define-module (more packages java) |
20 | #:use-module ((guix licenses) #:prefix license:) |
21 | #:use-module (gnu packages) |
22 | #:use-module (guix packages) |
23 | #:use-module (guix download) |
24 | #:use-module (guix git-download) |
25 | #:use-module (guix svn-download) |
26 | #:use-module (guix utils) |
27 | #:use-module (guix build-system ant) |
28 | #:use-module (guix build-system gnu) |
29 | #:use-module (guix build-system trivial) |
30 | #:use-module (gnu packages autotools) |
31 | #:use-module (gnu packages base) |
32 | #:use-module (gnu packages zip) |
33 | #:use-module (gnu packages java)) |
34 | |
35 | (define-public josm |
36 | (package |
37 | (name "josm") |
38 | (version "12039") |
39 | (source (origin |
40 | (method svn-fetch) |
41 | ;;(uri (git-reference |
42 | ;; (url "https://github.com/openstreetmap/josm.git") |
43 | ;; (commit version))) |
44 | (uri (svn-reference |
45 | (url "https://svn.openstreetmap.org/applications/editors/josm") |
46 | (revision 12039))) |
47 | (sha256 |
48 | (base32 |
49 | ;;"17ih97kf6g6ly8gz6dbc3jzh22gamra4anbwcsxivhq7dw5z3a6n")) |
50 | "1sq35askhvg85ghj7q34adxny7dwacz7xx6sbc1l5g0khcck7vql")) |
51 | (file-name (string-append name "-" version)))) |
52 | (build-system ant-build-system) |
53 | (arguments |
54 | `(#:build-target "dist" |
55 | #:tests? #f |
56 | #:jdk ,icedtea-8 |
57 | #:phases |
58 | (modify-phases %standard-phases |
59 | (add-before 'build 'fix-compiler |
60 | (lambda* _ |
61 | (with-output-to-file "REVISION.XML" |
62 | (lambda _ |
63 | (display |
64 | (string-append "<info><entry><commit revision=\"" ,version "\">" |
65 | "<date>1970-01-01 00:00:00 +0000</date>" |
66 | "</commit></entry></info>")))) |
67 | (substitute* "build.xml" |
68 | (("UNKNOWN") ,version) |
69 | (("<touch.*epsg.output.*") "<mkdir dir=\"${epsg.output}/..\" /><touch file=\"${epsg.output}\"/>\n") |
70 | ((".*com.google.errorprone.ErrorProneAntCompilerAdapter.*") "") |
71 | (("compiler=\"[^\"]*\" ") "")))) |
72 | (replace 'install |
73 | (lambda* (#:key outputs inputs #:allow-other-keys) |
74 | (let* ((out (assoc-ref outputs "out")) |
75 | (bin (string-append out "/bin")) |
76 | (lib (string-append out "/lib/josm"))) |
77 | (mkdir-p bin) |
78 | (mkdir-p lib) |
79 | (copy-file "dist/josm-custom.jar" |
80 | (string-append lib "/josm.jar")) |
81 | (with-output-to-file (string-append bin "/josm") |
82 | (lambda _ |
83 | (display |
84 | (string-append "#!/bin/sh\n" |
85 | (assoc-ref inputs "jdk") "/bin/java" |
86 | " -jar " lib "/josm.jar")))) |
87 | (chmod (string-append bin "/josm") #o755))))))) |
88 | (home-page "https://josm.openstreetmap.de") |
89 | (synopsis "OSM editor") |
90 | (description "OSM editor.") |
91 | (license license:gpl2+))) |
92 | |
93 | (define-public java-icu4j |
94 | (package |
95 | (name "java-icu4j") |
96 | (version "58.2") |
97 | (source (origin |
98 | (method url-fetch) |
99 | (uri (string-append |
100 | "http://download.icu-project.org/files/icu4j/" version |
101 | "/icu4j-" |
102 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) |
103 | ".tgz")) |
104 | (sha256 |
105 | (base32 |
106 | "1mvqjlc3cbaraa0bv0vyl44xf0x6n81inqsh69bl7f88iycfpns9")))) |
107 | (build-system ant-build-system) |
108 | (arguments |
109 | `(#:tests? #f ; Requires java-ivy that we don't have yet. |
110 | #:phases |
111 | (modify-phases %standard-phases |
112 | ;; icu4j archive contains its sources directly at the top, not in |
113 | ;; a subdirectory as usual. |
114 | (add-after 'unpack 'chdir |
115 | (lambda _ |
116 | (chdir ".."))) |
117 | (replace 'install |
118 | (lambda* (#:key outputs #:allow-other-keys) |
119 | (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) |
120 | (mkdir-p share) |
121 | (copy-file "icu4j-charset.jar" (string-append share "/icu4j-charset.jar")) |
122 | (copy-file "icu4j.jar" (string-append share "/icu4j.jar")))))))) |
123 | (home-page "http://site.icu-project.org/") |
124 | (synopsis "") |
125 | (description "") |
126 | (license license:x11))) |
127 | |
128 | (define-public java-treelayout |
129 | (package |
130 | (name "java-treelayout") |
131 | (version "1.0.3") |
132 | (source (origin |
133 | (method url-fetch) |
134 | (uri (string-append |
135 | "https://github.com/abego/treelayout/archive/v" version |
136 | ".tar.gz")) |
137 | (file-name (string-append name "-" version ".tar.gz")) |
138 | (sha256 |
139 | (base32 |
140 | "0djdw7j66lqjx8bx9zja0hsx10c6nsj3z0z20jmavwfr6bpp0345")))) |
141 | (build-system ant-build-system) |
142 | (arguments |
143 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
144 | #:tests? #f |
145 | #:phases |
146 | (modify-phases %standard-phases |
147 | ;; icu4j archive contains its sources directly at the top, not in |
148 | ;; a subdirectory as usual. |
149 | (add-after 'unpack 'chdir |
150 | (lambda _ |
151 | (chdir "org.abego.treelayout")))))) |
152 | (inputs |
153 | `(("junit" ,java-junit))) |
154 | (home-page "http://treelayout.sourceforge.net") |
155 | (synopsis "") |
156 | (description "") |
157 | (license license:bsd-3))) |
158 | |
159 | ; propose update |
160 | (define-public java-commons-cli |
161 | (package |
162 | (name "java-commons-cli") |
163 | (version "1.4") |
164 | (source (origin |
165 | (method url-fetch) |
166 | (uri (string-append "http://mirrors.ircam.fr/pub/apache/commons/" |
167 | "cli/source/commons-cli-" version "-src.tar.gz")) |
168 | (file-name (string-append name "-" version ".tar.gz")) |
169 | (sha256 |
170 | (base32 |
171 | "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1")))) |
172 | (build-system ant-build-system) |
173 | (arguments |
174 | `(#:jar-name "commons-cli-1.4.jar" |
175 | #:tests? #f)) |
176 | (native-inputs |
177 | `(("junit" ,java-junit))) |
178 | (home-page "https://commons.apache.org/proper/commons-cli") |
179 | (synopsis "Java API for parsing command line options passed to programs") |
180 | (description "Apache Commons CLI library provides an API for parsing command |
181 | line options passed to programs. It's also able to print help messages detailing |
182 | the options available for a command line tool.") |
183 | (license license:asl2.0))) |
184 | |
185 | ; propose update |
186 | (define-public java-jsr305 |
187 | (package |
188 | (name "java-jsr305") |
189 | (version "3.0.2") |
190 | (source (origin |
191 | (method git-fetch) |
192 | (uri (git-reference |
193 | (url "https://github.com/amaembo/jsr-305.git") |
194 | (commit "d7734b13c61492982784560ed5b4f4bd6cf9bb2c"))) |
195 | (file-name (string-append name "-" version)) |
196 | (sha256 |
197 | (base32 |
198 | "1wk159136pgc6i54drbq2whazfmdilvfqlxj3k19s9dfwbayf621")))) |
199 | (build-system ant-build-system) |
200 | (arguments |
201 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
202 | #:source-dir "ri/src/main/java" |
203 | #:tests? #f)) |
204 | (home-page "https://github.com/amaembo/jsr-305") |
205 | (synopsis "") |
206 | (description "") |
207 | (license license:bsd-3))) |
208 | |
209 | (define-public java-checker-framework |
210 | (package |
211 | (name "java-checker-framework") |
212 | (version "2.1.10") |
213 | (source (origin |
214 | (method url-fetch) |
215 | (uri (string-append "https://github.com/typetools/checker-framework/" |
216 | "archive/checker-framework-" version ".tar.gz")) |
217 | (file-name (string-append name "-" version ".tar.gz")) |
218 | (sha256 |
219 | (base32 |
220 | "1infq1hr53zi9bd81v90rn3iripbinb3w145m3xblq8yvnfrxy20")))) |
221 | (build-system ant-build-system) |
222 | (arguments |
223 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
224 | #:source-dir "dataflow/src:javacutil/src" |
225 | #:jdk ,icedtea-8 |
226 | #:tests? #f)) |
227 | (home-page "https://checkerframework.org") |
228 | (synopsis "") |
229 | (description "") |
230 | (license license:gpl2))); with classpath exception |
231 | |
232 | (define-public java-javapoet |
233 | (package |
234 | (name "java-javapoet") |
235 | (version "1.8.0") |
236 | (source (origin |
237 | (method url-fetch) |
238 | (uri (string-append "https://github.com/square/javapoet/archive/javapoet-" |
239 | version ".tar.gz")) |
240 | (file-name (string-append name "-" version ".tar.gz")) |
241 | (sha256 |
242 | (base32 |
243 | "0xpjbh8wcyj9yd9hb936ia5g6l2q1jlyqjvwcc290cwjrz7crb93")))) |
244 | (build-system ant-build-system) |
245 | (arguments |
246 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
247 | #:source-dir "src/main/java" |
248 | #:jdk ,icedtea-8 |
249 | #:tests? #f)) |
250 | (home-page "https://github.com/square/javapoet") |
251 | (synopsis "") |
252 | (description "") |
253 | (license license:asl2.0))) |
254 | |
255 | (define-public java-auto-value |
256 | (package |
257 | (name "java-auto-value") |
258 | (version "1.4.1") |
259 | (source (origin |
260 | (method url-fetch) |
261 | (uri (string-append "https://github.com/google/auto/archive/auto-value-" |
262 | version ".tar.gz")) |
263 | (file-name (string-append name "-" version ".tar.gz")) |
264 | (sha256 |
265 | (base32 |
266 | "1qd59bwa56bynsdxfbgm40i7ndrj599wflza214kzigk16nprc1m")))) |
267 | (build-system ant-build-system) |
268 | (arguments |
269 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
270 | #:source-dir "value/src/main/java:common/src/main/java:service/src/main/java" |
271 | #:jdk ,icedtea-8 |
272 | #:tests? #f)) |
273 | (inputs |
274 | `(("guava" ,java-guava) |
275 | ("javapoet" ,java-javapoet))) |
276 | (home-page "https://github.com/google/auto/tree/master/value") |
277 | (synopsis "") |
278 | (description "") |
279 | (license license:asl2.0))) |
280 | |
281 | (define-public java-diff-utils |
282 | (package |
283 | (name "java-diff-utils") |
284 | (version "1.5.0") |
285 | (source (origin |
286 | (method url-fetch) |
287 | (uri (string-append "https://github.com/KengoTODA/java-diff-utils/archive/" |
288 | "diffutils-" version ".tar.gz")) |
289 | (file-name (string-append name "-" version ".tar.gz")) |
290 | (sha256 |
291 | (base32 |
292 | "107bkk542cgpk8sqgc41j0ljarb6zs9p59m3phvvv9rln6rwnmjc")))) |
293 | (arguments |
294 | `(#:build-target "all" |
295 | #:tests? #f; I don't know how to run src/test |
296 | #:phases |
297 | (modify-phases %standard-phases |
298 | (add-before 'configure 'fix-build.xml |
299 | (lambda _ |
300 | (substitute* "build.xml" |
301 | (("1.5") "1.7") |
302 | (("1.3.0-SNAPSHOT") ,version)))) |
303 | (replace 'install |
304 | (lambda* (#:key outputs #:allow-other-keys) |
305 | (mkdir-p (string-append (assoc-ref outputs "out") "/share/java")) |
306 | (with-directory-excursion "dist" |
307 | (for-each (lambda (file) |
308 | (copy-file file |
309 | (string-append (assoc-ref outputs "out") |
310 | "/share/java/" file))) |
311 | (find-files "." ".*.jar")))))))) |
312 | (propagated-inputs |
313 | `(("guava" ,java-guava) |
314 | ("java-jsr305" ,java-jsr305))) |
315 | (native-inputs |
316 | `(("junit" ,java-junit))) |
317 | (build-system ant-build-system) |
318 | (home-page "https://github.com/KengoTODA/java-diff-utils") |
319 | (synopsis "") |
320 | (description "") |
321 | (license license:asl2.0))) |
322 | |
323 | |
324 | ;; com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE |
325 | ;; com.sun.source.tree.PackageTree |
326 | ;; com.sun.tools.javac.tree.JCTree.JCPackageDecl |
327 | |
328 | ;; TODO: error-prone depends on java9 at least from version 2.0.13 which is the |
329 | ;; earliest version that guava can use. |
330 | ;; Fortunately, java7 can be used for -annotations. |
331 | (define-public java-error-prone |
332 | (package |
333 | (name "java-error-prone") |
334 | (version "2.0.19") |
335 | (source (origin |
336 | (method url-fetch) |
337 | (uri (string-append "https://github.com/google/error-prone/archive/v" |
338 | version ".tar.gz")) |
339 | (file-name (string-append name "-" version ".tar.gz")) |
340 | (sha256 |
341 | (base32 |
342 | "00igy7a6aylswxdcklj9021g2s8bvsvrysagqyd8cibm4pimxrnk")))) |
343 | (build-system ant-build-system) |
344 | (arguments |
345 | `(#:tests? #f |
346 | #:jar-name "error-prone.jar" |
347 | #:source-dir "check_api/src/main/java" |
348 | #:phases |
349 | (modify-phases %standard-phases |
350 | (add-before 'build 'copy-internal |
351 | (lambda _ |
352 | (mkdir-p "ant/src/main/java/com/google/errorprone/internal") |
353 | (copy-file |
354 | "core/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java" |
355 | "ant/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java")))))) |
356 | (propagated-inputs '()) |
357 | (home-page "https://github.com/google/guava") |
358 | (synopsis "") |
359 | (description "") |
360 | (license license:asl2.0))) |
361 | |
362 | ;(define-public java-error-prone-check-api |
363 | ; (package |
364 | ; (inherit java-error-prone) |
365 | ; (name "java-error-prone-check-api") |
366 | ; (version (package-version java-error-prone)) |
367 | ; (arguments |
368 | ; `(#:tests? #f |
369 | ; #:jdk ,icedtea-8 |
370 | ; #:jar-name (string-append ,name "-" ,version ".jar") |
371 | ; #:source-dir "check_api/src/main/java")) |
372 | ; (propagated-inputs |
373 | ; `(("java-error-prone-annotations" ,java-error-prone-annotations) |
374 | ; ("java-error-prone-annotation" ,java-error-prone-annotation) |
375 | ; ("java-jsr305" ,java-jsr305) |
376 | ; ("java-diff-utils" ,java-diff-utils) |
377 | ; ("java-auto-value" ,java-auto-value) |
378 | ; ("java-checker-framework" ,java-checker-framework) |
379 | ; ("java-guava" ,java-guava))))) |
380 | |
381 | ;(define-public java-error-prone-core |
382 | ; (package |
383 | ; (inherit java-error-prone) |
384 | ; (name "java-error-prone-core") |
385 | ; (version (package-version java-error-prone)) |
386 | ; (arguments |
387 | ; `(#:tests? #f |
388 | ; #:jdk ,icedtea-8 |
389 | ; #:jar-name (string-append ,name "-" ,version ".jar") |
390 | ; #:source-dir "core/src/main/java")) |
391 | ; (propagated-inputs |
392 | ; `(("java-error-prone-annotations" ,java-error-prone-annotations) |
393 | ; ("java-error-prone-annotation" ,java-error-prone-annotation) |
394 | ; ("java-jsr305" ,java-jsr305) |
395 | ; ("java-auto-value" ,java-auto-value) |
396 | ; ("java-checker-framework" ,java-checker-framework) |
397 | ; ("java-guava" ,java-guava))))) |
398 | |
399 | (define-public java-error-prone-annotation |
400 | (package |
401 | (inherit java-error-prone) |
402 | (name "java-error-prone-annotation") |
403 | (version (package-version java-error-prone)) |
404 | (arguments |
405 | `(#:tests? #f |
406 | #:jar-name (string-append ,name "-" ,version ".jar") |
407 | #:source-dir "annotation/src/main/java")) |
408 | (propagated-inputs |
409 | `(("java-jsr305" ,java-jsr305) |
410 | ("java-guava" ,java-guava))))) |
411 | |
412 | (define-public java-error-prone-annotations |
413 | (package |
414 | (inherit java-error-prone) |
415 | (name "java-error-prone-annotations") |
416 | (version (package-version java-error-prone)) |
417 | (arguments |
418 | `(#:tests? #f |
419 | #:jar-name (string-append ,name "-" ,version ".jar") |
420 | #:source-dir "annotations/src/main/java")) |
421 | (propagated-inputs |
422 | `(("java-jsr305" ,java-jsr305))))) |
423 | |
424 | ;; Java-j2objc is for OS X, but the annotations sub-project is used by other |
425 | ;; packages here, such as guava. |
426 | (define-public java-j2objc-annotations |
427 | (package |
428 | (name "java-j2objc-annotations") |
429 | (version "1.3.1") |
430 | (source (origin |
431 | (method url-fetch) |
432 | (uri (string-append "https://github.com/google/j2objc/archive/" |
433 | version ".tar.gz")) |
434 | (file-name (string-append name "-" version ".tar.gz")) |
435 | (sha256 |
436 | (base32 |
437 | "0d5spbr1whw2afg6mknyr7ifm6xivn3bbvnzjxva2zzkyq944hv0")))) |
438 | (build-system ant-build-system) |
439 | (arguments |
440 | `(#:tests? #f |
441 | #:jar-name (string-append ,name "-" ,version ".jar") |
442 | #:source-dir "annotations/src/main/java")) |
443 | (synopsis "") |
444 | (description "") |
445 | (home-page "https://github.com/google/j2objc") |
446 | (license license:asl2.0))) |
447 | |
448 | ;; TODO: animal-sniffer-enforcer-rule and animal-sniffer-maven-plugin depend |
449 | ;; on maven. |
450 | (define-public java-animal-sniffer |
451 | (package |
452 | (name "java-animal-sniffer") |
453 | (version "1.15") |
454 | (source (origin |
455 | (method url-fetch) |
456 | (uri (string-append "https://github.com/mojohaus/animal-sniffer/" |
457 | "archive/animal-sniffer-parent-" |
458 | version ".tar.gz")) |
459 | (file-name (string-append name "-" version ".tar.gz")) |
460 | (sha256 |
461 | (base32 |
462 | "1350yl003y1fjzdwis0dg5jhi5kggk2sxnkv9821z5janw4p986m")))) |
463 | (build-system ant-build-system) |
464 | (propagated-inputs |
465 | `(("asm" ,java-asm))) |
466 | (arguments |
467 | `(#:tests? #f |
468 | #:jar-name (string-append ,name "-" ,version ".jar") |
469 | #:source-dir "animal-sniffer/src/main/java")) |
470 | (home-page "http://www.mojohaus.org/animal-sniffer") |
471 | (synopsis "") |
472 | (description "") |
473 | (license license:asl2.0))) |
474 | |
475 | (define-public java-animal-sniffer-annotations |
476 | (package |
477 | (inherit java-animal-sniffer) |
478 | (name "java-animal-sniffer-annotations") |
479 | (version (package-version java-animal-sniffer)) |
480 | (propagated-inputs '()) |
481 | (arguments |
482 | `(#:tests? #f |
483 | #:jar-name (string-append ,name "-" ,version ".jar") |
484 | #:source-dir "animal-sniffer-annotations/src/main/java")))) |
485 | |
486 | (define-public java-animal-sniffer-ant-tasks |
487 | (package |
488 | (inherit java-animal-sniffer) |
489 | (name "java-animal-sniffer-ant-tasks") |
490 | (version (package-version java-animal-sniffer)) |
491 | (propagated-inputs |
492 | `(("animal-sniffer" ,java-animal-sniffer))) |
493 | (arguments |
494 | `(#:tests? #f |
495 | #:jar-name (string-append ,name "-" ,version ".jar") |
496 | #:source-dir "animal-sniffer-ant-tasks/src/main/java")))) |
497 | |
498 | (define-public java-boot-classpath-detector |
499 | (package |
500 | (inherit java-animal-sniffer) |
501 | (name "java-boot-classpath-detector") |
502 | (version (package-version java-animal-sniffer)) |
503 | (propagated-inputs '()) |
504 | (arguments |
505 | `(#:tests? #f |
506 | #:jar-name (string-append ,name "-" ,version ".jar") |
507 | #:source-dir "java-boot-classpath-detector/src/main/java")))) |
508 | |
509 | (define-public java-guava |
510 | (package |
511 | (name "java-guava") |
512 | (version "20.0") |
513 | (source (origin |
514 | (method url-fetch) |
515 | (uri (string-append "https://github.com/google/guava/archive/v" |
516 | version ".tar.gz")) |
517 | (file-name (string-append name "-" version ".tar.gz")) |
518 | (sha256 |
519 | (base32 |
520 | "1kasavj973iblj1fj35gzbywhkljrnbjpymgqyqaibbbmmbzff8s")))) |
521 | (build-system ant-build-system) |
522 | (arguments |
523 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
524 | #:source-dir "guava/src" |
525 | #:tests? #f)) |
526 | (inputs |
527 | `(("java-jsr305" ,java-jsr305) |
528 | ("java-j2objc-annotations" ,java-j2objc-annotations) |
529 | ("java-animal-sniffer-annotations" ,java-animal-sniffer-annotations) |
530 | ("java-error-prone-annotations" ,java-error-prone-annotations))) |
531 | (home-page "https://github.com/google/guava") |
532 | (synopsis "") |
533 | (description "") |
534 | (license license:asl2.0))) |
535 | |
536 | (define-public java-joda-convert |
537 | (package |
538 | (name "java-joda-convert") |
539 | (version "1.8.1") |
540 | (source (origin |
541 | (method url-fetch) |
542 | (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v" |
543 | version ".tar.gz")) |
544 | (file-name (string-append name "-" version ".tar.gz")) |
545 | (sha256 |
546 | (base32 |
547 | "1di9chp0pgvd2gxsmdaxhldwns9a2ss9705jmn97mdd69cg5zcnc")))) |
548 | (build-system ant-build-system) |
549 | (arguments |
550 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
551 | #:source-dir "src/main/java" |
552 | #:tests? #f)) |
553 | (inputs |
554 | `(("java-google-collect" ,java-google-collect))) |
555 | (native-inputs |
556 | `(("junit" ,java-junit))) |
557 | (home-page "") |
558 | (synopsis "") |
559 | (description "") |
560 | (license license:asl2.0))) |
561 | |
562 | (define-public java-joda-time |
563 | (package |
564 | (name "java-joda-time") |
565 | (version "2.9.9") |
566 | (source (origin |
567 | (method url-fetch) |
568 | (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v" |
569 | version ".tar.gz")) |
570 | (file-name (string-append name "-" version ".tar.gz")) |
571 | (sha256 |
572 | (base32 |
573 | "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1")))) |
574 | (build-system ant-build-system) |
575 | (arguments |
576 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
577 | #:source-dir "src/main/java" |
578 | #:tests? #f)) |
579 | (inputs |
580 | `(("java-joda-convert" ,java-joda-convert))) |
581 | (native-inputs |
582 | `(("junit" ,java-junit))) |
583 | (home-page "") |
584 | (synopsis "") |
585 | (description "") |
586 | (license license:asl2.0))) |
587 | |
588 | (define-public java-xstream |
589 | (package |
590 | (name "java-xstream") |
591 | (version "1.4.9") |
592 | (source (origin |
593 | (method url-fetch) |
594 | (uri (string-append "https://repo1.maven.org/maven2/com/thoughtworks" |
595 | "/xstream/xstream-distribution/" version |
596 | "/xstream-distribution-" version "-src.zip")) |
597 | (file-name (string-append name "-" version ".zip")) |
598 | (sha256 |
599 | (base32 |
600 | "1cq9j9h839wc6pkrgd9bd7y94a3zrj1j741i134izqs9xx2b54fi")))) |
601 | (build-system ant-build-system) |
602 | (arguments |
603 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
604 | #:tests? #f |
605 | #:source-dir "xstream/src/java")) |
606 | (native-inputs |
607 | `(("unzip" ,unzip))) |
608 | (home-page "https://x-stream.github.io") |
609 | (synopsis "") |
610 | (description "") |
611 | (license license:x11))) |
612 | |
613 | ;; vanished from the face of the earth :/ |
614 | (define-public java-jsonp |
615 | (package |
616 | (name "java-jsonp") |
617 | (version "1.0.4") |
618 | (source (origin |
619 | (method git-fetch) |
620 | (uri (git-reference |
621 | (url "git://java.net/jsonp~git") |
622 | (commit "a586e706aea82dc80fb05bdf59f2a25150ee1801"))) |
623 | (file-name (string-append name "-" version)) |
624 | (sha256 |
625 | (base32 |
626 | "01r4syivcywpvxkr1hn0az9316pr7qpnx154zzzw0nijfmdlbw7n")))) |
627 | (build-system ant-build-system) |
628 | (arguments |
629 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
630 | #:tests? #f |
631 | #:source-dir "api/src")) |
632 | (home-page "https://jsonp.java.net") |
633 | (synopsis "") |
634 | (description "") |
635 | (license (list license:gpl2 |
636 | ;; actually CDDL 1.1 |
637 | license:cddl1.0)))) |
638 | |
639 | ;; Can only be built with gradle. |
640 | (define-public groovy |
641 | (package |
642 | (name "groovy") |
643 | (version "2.4.10") |
644 | (source (origin |
645 | (method url-fetch) |
646 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
647 | "2_4_10.tar.gz")) |
648 | (file-name (string-append name "-" version ".tar.gz")) |
649 | (sha256 |
650 | (base32 |
651 | "0wapzqwpx4bh2fsqpzf3haakjz6wvfjx1vd9a4spavhlrjqk2pbb")))) |
652 | (build-system ant-build-system) |
653 | (arguments |
654 | `(#:jar-name "groovy.jar" |
655 | #:tests? #f)) |
656 | (native-inputs |
657 | `(("junit" ,java-junit))) |
658 | (inputs |
659 | `(("commons-cli" ,java-commons-cli) |
660 | ("antlr" ,antlr3) |
661 | ("asm" ,java-asm))) |
662 | (home-page "") |
663 | (synopsis "") |
664 | (description "") |
665 | (license (list license:gpl2 |
666 | ;; actually CDDL 1.1 |
667 | license:cddl1.0)))) |
668 | |
669 | ;; requires jline, javax.servlet, org.fusesource.jansi, org.livetribe, |
670 | ;; com.thoughtworks.xstream, org.apache.ivy, bsf |
671 | ;; antlr |
672 | (define-public groovy-1.8.9 |
673 | (package |
674 | (inherit groovy) |
675 | (name "groovy") |
676 | (version "1.8.9") |
677 | (source (origin |
678 | (method url-fetch) |
679 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
680 | "1_8_9.tar.gz")) |
681 | (file-name (string-append name "-" version ".tar.gz")) |
682 | (sha256 |
683 | (base32 |
684 | "16z3jv5yw11wwwzbs6x41g83gqazhngg30ys2kpy7cpfm3rsqi71")))) |
685 | (arguments |
686 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
687 | #:tests? #f |
688 | #:source-dir "src/main")))) |
689 | |
690 | |
691 | (define-public antlr3-3.4 |
692 | (package |
693 | (name "antlr3") |
694 | (version "3.4") |
695 | (source (origin |
696 | (method url-fetch) |
697 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
698 | "gh-pages/download/antlr-" |
699 | version ".tar.gz")) |
700 | (sha256 |
701 | (base32 |
702 | "1cwfswpk3jlzl1dhc6b6586srza8q0bbzwlxcq136p29v62fjrb3")))) |
703 | (build-system ant-build-system) |
704 | (arguments |
705 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
706 | #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" |
707 | #:tests? #f |
708 | #:phases |
709 | (modify-phases %standard-phases |
710 | (add-after 'install 'bin-install |
711 | (lambda* (#:key inputs outputs #:allow-other-keys) |
712 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
713 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
714 | (mkdir-p bin) |
715 | (with-output-to-file (string-append bin "/antlr3") |
716 | (lambda _ |
717 | (display |
718 | (string-append "#!/bin/sh\n" |
719 | "java -cp " jar "/antlr3-3.3.jar:" |
720 | (string-concatenate |
721 | (find-files (assoc-ref inputs "stringtemplate") |
722 | ".*\\.jar")) |
723 | ":" |
724 | (string-concatenate |
725 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
726 | ".*\\.jar")) |
727 | " org.antlr.Tool $*")))) |
728 | (chmod (string-append bin "/antlr3") #o755)))) |
729 | (add-before 'build 'generate-grammar |
730 | (lambda _ |
731 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
732 | (for-each (lambda (file) |
733 | (display file) |
734 | (newline) |
735 | (system* "antlr3" file)) |
736 | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLR.g" |
737 | "ANTLRTreePrinter.g" "ANTLRv3.g" "ANTLRv3Tree.g" |
738 | "AssignTokenTypesWalker.g" "CodeGenTreeWalker.g" |
739 | "DefineGrammarItemsWalker.g" "LeftRecursiveRuleWalker.g" |
740 | "TreeToNFAConverter.g")) |
741 | (chdir "../../../../../../../..") |
742 | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" |
743 | "tool/src/main/java/org/antlr/tool/serialize.g") |
744 | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" |
745 | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; |
746 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
747 | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" |
748 | (("import org.antlr.grammar.v3.\\*;") |
749 | "import org.antlr.grammar.v3.*;\n |
750 | import org.antlr.grammar.v3.TreeToNFAConverter;\n |
751 | import org.antlr.grammar.v3.DefineGrammarItemsWalker;\n |
752 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
753 | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" |
754 | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) |
755 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" |
756 | (("public Object getTree") "public GrammarAST getTree")) |
757 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" |
758 | (("public Object getTree") "public CommonTree getTree")))) |
759 | (add-before 'build 'fix-build-xml |
760 | (lambda _ |
761 | (substitute* "build.xml" |
762 | (("<exec") "<copy todir=\"${classes.dir}\"> |
763 | <fileset dir=\"tool/src/main/resources\"> |
764 | <include name=\"**/*.stg\"/> |
765 | <include name=\"**/*.st\"/> |
766 | <include name=\"**/*.sti\"/> |
767 | <include name=\"**/STLexer.tokens\"/> |
768 | </fileset> |
769 | </copy><exec"))))))) |
770 | (native-inputs |
771 | `(("antlr" ,antlr2) |
772 | ("antlr3" ,antlr3-3.3))) |
773 | (inputs |
774 | `(("junit" ,java-junit))) |
775 | (propagated-inputs |
776 | `(("stringtemplate" ,stringtemplate3) |
777 | ("stringtemplate4" ,stringtemplate4) |
778 | ("antlr" ,antlr2) |
779 | ("antlr3" ,antlr3-3.1))) |
780 | (home-page "http://www.stringtemplate.org") |
781 | (synopsis "") |
782 | (description "") |
783 | (license license:bsd-3))) |
784 | |
785 | (define-public libantlr3c |
786 | (package |
787 | (inherit antlr3) |
788 | (name "libantlr3c") |
789 | (build-system gnu-build-system) |
790 | (native-inputs |
791 | `(("autoconf" ,autoconf) |
792 | ("automake" ,automake) |
793 | ("libtool" ,libtool))) |
794 | (propagated-inputs |
795 | `(("antlr" ,antlr3))) |
796 | (arguments |
797 | `(#:configure-flags (list "--enable-64bit" "--disable-static") |
798 | #:phases |
799 | (modify-phases %standard-phases |
800 | (add-before 'configure 'autoreconf |
801 | (lambda _ |
802 | (chdir "runtime/C") |
803 | (system* "libtoolize") |
804 | (system* "autoreconf" "-fiv")))))))) |
805 | |
806 | (define-public java-json |
807 | (package |
808 | (name "java-json") |
809 | (version "1.1.0-M2") |
810 | (source (origin |
811 | (method url-fetch) |
812 | (uri (string-append "https://repo1.maven.org/maven2/javax/json/" |
813 | "javax.json-api/" version "/javax.json-api-" |
814 | version "-sources.jar")) |
815 | (file-name (string-append name "-" version ".jar")) |
816 | (sha256 |
817 | (base32 |
818 | "0gam8w52xjbmfc1inviyajk36jnj3lg4bzwhw05iq52kadycy6v0")))) |
819 | (build-system ant-build-system) |
820 | (arguments |
821 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
822 | #:tests? #f |
823 | #:jdk ,icedtea-8 |
824 | #:source-dir "src" |
825 | #:phases |
826 | (modify-phases %standard-phases |
827 | (add-after 'unpack 'remove-module-info |
828 | (lambda _ |
829 | (format #t "~a\n" (getcwd)) |
830 | (delete-file "src/module-info.java")))))) |
831 | (home-page "") |
832 | (synopsis "") |
833 | (description "") |
834 | (license license:asl2.0))) |
835 | |
836 | ;; We still need one file to be generated with ST4. |
837 | ;; tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java |
838 | ;; See https://github.com/kevinbirch/string-template-maven-plugin |
839 | ;; We should take this and adapt to get a standalone tool. |
840 | (define-public java-antlr4 |
841 | (package |
842 | (name "java-antlr4") |
843 | (version "4.7") |
844 | (source (origin |
845 | (method url-fetch) |
846 | (uri (string-append "https://github.com/antlr/antlr4/archive/" |
847 | version ".tar.gz")) |
848 | (file-name (string-append name "-" version ".tar.gz")) |
849 | (sha256 |
850 | (base32 |
851 | "0y7lzkvx9wbbmwg45mb4icx7i66z6894qfygrbbs26sr5xxyml9h")))) |
852 | (build-system ant-build-system) |
853 | (arguments |
854 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
855 | #:source-dir "runtime/Java/src:tool/src" |
856 | #:jdk ,icedtea-8 |
857 | #:tests? #f |
858 | #:phases |
859 | (modify-phases %standard-phases |
860 | (add-before 'build 'generate-grammar |
861 | (lambda* (#:key inputs #:allow-other-keys) |
862 | (with-directory-excursion "tool/src/org/antlr/v4/parse" |
863 | (for-each (lambda (file) |
864 | (format #t "~a\n" file) |
865 | (system* "antlr3" file)) |
866 | '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g" |
867 | "GrammarTreeVisitor.g" "ATNBuilder.g" |
868 | "ActionSplitter.g" "LeftRecursiveRuleWalker.g"))) |
869 | (with-directory-excursion "tool/src/org/antlr/v4/codegen" |
870 | (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens") |
871 | (format #t "SourceGenTriggers.g\n") |
872 | (system* "antlr3" "SourceGenTriggers.g"))))))) |
873 | (inputs |
874 | `(("antlr3" ,antlr3) |
875 | ("icu4j" ,java-icu4j) |
876 | ("java-json" ,java-json) |
877 | ("treelayout" ,java-treelayout) |
878 | ("stringtemplate4" ,stringtemplate4))) |
879 | (home-page "https://antlr.org") |
880 | (synopsis "") |
881 | (description "") |
882 | (license license:bsd-3))) |
883 | |
884 | ;; requires groovy 2.4.7. |
885 | ;(define-public gradle |
886 | ; (package |
887 | ; (name "gradle") |
888 | ; (version "3.4.1") |
889 | ; (source (origin |
890 | ; (method url-fetch) |
891 | ; (uri (string-append "https://github.com/gradle/gradle/archive/v" |
892 | ; version ".tar.gz")) |
893 | ; (file-name (string-append name "-" version ".tar.gz")) |
894 | ; (sha256 |
895 | ; (base32 "0fq30k51mkixg31z3d4fjq3zbnyjml4i530px6n1n947mqk3rgyl")))) |
896 | ; (build-system ant-build-system) |
897 | ; (arguments |
898 | ; `(#:phases |
899 | ; (modify-phases %standard-phases |
900 | ; (replace 'build |
901 | ; (lambda* _ |
902 | ; (system* "sh" "-x" "gradlew" "prBuild" "-x" "integTest" "--continue" |
903 | ; "--stacktrace")))))) |
904 | ; ;(system* "sh" "-x" "travisci_build.sh")))))) |
905 | ; (home-page "") |
906 | ; (synopsis "Build system") |
907 | ; (description "Build system") |
908 | ; (license license:asl2.0))) |
909 | ; |
910 | ;;; Requires gradle. |
911 | ;(define-public android-anysoft-keyboard |
912 | ; (package |
913 | ; (name "android-anysoft-keyboard") |
914 | ; (version "1.8-r9") |
915 | ; (source (origin |
916 | ; (method url-fetch) |
917 | ; (uri (string-append "https://github.com/AnySoftKeyboard/" |
918 | ; "AnySoftKeyboard/archive/" version ".tar.gz")) |
919 | ; (file-name (string-append name "-" version ".tar.gz")) |
920 | ; (sha256 |
921 | ; (base32 |
922 | ; "1mrin9mw1rs23d25v8yx4jprx7j05zir6756sqvk4myxbkcp8mag")))) |
923 | ; (build-system ant-build-system) |
924 | ; (home-page "https://anysoftkeyboard.github.io/") |
925 | ; (synopsis "Alternative on-screen keyboard for multiple languages") |
926 | ; (description "Alternative on-screen keyboard for multiple languages.") |
927 | ; (license license:asl2.0))) |
928 |