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 | ;; https://github.com/KengoTODA/java-diff-utils ? |
282 | ;; com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE |
283 | ;; com.sun.source.tree.PackageTree |
284 | ;; com.sun.tools.javac.tree.JCTree.JCPackageDecl |
285 | (define-public java-error-prone |
286 | (package |
287 | (name "java-error-prone") |
288 | (version "2.0.19") |
289 | (source (origin |
290 | (method url-fetch) |
291 | (uri (string-append "https://github.com/google/error-prone/archive/v" |
292 | version ".tar.gz")) |
293 | (file-name (string-append name "-" version ".tar.gz")) |
294 | (patches (search-patches "java-error-prone-add-build.xml.patch")) |
295 | (sha256 |
296 | (base32 |
297 | "00igy7a6aylswxdcklj9021g2s8bvsvrysagqyd8cibm4pimxrnk")))) |
298 | (build-system ant-build-system) |
299 | (arguments |
300 | `(#:tests? #f |
301 | #:jdk ,icedtea-8 |
302 | #:phases |
303 | (modify-phases %standard-phases |
304 | (add-before 'build 'copy-internal |
305 | (lambda _ |
306 | (mkdir-p "ant/src/main/java/com/google/errorprone/internal") |
307 | (copy-file |
308 | "core/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java" |
309 | "ant/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java")))))) |
310 | (inputs |
311 | `(("java-jsr305" ,java-jsr305) |
312 | ("java-auto-value" ,java-auto-value) |
313 | ("java-checker-framework" ,java-checker-framework) |
314 | ("java-guava" ,java-guava))) |
315 | (home-page "https://github.com/google/guava") |
316 | (synopsis "") |
317 | (description "") |
318 | (license license:asl2.0))) |
319 | |
320 | (define-public java-error-prone-annotations |
321 | (package |
322 | (inherit java-error-prone) |
323 | (name "java-error-prone-annotations") |
324 | (version "2.0.19") |
325 | (arguments |
326 | `(#:tests? #f |
327 | #:jar-name (string-append ,name "-" ,version ".jar") |
328 | #:source-dir "annotations/src")) |
329 | (inputs |
330 | `(("java-jsr305" ,java-jsr305))))) |
331 | |
332 | (define-public java-j2objc |
333 | (package |
334 | (name "java-j2objc") |
335 | (version "1.3.1") |
336 | (source (origin |
337 | (method url-fetch) |
338 | (uri (string-append "https://github.com/google/j2objc/archive/" |
339 | version ".tar.gz")) |
340 | (file-name (string-append name "-" version ".tar.gz")) |
341 | (patches (search-patches "java-j2objc-add-build.xml.patch")) |
342 | (sha256 |
343 | (base32 |
344 | "0d5spbr1whw2afg6mknyr7ifm6xivn3bbvnzjxva2zzkyq944hv0")))) |
345 | (build-system ant-build-system) |
346 | (arguments |
347 | `(#:tests? #f)) |
348 | (home-page "http://j2objc.org") |
349 | (synopsis "") |
350 | (description "") |
351 | (license license:asl2.0))) |
352 | |
353 | (define-public java-j2objc-annotations |
354 | (package |
355 | (inherit java-j2objc) |
356 | (name "java-j2objc-annotations") |
357 | (version "1.3.1") |
358 | (arguments |
359 | `(#:tests? #f |
360 | #:jar-name (string-append ,name "-" ,version ".jar") |
361 | #:source-dir "annotations/src/main/java")))) |
362 | |
363 | ;; TODO: animal-sniffer-enforcer-rule and animal-sniffer-maven-plugin depend |
364 | ;; on maven. |
365 | (define-public java-animal-sniffer |
366 | (package |
367 | (name "java-animal-sniffer") |
368 | (version "1.15") |
369 | (source (origin |
370 | (method url-fetch) |
371 | (uri (string-append "https://github.com/mojohaus/animal-sniffer/" |
372 | "archive/animal-sniffer-parent-" |
373 | version ".tar.gz")) |
374 | (file-name (string-append name "-" version ".tar.gz")) |
375 | (sha256 |
376 | (base32 |
377 | "1350yl003y1fjzdwis0dg5jhi5kggk2sxnkv9821z5janw4p986m")))) |
378 | (build-system ant-build-system) |
379 | (propagated-inputs |
380 | `(("asm" ,java-asm))) |
381 | (arguments |
382 | `(#:tests? #f |
383 | #:jar-name (string-append ,name "-" ,version ".jar") |
384 | #:source-dir "animal-sniffer/src/main/java")) |
385 | (home-page "http://www.mojohaus.org/animal-sniffer") |
386 | (synopsis "") |
387 | (description "") |
388 | (license license:asl2.0))) |
389 | |
390 | (define-public java-animal-sniffer-annotations |
391 | (package |
392 | (inherit java-animal-sniffer) |
393 | (name "java-animal-sniffer-annotations") |
394 | (version (package-version java-animal-sniffer)) |
395 | (propagated-inputs '()) |
396 | (arguments |
397 | `(#:tests? #f |
398 | #:jar-name (string-append ,name "-" ,version ".jar") |
399 | #:source-dir "animal-sniffer-annotations/src/main/java")))) |
400 | |
401 | (define-public java-animal-sniffer-ant-tasks |
402 | (package |
403 | (inherit java-animal-sniffer) |
404 | (name "java-animal-sniffer-ant-tasks") |
405 | (version (package-version java-animal-sniffer)) |
406 | (propagated-inputs |
407 | `(("animal-sniffer" ,java-animal-sniffer))) |
408 | (arguments |
409 | `(#:tests? #f |
410 | #:jar-name (string-append ,name "-" ,version ".jar") |
411 | #:source-dir "animal-sniffer-ant-tasks/src/main/java")))) |
412 | |
413 | (define-public java-boot-classpath-detector |
414 | (package |
415 | (inherit java-animal-sniffer) |
416 | (name "java-boot-classpath-detector") |
417 | (version (package-version java-animal-sniffer)) |
418 | (propagated-inputs '()) |
419 | (arguments |
420 | `(#:tests? #f |
421 | #:jar-name (string-append ,name "-" ,version ".jar") |
422 | #:source-dir "java-boot-classpath-detector/src/main/java")))) |
423 | |
424 | (define-public java-guava |
425 | (package |
426 | (name "java-guava") |
427 | (version "20.0") |
428 | (source (origin |
429 | (method url-fetch) |
430 | (uri (string-append "https://github.com/google/guava/archive/v" |
431 | version ".tar.gz")) |
432 | (file-name (string-append name "-" version ".tar.gz")) |
433 | (sha256 |
434 | (base32 |
435 | "1kasavj973iblj1fj35gzbywhkljrnbjpymgqyqaibbbmmbzff8s")))) |
436 | (build-system ant-build-system) |
437 | (arguments |
438 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
439 | #:source-dir "guava/src" |
440 | #:tests? #f)) |
441 | (inputs |
442 | `(("java-jsr305" ,java-jsr305) |
443 | ("java-j2objc-annotations" ,java-j2objc-annotations) |
444 | ("java-animal-sniffer-annotations" ,java-animal-sniffer-annotations) |
445 | ("java-error-prone-annotations" ,java-error-prone-annotations))) |
446 | (home-page "https://github.com/google/guava") |
447 | (synopsis "") |
448 | (description "") |
449 | (license license:asl2.0))) |
450 | |
451 | (define-public java-joda-convert |
452 | (package |
453 | (name "java-joda-convert") |
454 | (version "1.8.1") |
455 | (source (origin |
456 | (method url-fetch) |
457 | (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v" |
458 | version ".tar.gz")) |
459 | (file-name (string-append name "-" version ".tar.gz")) |
460 | (sha256 |
461 | (base32 |
462 | "1di9chp0pgvd2gxsmdaxhldwns9a2ss9705jmn97mdd69cg5zcnc")))) |
463 | (build-system ant-build-system) |
464 | (arguments |
465 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
466 | #:source-dir "src/main/java" |
467 | #:tests? #f)) |
468 | (inputs |
469 | `(("java-google-collect" ,java-google-collect))) |
470 | (native-inputs |
471 | `(("junit" ,java-junit))) |
472 | (home-page "") |
473 | (synopsis "") |
474 | (description "") |
475 | (license license:asl2.0))) |
476 | |
477 | (define-public java-joda-time |
478 | (package |
479 | (name "java-joda-time") |
480 | (version "2.9.9") |
481 | (source (origin |
482 | (method url-fetch) |
483 | (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v" |
484 | version ".tar.gz")) |
485 | (file-name (string-append name "-" version ".tar.gz")) |
486 | (sha256 |
487 | (base32 |
488 | "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1")))) |
489 | (build-system ant-build-system) |
490 | (arguments |
491 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
492 | #:source-dir "src/main/java" |
493 | #:tests? #f)) |
494 | (inputs |
495 | `(("java-joda-convert" ,java-joda-convert))) |
496 | (native-inputs |
497 | `(("junit" ,java-junit))) |
498 | (home-page "") |
499 | (synopsis "") |
500 | (description "") |
501 | (license license:asl2.0))) |
502 | |
503 | (define-public java-xstream |
504 | (package |
505 | (name "java-xstream") |
506 | (version "1.4.9") |
507 | (source (origin |
508 | (method url-fetch) |
509 | (uri (string-append "https://repo1.maven.org/maven2/com/thoughtworks" |
510 | "/xstream/xstream-distribution/" version |
511 | "/xstream-distribution-" version "-src.zip")) |
512 | (file-name (string-append name "-" version ".zip")) |
513 | (sha256 |
514 | (base32 |
515 | "1cq9j9h839wc6pkrgd9bd7y94a3zrj1j741i134izqs9xx2b54fi")))) |
516 | (build-system ant-build-system) |
517 | (arguments |
518 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
519 | #:tests? #f |
520 | #:source-dir "xstream/src/java")) |
521 | (native-inputs |
522 | `(("unzip" ,unzip))) |
523 | (home-page "https://x-stream.github.io") |
524 | (synopsis "") |
525 | (description "") |
526 | (license license:x11))) |
527 | |
528 | (define-public java-jsonp |
529 | (package |
530 | (name "java-jsonp") |
531 | (version "1.0.4") |
532 | (source (origin |
533 | (method git-fetch) |
534 | (uri (git-reference |
535 | (url "git://java.net/jsonp~git") |
536 | (commit "a586e706aea82dc80fb05bdf59f2a25150ee1801"))) |
537 | (file-name (string-append name "-" version)) |
538 | (sha256 |
539 | (base32 |
540 | "01r4syivcywpvxkr1hn0az9316pr7qpnx154zzzw0nijfmdlbw7n")))) |
541 | (build-system ant-build-system) |
542 | (arguments |
543 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
544 | #:tests? #f |
545 | #:source-dir "api/src")) |
546 | (home-page "https://jsonp.java.net") |
547 | (synopsis "") |
548 | (description "") |
549 | (license (list license:gpl2 |
550 | ;; actually CDDL 1.1 |
551 | license:cddl1.0)))) |
552 | |
553 | ;; Can only be built with gradle. |
554 | (define-public groovy |
555 | (package |
556 | (name "groovy") |
557 | (version "2.4.10") |
558 | (source (origin |
559 | (method url-fetch) |
560 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
561 | "2_4_10.tar.gz")) |
562 | (file-name (string-append name "-" version ".tar.gz")) |
563 | (sha256 |
564 | (base32 |
565 | "0wapzqwpx4bh2fsqpzf3haakjz6wvfjx1vd9a4spavhlrjqk2pbb")))) |
566 | (build-system ant-build-system) |
567 | (arguments |
568 | `(#:jar-name "groovy.jar" |
569 | #:tests? #f)) |
570 | (native-inputs |
571 | `(("junit" ,java-junit))) |
572 | (inputs |
573 | `(("commons-cli" ,java-commons-cli) |
574 | ("antlr" ,antlr3) |
575 | ("asm" ,java-asm))) |
576 | (home-page "") |
577 | (synopsis "") |
578 | (description "") |
579 | (license license:asl2.0))) |
580 | |
581 | ;; requires jline, javax.servlet, org.fusesource.jansi, org.livetribe, |
582 | ;; com.thoughtworks.xstream, org.apache.ivy, bsf |
583 | ;; antlr |
584 | (define-public groovy-1.8.9 |
585 | (package |
586 | (inherit groovy) |
587 | (name "groovy") |
588 | (version "1.8.9") |
589 | (source (origin |
590 | (method url-fetch) |
591 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
592 | "1_8_9.tar.gz")) |
593 | (file-name (string-append name "-" version ".tar.gz")) |
594 | (sha256 |
595 | (base32 |
596 | "16z3jv5yw11wwwzbs6x41g83gqazhngg30ys2kpy7cpfm3rsqi71")))) |
597 | (arguments |
598 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
599 | #:tests? #f |
600 | #:source-dir "src/main")))) |
601 | |
602 | |
603 | (define-public antlr3-3.4 |
604 | (package |
605 | (name "antlr3") |
606 | (version "3.4") |
607 | (source (origin |
608 | (method url-fetch) |
609 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
610 | "gh-pages/download/antlr-" |
611 | version ".tar.gz")) |
612 | (sha256 |
613 | (base32 |
614 | "1cwfswpk3jlzl1dhc6b6586srza8q0bbzwlxcq136p29v62fjrb3")))) |
615 | (build-system ant-build-system) |
616 | (arguments |
617 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
618 | #:source-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" |
619 | #:tests? #f |
620 | #:phases |
621 | (modify-phases %standard-phases |
622 | (add-after 'install 'bin-install |
623 | (lambda* (#:key inputs outputs #:allow-other-keys) |
624 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
625 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
626 | (mkdir-p bin) |
627 | (with-output-to-file (string-append bin "/antlr3") |
628 | (lambda _ |
629 | (display |
630 | (string-append "#!/bin/sh\n" |
631 | "java -cp " jar "/antlr3-3.3.jar:" |
632 | (string-concatenate |
633 | (find-files (assoc-ref inputs "stringtemplate") |
634 | ".*\\.jar")) |
635 | ":" |
636 | (string-concatenate |
637 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
638 | ".*\\.jar")) |
639 | " org.antlr.Tool $*")))) |
640 | (chmod (string-append bin "/antlr3") #o755)))) |
641 | (add-before 'build 'generate-grammar |
642 | (lambda _ |
643 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
644 | (for-each (lambda (file) |
645 | (display file) |
646 | (newline) |
647 | (system* "antlr3" file)) |
648 | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLR.g" |
649 | "ANTLRTreePrinter.g" "ANTLRv3.g" "ANTLRv3Tree.g" |
650 | "AssignTokenTypesWalker.g" "CodeGenTreeWalker.g" |
651 | "DefineGrammarItemsWalker.g" "LeftRecursiveRuleWalker.g" |
652 | "TreeToNFAConverter.g")) |
653 | (chdir "../../../../../../../..") |
654 | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" |
655 | "tool/src/main/java/org/antlr/tool/serialize.g") |
656 | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" |
657 | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; |
658 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
659 | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" |
660 | (("import org.antlr.grammar.v3.\\*;") |
661 | "import org.antlr.grammar.v3.*;\n |
662 | import org.antlr.grammar.v3.TreeToNFAConverter;\n |
663 | import org.antlr.grammar.v3.DefineGrammarItemsWalker;\n |
664 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
665 | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" |
666 | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) |
667 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" |
668 | (("public Object getTree") "public GrammarAST getTree")) |
669 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" |
670 | (("public Object getTree") "public CommonTree getTree")))) |
671 | (add-before 'build 'fix-build-xml |
672 | (lambda _ |
673 | (substitute* "build.xml" |
674 | (("<exec") "<copy todir=\"${classes.dir}\"> |
675 | <fileset dir=\"tool/src/main/resources\"> |
676 | <include name=\"**/*.stg\"/> |
677 | <include name=\"**/*.st\"/> |
678 | <include name=\"**/*.sti\"/> |
679 | <include name=\"**/STLexer.tokens\"/> |
680 | </fileset> |
681 | </copy><exec"))))))) |
682 | (native-inputs |
683 | `(("antlr" ,antlr2) |
684 | ("antlr3" ,antlr3-3.3))) |
685 | (inputs |
686 | `(("junit" ,java-junit))) |
687 | (propagated-inputs |
688 | `(("stringtemplate" ,stringtemplate3) |
689 | ("stringtemplate4" ,stringtemplate4) |
690 | ("antlr" ,antlr2) |
691 | ("antlr3" ,antlr3-3.1))) |
692 | (home-page "http://www.stringtemplate.org") |
693 | (synopsis "") |
694 | (description "") |
695 | (license license:bsd-3))) |
696 | |
697 | (define-public libantlr3c |
698 | (package |
699 | (inherit antlr3) |
700 | (name "libantlr3c") |
701 | (build-system gnu-build-system) |
702 | (native-inputs |
703 | `(("autoconf" ,autoconf) |
704 | ("automake" ,automake) |
705 | ("libtool" ,libtool))) |
706 | (propagated-inputs |
707 | `(("antlr" ,antlr3))) |
708 | (arguments |
709 | `(#:configure-flags (list "--enable-64bit" "--disable-static") |
710 | #:phases |
711 | (modify-phases %standard-phases |
712 | (add-before 'configure 'autoreconf |
713 | (lambda _ |
714 | (chdir "runtime/C") |
715 | (system* "libtoolize") |
716 | (system* "autoreconf" "-fiv")))))))) |
717 | |
718 | ;; javax.json.* |
719 | ;; org.abego.treelayout.* |
720 | ;; com.ibm.icu.* |
721 | (define-public antlr4 |
722 | (package |
723 | (name "antlr4") |
724 | (version "4.7") |
725 | (source (origin |
726 | (method url-fetch) |
727 | (uri (string-append "https://github.com/antlr/antlr4/archive/" |
728 | version ".tar.gz")) |
729 | (file-name (string-append name "-" version ".tar.gz")) |
730 | (sha256 |
731 | (base32 |
732 | "0y7lzkvx9wbbmwg45mb4icx7i66z6894qfygrbbs26sr5xxyml9h")))) |
733 | (build-system ant-build-system) |
734 | (arguments |
735 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
736 | #:source-dir "runtime/Java/src:tool/src" |
737 | #:phases |
738 | (modify-phases %standard-phases |
739 | (add-before 'build 'generate-grammar |
740 | (lambda* (#:key inputs #:allow-other-keys) |
741 | (chdir "tool/src/org/antlr/v4/parse") |
742 | (for-each (lambda (file) |
743 | (format #t "~a\n" file) |
744 | (system* "antlr3" file)) |
745 | '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g" |
746 | "GrammarTreeVisitor.g" "ATNBuilder.g" |
747 | "ActionSplitter.g" "LeftRecursiveRuleWalker.g")) |
748 | (chdir "../codegen") |
749 | (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens") |
750 | (format #t "SourceGenTriggers.g\n") |
751 | (system* "antlr3" "SourceGenTriggers.g") |
752 | (chdir "../../../../../..")))))) |
753 | (inputs |
754 | `(("antlr3" ,antlr3) |
755 | ("icu4j" ,java-icu4j) |
756 | ("java-jsonp" ,java-jsonp) |
757 | ("treelayout" ,java-treelayout) |
758 | ("stringtemplate4" ,stringtemplate4))) |
759 | (home-page "https://antlr.org") |
760 | (synopsis "") |
761 | (description "") |
762 | (license license:bsd-3))) |
763 | |
764 | |
765 | ;; requires groovy 2.4.7. |
766 | ;(define-public gradle |
767 | ; (package |
768 | ; (name "gradle") |
769 | ; (version "3.4.1") |
770 | ; (source (origin |
771 | ; (method url-fetch) |
772 | ; (uri (string-append "https://github.com/gradle/gradle/archive/v" |
773 | ; version ".tar.gz")) |
774 | ; (file-name (string-append name "-" version ".tar.gz")) |
775 | ; (sha256 |
776 | ; (base32 "0fq30k51mkixg31z3d4fjq3zbnyjml4i530px6n1n947mqk3rgyl")))) |
777 | ; (build-system ant-build-system) |
778 | ; (arguments |
779 | ; `(#:phases |
780 | ; (modify-phases %standard-phases |
781 | ; (replace 'build |
782 | ; (lambda* _ |
783 | ; (system* "sh" "-x" "gradlew" "prBuild" "-x" "integTest" "--continue" |
784 | ; "--stacktrace")))))) |
785 | ; ;(system* "sh" "-x" "travisci_build.sh")))))) |
786 | ; (home-page "") |
787 | ; (synopsis "Build system") |
788 | ; (description "Build system") |
789 | ; (license license:asl2.0))) |
790 | ; |
791 | ;;; Requires gradle. |
792 | ;(define-public android-anysoft-keyboard |
793 | ; (package |
794 | ; (name "android-anysoft-keyboard") |
795 | ; (version "1.8-r9") |
796 | ; (source (origin |
797 | ; (method url-fetch) |
798 | ; (uri (string-append "https://github.com/AnySoftKeyboard/" |
799 | ; "AnySoftKeyboard/archive/" version ".tar.gz")) |
800 | ; (file-name (string-append name "-" version ".tar.gz")) |
801 | ; (sha256 |
802 | ; (base32 |
803 | ; "1mrin9mw1rs23d25v8yx4jprx7j05zir6756sqvk4myxbkcp8mag")))) |
804 | ; (build-system ant-build-system) |
805 | ; (home-page "https://anysoftkeyboard.github.io/") |
806 | ; (synopsis "Alternative on-screen keyboard for multiple languages") |
807 | ; (description "Alternative on-screen keyboard for multiple languages.") |
808 | ; (license license:asl2.0))) |
809 |