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 | (license license:asl2.0))) |
446 | |
447 | ;; TODO: animal-sniffer-enforcer-rule and animal-sniffer-maven-plugin depend |
448 | ;; on maven. |
449 | (define-public java-animal-sniffer |
450 | (package |
451 | (name "java-animal-sniffer") |
452 | (version "1.15") |
453 | (source (origin |
454 | (method url-fetch) |
455 | (uri (string-append "https://github.com/mojohaus/animal-sniffer/" |
456 | "archive/animal-sniffer-parent-" |
457 | version ".tar.gz")) |
458 | (file-name (string-append name "-" version ".tar.gz")) |
459 | (sha256 |
460 | (base32 |
461 | "1350yl003y1fjzdwis0dg5jhi5kggk2sxnkv9821z5janw4p986m")))) |
462 | (build-system ant-build-system) |
463 | (propagated-inputs |
464 | `(("asm" ,java-asm))) |
465 | (arguments |
466 | `(#:tests? #f |
467 | #:jar-name (string-append ,name "-" ,version ".jar") |
468 | #:source-dir "animal-sniffer/src/main/java")) |
469 | (home-page "http://www.mojohaus.org/animal-sniffer") |
470 | (synopsis "") |
471 | (description "") |
472 | (license license:asl2.0))) |
473 | |
474 | (define-public java-animal-sniffer-annotations |
475 | (package |
476 | (inherit java-animal-sniffer) |
477 | (name "java-animal-sniffer-annotations") |
478 | (version (package-version java-animal-sniffer)) |
479 | (propagated-inputs '()) |
480 | (arguments |
481 | `(#:tests? #f |
482 | #:jar-name (string-append ,name "-" ,version ".jar") |
483 | #:source-dir "animal-sniffer-annotations/src/main/java")))) |
484 | |
485 | (define-public java-animal-sniffer-ant-tasks |
486 | (package |
487 | (inherit java-animal-sniffer) |
488 | (name "java-animal-sniffer-ant-tasks") |
489 | (version (package-version java-animal-sniffer)) |
490 | (propagated-inputs |
491 | `(("animal-sniffer" ,java-animal-sniffer))) |
492 | (arguments |
493 | `(#:tests? #f |
494 | #:jar-name (string-append ,name "-" ,version ".jar") |
495 | #:source-dir "animal-sniffer-ant-tasks/src/main/java")))) |
496 | |
497 | (define-public java-boot-classpath-detector |
498 | (package |
499 | (inherit java-animal-sniffer) |
500 | (name "java-boot-classpath-detector") |
501 | (version (package-version java-animal-sniffer)) |
502 | (propagated-inputs '()) |
503 | (arguments |
504 | `(#:tests? #f |
505 | #:jar-name (string-append ,name "-" ,version ".jar") |
506 | #:source-dir "java-boot-classpath-detector/src/main/java")))) |
507 | |
508 | (define-public java-guava |
509 | (package |
510 | (name "java-guava") |
511 | (version "20.0") |
512 | (source (origin |
513 | (method url-fetch) |
514 | (uri (string-append "https://github.com/google/guava/archive/v" |
515 | version ".tar.gz")) |
516 | (file-name (string-append name "-" version ".tar.gz")) |
517 | (sha256 |
518 | (base32 |
519 | "1kasavj973iblj1fj35gzbywhkljrnbjpymgqyqaibbbmmbzff8s")))) |
520 | (build-system ant-build-system) |
521 | (arguments |
522 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
523 | #:source-dir "guava/src" |
524 | #:tests? #f)) |
525 | (inputs |
526 | `(("java-jsr305" ,java-jsr305) |
527 | ("java-j2objc-annotations" ,java-j2objc-annotations) |
528 | ("java-animal-sniffer-annotations" ,java-animal-sniffer-annotations) |
529 | ("java-error-prone-annotations" ,java-error-prone-annotations))) |
530 | (home-page "https://github.com/google/guava") |
531 | (synopsis "") |
532 | (description "") |
533 | (license license:asl2.0))) |
534 | |
535 | (define-public java-joda-convert |
536 | (package |
537 | (name "java-joda-convert") |
538 | (version "1.8.1") |
539 | (source (origin |
540 | (method url-fetch) |
541 | (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v" |
542 | version ".tar.gz")) |
543 | (file-name (string-append name "-" version ".tar.gz")) |
544 | (sha256 |
545 | (base32 |
546 | "1di9chp0pgvd2gxsmdaxhldwns9a2ss9705jmn97mdd69cg5zcnc")))) |
547 | (build-system ant-build-system) |
548 | (arguments |
549 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
550 | #:source-dir "src/main/java" |
551 | #:tests? #f)) |
552 | (inputs |
553 | `(("java-google-collect" ,java-google-collect))) |
554 | (native-inputs |
555 | `(("junit" ,java-junit))) |
556 | (home-page "") |
557 | (synopsis "") |
558 | (description "") |
559 | (license license:asl2.0))) |
560 | |
561 | (define-public java-joda-time |
562 | (package |
563 | (name "java-joda-time") |
564 | (version "2.9.9") |
565 | (source (origin |
566 | (method url-fetch) |
567 | (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v" |
568 | version ".tar.gz")) |
569 | (file-name (string-append name "-" version ".tar.gz")) |
570 | (sha256 |
571 | (base32 |
572 | "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1")))) |
573 | (build-system ant-build-system) |
574 | (arguments |
575 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
576 | #:source-dir "src/main/java" |
577 | #:tests? #f)) |
578 | (inputs |
579 | `(("java-joda-convert" ,java-joda-convert))) |
580 | (native-inputs |
581 | `(("junit" ,java-junit))) |
582 | (home-page "") |
583 | (synopsis "") |
584 | (description "") |
585 | (license license:asl2.0))) |
586 | |
587 | (define-public java-xstream |
588 | (package |
589 | (name "java-xstream") |
590 | (version "1.4.9") |
591 | (source (origin |
592 | (method url-fetch) |
593 | (uri (string-append "https://repo1.maven.org/maven2/com/thoughtworks" |
594 | "/xstream/xstream-distribution/" version |
595 | "/xstream-distribution-" version "-src.zip")) |
596 | (file-name (string-append name "-" version ".zip")) |
597 | (sha256 |
598 | (base32 |
599 | "1cq9j9h839wc6pkrgd9bd7y94a3zrj1j741i134izqs9xx2b54fi")))) |
600 | (build-system ant-build-system) |
601 | (arguments |
602 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
603 | #:tests? #f |
604 | #:source-dir "xstream/src/java")) |
605 | (native-inputs |
606 | `(("unzip" ,unzip))) |
607 | (home-page "https://x-stream.github.io") |
608 | (synopsis "") |
609 | (description "") |
610 | (license license:x11))) |
611 | |
612 | (define-public java-jsonp |
613 | (package |
614 | (name "java-jsonp") |
615 | (version "1.0.4") |
616 | (source (origin |
617 | (method git-fetch) |
618 | (uri (git-reference |
619 | (url "git://java.net/jsonp~git") |
620 | (commit "a586e706aea82dc80fb05bdf59f2a25150ee1801"))) |
621 | (file-name (string-append name "-" version)) |
622 | (sha256 |
623 | (base32 |
624 | "01r4syivcywpvxkr1hn0az9316pr7qpnx154zzzw0nijfmdlbw7n")))) |
625 | (build-system ant-build-system) |
626 | (arguments |
627 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
628 | #:tests? #f |
629 | #:source-dir "api/src")) |
630 | (home-page "https://jsonp.java.net") |
631 | (synopsis "") |
632 | (description "") |
633 | (license (list license:gpl2 |
634 | ;; actually CDDL 1.1 |
635 | license:cddl1.0)))) |
636 | |
637 | ;; Can only be built with gradle. |
638 | (define-public groovy |
639 | (package |
640 | (name "groovy") |
641 | (version "2.4.10") |
642 | (source (origin |
643 | (method url-fetch) |
644 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
645 | "2_4_10.tar.gz")) |
646 | (file-name (string-append name "-" version ".tar.gz")) |
647 | (sha256 |
648 | (base32 |
649 | "0wapzqwpx4bh2fsqpzf3haakjz6wvfjx1vd9a4spavhlrjqk2pbb")))) |
650 | (build-system ant-build-system) |
651 | (arguments |
652 | `(#:jar-name "groovy.jar" |
653 | #:tests? #f)) |
654 | (native-inputs |
655 | `(("junit" ,java-junit))) |
656 | (inputs |
657 | `(("commons-cli" ,java-commons-cli) |
658 | ("antlr" ,antlr3) |
659 | ("asm" ,java-asm))) |
660 | (home-page "") |
661 | (synopsis "") |
662 | (description "") |
663 | (license license:asl2.0))) |
664 | |
665 | ;; requires jline, javax.servlet, org.fusesource.jansi, org.livetribe, |
666 | ;; com.thoughtworks.xstream, org.apache.ivy, bsf |
667 | ;; antlr |
668 | (define-public groovy-1.8.9 |
669 | (package |
670 | (inherit groovy) |
671 | (name "groovy") |
672 | (version "1.8.9") |
673 | (source (origin |
674 | (method url-fetch) |
675 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
676 | "1_8_9.tar.gz")) |
677 | (file-name (string-append name "-" version ".tar.gz")) |
678 | (sha256 |
679 | (base32 |
680 | "16z3jv5yw11wwwzbs6x41g83gqazhngg30ys2kpy7cpfm3rsqi71")))) |
681 | (arguments |
682 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
683 | #:tests? #f |
684 | #:source-dir "src/main")))) |
685 | |
686 | |
687 | (define-public antlr3-3.4 |
688 | (package |
689 | (name "antlr3") |
690 | (version "3.4") |
691 | (source (origin |
692 | (method url-fetch) |
693 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
694 | "gh-pages/download/antlr-" |
695 | version ".tar.gz")) |
696 | (sha256 |
697 | (base32 |
698 | "1cwfswpk3jlzl1dhc6b6586srza8q0bbzwlxcq136p29v62fjrb3")))) |
699 | (build-system ant-build-system) |
700 | (arguments |
701 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
702 | #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" |
703 | #:tests? #f |
704 | #:phases |
705 | (modify-phases %standard-phases |
706 | (add-after 'install 'bin-install |
707 | (lambda* (#:key inputs outputs #:allow-other-keys) |
708 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
709 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
710 | (mkdir-p bin) |
711 | (with-output-to-file (string-append bin "/antlr3") |
712 | (lambda _ |
713 | (display |
714 | (string-append "#!/bin/sh\n" |
715 | "java -cp " jar "/antlr3-3.3.jar:" |
716 | (string-concatenate |
717 | (find-files (assoc-ref inputs "stringtemplate") |
718 | ".*\\.jar")) |
719 | ":" |
720 | (string-concatenate |
721 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
722 | ".*\\.jar")) |
723 | " org.antlr.Tool $*")))) |
724 | (chmod (string-append bin "/antlr3") #o755)))) |
725 | (add-before 'build 'generate-grammar |
726 | (lambda _ |
727 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
728 | (for-each (lambda (file) |
729 | (display file) |
730 | (newline) |
731 | (system* "antlr3" file)) |
732 | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLR.g" |
733 | "ANTLRTreePrinter.g" "ANTLRv3.g" "ANTLRv3Tree.g" |
734 | "AssignTokenTypesWalker.g" "CodeGenTreeWalker.g" |
735 | "DefineGrammarItemsWalker.g" "LeftRecursiveRuleWalker.g" |
736 | "TreeToNFAConverter.g")) |
737 | (chdir "../../../../../../../..") |
738 | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" |
739 | "tool/src/main/java/org/antlr/tool/serialize.g") |
740 | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" |
741 | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; |
742 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
743 | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" |
744 | (("import org.antlr.grammar.v3.\\*;") |
745 | "import org.antlr.grammar.v3.*;\n |
746 | import org.antlr.grammar.v3.TreeToNFAConverter;\n |
747 | import org.antlr.grammar.v3.DefineGrammarItemsWalker;\n |
748 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
749 | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" |
750 | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) |
751 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" |
752 | (("public Object getTree") "public GrammarAST getTree")) |
753 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" |
754 | (("public Object getTree") "public CommonTree getTree")))) |
755 | (add-before 'build 'fix-build-xml |
756 | (lambda _ |
757 | (substitute* "build.xml" |
758 | (("<exec") "<copy todir=\"${classes.dir}\"> |
759 | <fileset dir=\"tool/src/main/resources\"> |
760 | <include name=\"**/*.stg\"/> |
761 | <include name=\"**/*.st\"/> |
762 | <include name=\"**/*.sti\"/> |
763 | <include name=\"**/STLexer.tokens\"/> |
764 | </fileset> |
765 | </copy><exec"))))))) |
766 | (native-inputs |
767 | `(("antlr" ,antlr2) |
768 | ("antlr3" ,antlr3-3.3))) |
769 | (inputs |
770 | `(("junit" ,java-junit))) |
771 | (propagated-inputs |
772 | `(("stringtemplate" ,stringtemplate3) |
773 | ("stringtemplate4" ,stringtemplate4) |
774 | ("antlr" ,antlr2) |
775 | ("antlr3" ,antlr3-3.1))) |
776 | (home-page "http://www.stringtemplate.org") |
777 | (synopsis "") |
778 | (description "") |
779 | (license license:bsd-3))) |
780 | |
781 | (define-public libantlr3c |
782 | (package |
783 | (inherit antlr3) |
784 | (name "libantlr3c") |
785 | (build-system gnu-build-system) |
786 | (native-inputs |
787 | `(("autoconf" ,autoconf) |
788 | ("automake" ,automake) |
789 | ("libtool" ,libtool))) |
790 | (propagated-inputs |
791 | `(("antlr" ,antlr3))) |
792 | (arguments |
793 | `(#:configure-flags (list "--enable-64bit" "--disable-static") |
794 | #:phases |
795 | (modify-phases %standard-phases |
796 | (add-before 'configure 'autoreconf |
797 | (lambda _ |
798 | (chdir "runtime/C") |
799 | (system* "libtoolize") |
800 | (system* "autoreconf" "-fiv")))))))) |
801 | |
802 | ;; javax.json.* |
803 | ;; org.abego.treelayout.* |
804 | ;; com.ibm.icu.* |
805 | (define-public antlr4 |
806 | (package |
807 | (name "antlr4") |
808 | (version "4.7") |
809 | (source (origin |
810 | (method url-fetch) |
811 | (uri (string-append "https://github.com/antlr/antlr4/archive/" |
812 | version ".tar.gz")) |
813 | (file-name (string-append name "-" version ".tar.gz")) |
814 | (sha256 |
815 | (base32 |
816 | "0y7lzkvx9wbbmwg45mb4icx7i66z6894qfygrbbs26sr5xxyml9h")))) |
817 | (build-system ant-build-system) |
818 | (arguments |
819 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
820 | #:source-dir "runtime/Java/src:tool/src" |
821 | #:phases |
822 | (modify-phases %standard-phases |
823 | (add-before 'build 'generate-grammar |
824 | (lambda* (#:key inputs #:allow-other-keys) |
825 | (chdir "tool/src/org/antlr/v4/parse") |
826 | (for-each (lambda (file) |
827 | (format #t "~a\n" file) |
828 | (system* "antlr3" file)) |
829 | '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g" |
830 | "GrammarTreeVisitor.g" "ATNBuilder.g" |
831 | "ActionSplitter.g" "LeftRecursiveRuleWalker.g")) |
832 | (chdir "../codegen") |
833 | (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens") |
834 | (format #t "SourceGenTriggers.g\n") |
835 | (system* "antlr3" "SourceGenTriggers.g") |
836 | (chdir "../../../../../..")))))) |
837 | (inputs |
838 | `(("antlr3" ,antlr3) |
839 | ("icu4j" ,java-icu4j) |
840 | ("java-jsonp" ,java-jsonp) |
841 | ("treelayout" ,java-treelayout) |
842 | ("stringtemplate4" ,stringtemplate4))) |
843 | (home-page "https://antlr.org") |
844 | (synopsis "") |
845 | (description "") |
846 | (license license:bsd-3))) |
847 | |
848 | |
849 | ;; requires groovy 2.4.7. |
850 | ;(define-public gradle |
851 | ; (package |
852 | ; (name "gradle") |
853 | ; (version "3.4.1") |
854 | ; (source (origin |
855 | ; (method url-fetch) |
856 | ; (uri (string-append "https://github.com/gradle/gradle/archive/v" |
857 | ; version ".tar.gz")) |
858 | ; (file-name (string-append name "-" version ".tar.gz")) |
859 | ; (sha256 |
860 | ; (base32 "0fq30k51mkixg31z3d4fjq3zbnyjml4i530px6n1n947mqk3rgyl")))) |
861 | ; (build-system ant-build-system) |
862 | ; (arguments |
863 | ; `(#:phases |
864 | ; (modify-phases %standard-phases |
865 | ; (replace 'build |
866 | ; (lambda* _ |
867 | ; (system* "sh" "-x" "gradlew" "prBuild" "-x" "integTest" "--continue" |
868 | ; "--stacktrace")))))) |
869 | ; ;(system* "sh" "-x" "travisci_build.sh")))))) |
870 | ; (home-page "") |
871 | ; (synopsis "Build system") |
872 | ; (description "Build system") |
873 | ; (license license:asl2.0))) |
874 | ; |
875 | ;;; Requires gradle. |
876 | ;(define-public android-anysoft-keyboard |
877 | ; (package |
878 | ; (name "android-anysoft-keyboard") |
879 | ; (version "1.8-r9") |
880 | ; (source (origin |
881 | ; (method url-fetch) |
882 | ; (uri (string-append "https://github.com/AnySoftKeyboard/" |
883 | ; "AnySoftKeyboard/archive/" version ".tar.gz")) |
884 | ; (file-name (string-append name "-" version ".tar.gz")) |
885 | ; (sha256 |
886 | ; (base32 |
887 | ; "1mrin9mw1rs23d25v8yx4jprx7j05zir6756sqvk4myxbkcp8mag")))) |
888 | ; (build-system ant-build-system) |
889 | ; (home-page "https://anysoftkeyboard.github.io/") |
890 | ; (synopsis "Alternative on-screen keyboard for multiple languages") |
891 | ; (description "Alternative on-screen keyboard for multiple languages.") |
892 | ; (license license:asl2.0))) |
893 |