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 utils) |
26 | #:use-module (guix build-system ant) |
27 | #:use-module (guix build-system gnu) |
28 | #:use-module (guix build-system trivial) |
29 | #:use-module (gnu packages autotools) |
30 | #:use-module (gnu packages base) |
31 | #:use-module (gnu packages zip) |
32 | #:use-module (gnu packages java)) |
33 | |
34 | (define-public josm |
35 | (package |
36 | (name "josm") |
37 | (version "c86ae64ca82a5bb9dd1972c7023797eb9a2577f5") |
38 | (source (origin |
39 | (method git-fetch) |
40 | (uri (git-reference |
41 | (url "https://github.com/openstreetmap/josm.git") |
42 | (commit version))) |
43 | (sha256 |
44 | (base32 |
45 | "07z2q4csq9gdpg4lp1zpvcl5z5sqn0fnqah94ya3sirm6bh4k74j")) |
46 | (file-name (string-append name "-" version)))) |
47 | (build-system ant-build-system) |
48 | (arguments |
49 | `(#:build-target "dist" |
50 | #:tests? #f |
51 | #:jdk ,icedtea-8 |
52 | #:phases |
53 | (modify-phases %standard-phases |
54 | (add-before 'build 'fix-compiler |
55 | (lambda* _ |
56 | (substitute* "build.xml" |
57 | (("UNKNOWN") "11639") |
58 | ((".*com.google.errorprone.ErrorProneAntCompilerAdapter.*") "") |
59 | (("compiler=\"[^\"]*\" ") "")))) |
60 | (replace 'install |
61 | (lambda* (#:key outputs #:allow-other-keys) |
62 | (let* ((out (assoc-ref outputs "out")) |
63 | (bin (string-append out "/bin")) |
64 | (lib (string-append out "/lib/josm"))) |
65 | (mkdir-p bin) |
66 | (mkdir-p lib) |
67 | (copy-file "dist/josm-custom.jar" |
68 | (string-append lib "/josm.jar")) |
69 | (with-output-to-file (string-append bin "/josm") |
70 | (lambda _ |
71 | (display |
72 | (string-append "#!/bin/sh\n" |
73 | "java -jar " lib "/josm.jar")))) |
74 | (chmod (string-append bin "/josm") #o755))))))) |
75 | (home-page "https://josm.openstreetmap.de") |
76 | (synopsis "OSM editor") |
77 | (description "OSM editor.") |
78 | (license license:gpl2+))) |
79 | |
80 | (define-public java-icu4j |
81 | (package |
82 | (name "java-icu4j") |
83 | (version "58.2") |
84 | (source (origin |
85 | (method url-fetch) |
86 | (uri (string-append |
87 | "http://download.icu-project.org/files/icu4j/" version |
88 | "/icu4j-" |
89 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) |
90 | ".tgz")) |
91 | (sha256 |
92 | (base32 |
93 | "1mvqjlc3cbaraa0bv0vyl44xf0x6n81inqsh69bl7f88iycfpns9")))) |
94 | (build-system ant-build-system) |
95 | (arguments |
96 | `(#:tests? #f ; Requires java-ivy that we don't have yet. |
97 | #:phases |
98 | (modify-phases %standard-phases |
99 | ;; icu4j archive contains its sources directly at the top, not in |
100 | ;; a subdirectory as usual. |
101 | (add-after 'unpack 'chdir |
102 | (lambda _ |
103 | (chdir ".."))) |
104 | (replace 'install |
105 | (lambda* (#:key outputs #:allow-other-keys) |
106 | (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) |
107 | (mkdir-p share) |
108 | (copy-file "icu4j-charset.jar" (string-append share "/icu4j-charset.jar")) |
109 | (copy-file "icu4j.jar" (string-append share "/icu4j.jar")))))))) |
110 | (home-page "http://site.icu-project.org/") |
111 | (synopsis "") |
112 | (description "") |
113 | (license license:x11))) |
114 | |
115 | (define-public java-treelayout |
116 | (package |
117 | (name "java-treelayout") |
118 | (version "1.0.3") |
119 | (source (origin |
120 | (method url-fetch) |
121 | (uri (string-append |
122 | "https://github.com/abego/treelayout/archive/v" version |
123 | ".tar.gz")) |
124 | (file-name (string-append name "-" version ".tar.gz")) |
125 | (sha256 |
126 | (base32 |
127 | "0djdw7j66lqjx8bx9zja0hsx10c6nsj3z0z20jmavwfr6bpp0345")))) |
128 | (build-system ant-build-system) |
129 | (arguments |
130 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
131 | #:tests? #f |
132 | #:phases |
133 | (modify-phases %standard-phases |
134 | ;; icu4j archive contains its sources directly at the top, not in |
135 | ;; a subdirectory as usual. |
136 | (add-after 'unpack 'chdir |
137 | (lambda _ |
138 | (chdir "org.abego.treelayout")))))) |
139 | (inputs |
140 | `(("junit" ,java-junit))) |
141 | (home-page "http://treelayout.sourceforge.net") |
142 | (synopsis "") |
143 | (description "") |
144 | (license license:bsd-3))) |
145 | |
146 | (define-public java-commons-cli |
147 | (package |
148 | (name "java-commons-cli") |
149 | (version "1.4") |
150 | (source (origin |
151 | (method url-fetch) |
152 | (uri (string-append "http://mirrors.ircam.fr/pub/apache/commons/" |
153 | "cli/source/commons-cli-" version "-src.tar.gz")) |
154 | (file-name (string-append name "-" version ".tar.gz")) |
155 | (sha256 |
156 | (base32 |
157 | "05hgi2z01fqz374y719gl1dxzqvzci5af071zm7vxrjg9vczipm1")))) |
158 | (build-system ant-build-system) |
159 | (arguments |
160 | `(#:jar-name "commons-cli-1.4.jar" |
161 | #:tests? #f)) |
162 | (native-inputs |
163 | `(("junit" ,java-junit))) |
164 | (home-page "https://commons.apache.org/proper/commons-cli") |
165 | (synopsis "Java API for parsing command line options passed to programs") |
166 | (description "Apache Commons CLI library provides an API for parsing command |
167 | line options passed to programs. It's also able to print help messages detailing |
168 | the options available for a command line tool.") |
169 | (license license:asl2.0))) |
170 | |
171 | (define-public java-asm |
172 | (package |
173 | (name "java-asm") |
174 | (version "5.2") |
175 | (source (origin |
176 | (method url-fetch) |
177 | (uri (string-append "http://download.forge.ow2.org/asm/asm-" |
178 | version ".tar.gz")) |
179 | (file-name (string-append name "-" version ".tar.gz")) |
180 | (sha256 |
181 | (base32 |
182 | "0kxvmv5275rnjl7jv0442k3wjnq03ngkb7sghs78avf45pzm4qgr")))) |
183 | (build-system ant-build-system) |
184 | (arguments |
185 | `(#:jar-name "asm-5.2.jar" |
186 | #:tests? #f)) |
187 | (native-inputs |
188 | `(("junit" ,java-junit))) |
189 | (home-page "") |
190 | (synopsis "") |
191 | (description "") |
192 | (license license:asl2.0))) |
193 | |
194 | (define-public java-jsr305 |
195 | (package |
196 | (name "java-jsr305") |
197 | (version "3.0.2") |
198 | (source (origin |
199 | (method git-fetch) |
200 | (uri (git-reference |
201 | (url "https://github.com/amaembo/jsr-305.git") |
202 | (commit "d7734b13c61492982784560ed5b4f4bd6cf9bb2c"))) |
203 | (file-name (string-append name "-" version)) |
204 | (sha256 |
205 | (base32 |
206 | "1wk159136pgc6i54drbq2whazfmdilvfqlxj3k19s9dfwbayf621")))) |
207 | (build-system ant-build-system) |
208 | (arguments |
209 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
210 | #:src-dir "ri/src/main/java" |
211 | #:tests? #f)) |
212 | (home-page "https://github.com/amaembo/jsr-305") |
213 | (synopsis "") |
214 | (description "") |
215 | (license license:bsd-3))) |
216 | |
217 | (define-public java-checker-framework |
218 | (package |
219 | (name "java-checker-framework") |
220 | (version "2.1.10") |
221 | (source (origin |
222 | (method url-fetch) |
223 | (uri (string-append "https://github.com/typetools/checker-framework/" |
224 | "archive/checker-framework-" version ".tar.gz")) |
225 | (file-name (string-append name "-" version ".tar.gz")) |
226 | (sha256 |
227 | (base32 |
228 | "1infq1hr53zi9bd81v90rn3iripbinb3w145m3xblq8yvnfrxy20")))) |
229 | (build-system ant-build-system) |
230 | (arguments |
231 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
232 | #:src-dir "dataflow/src:javacutil/src" |
233 | #:jdk ,icedtea-8 |
234 | #:tests? #f)) |
235 | (home-page "https://checkerframework.org") |
236 | (synopsis "") |
237 | (description "") |
238 | (license license:gpl2))); with classpath exception |
239 | |
240 | (define-public java-javapoet |
241 | (package |
242 | (name "java-javapoet") |
243 | (version "1.8.0") |
244 | (source (origin |
245 | (method url-fetch) |
246 | (uri (string-append "https://github.com/square/javapoet/archive/javapoet-" |
247 | version ".tar.gz")) |
248 | (file-name (string-append name "-" version ".tar.gz")) |
249 | (sha256 |
250 | (base32 |
251 | "0xpjbh8wcyj9yd9hb936ia5g6l2q1jlyqjvwcc290cwjrz7crb93")))) |
252 | (build-system ant-build-system) |
253 | (arguments |
254 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
255 | #:src-dir "src/main/java" |
256 | #:jdk ,icedtea-8 |
257 | #:tests? #f)) |
258 | (home-page "https://github.com/square/javapoet") |
259 | (synopsis "") |
260 | (description "") |
261 | (license license:asl2.0))) |
262 | |
263 | (define-public java-auto-value |
264 | (package |
265 | (name "java-auto-value") |
266 | (version "1.4.1") |
267 | (source (origin |
268 | (method url-fetch) |
269 | (uri (string-append "https://github.com/google/auto/archive/auto-value-" |
270 | version ".tar.gz")) |
271 | (file-name (string-append name "-" version ".tar.gz")) |
272 | (sha256 |
273 | (base32 |
274 | "1qd59bwa56bynsdxfbgm40i7ndrj599wflza214kzigk16nprc1m")))) |
275 | (build-system ant-build-system) |
276 | (arguments |
277 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
278 | #:src-dir "value/src/main/java:common/src/main/java:service/src/main/java" |
279 | #:jdk ,icedtea-8 |
280 | #:tests? #f)) |
281 | (inputs |
282 | `(("guava" ,java-guava) |
283 | ("javapoet" ,java-javapoet))) |
284 | (home-page "https://github.com/google/auto/tree/master/value") |
285 | (synopsis "") |
286 | (description "") |
287 | (license license:asl2.0))) |
288 | |
289 | ;; https://github.com/KengoTODA/java-diff-utils ? |
290 | ;; com.sun.tools.javac.code.Scope.LookupKind.NON_RECURSIVE |
291 | ;; com.sun.source.tree.PackageTree |
292 | ;; com.sun.tools.javac.tree.JCTree.JCPackageDecl |
293 | (define-public java-error-prone |
294 | (package |
295 | (name "java-error-prone") |
296 | (version "2.0.19") |
297 | (source (origin |
298 | (method url-fetch) |
299 | (uri (string-append "https://github.com/google/error-prone/archive/v" |
300 | version ".tar.gz")) |
301 | (file-name (string-append name "-" version ".tar.gz")) |
302 | (patches (search-patches "java-error-prone-add-build.xml.patch")) |
303 | (sha256 |
304 | (base32 |
305 | "00igy7a6aylswxdcklj9021g2s8bvsvrysagqyd8cibm4pimxrnk")))) |
306 | (build-system ant-build-system) |
307 | (arguments |
308 | `(#:tests? #f |
309 | #:jdk ,icedtea-8 |
310 | #:phases |
311 | (modify-phases %standard-phases |
312 | (add-before 'build 'copy-internal |
313 | (lambda _ |
314 | (mkdir-p "ant/src/main/java/com/google/errorprone/internal") |
315 | (copy-file |
316 | "core/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java" |
317 | "ant/src/main/java/com/google/errorprone/internal/NonDelegatingClassLoader.java")))))) |
318 | (inputs |
319 | `(("java-jsr305" ,java-jsr305) |
320 | ("java-auto-value" ,java-auto-value) |
321 | ("java-checker-framework" ,java-checker-framework) |
322 | ("java-guava" ,java-guava))) |
323 | (home-page "https://github.com/google/guava") |
324 | (synopsis "") |
325 | (description "") |
326 | (license license:asl2.0))) |
327 | |
328 | (define-public java-error-prone-annotations |
329 | (package |
330 | (inherit java-error-prone) |
331 | (name "java-error-prone-annotations") |
332 | (version "2.0.19") |
333 | (arguments |
334 | `(#:tests? #f |
335 | #:jar-name (string-append ,name "-" ,version ".jar") |
336 | #:src-dir "annotations/src")) |
337 | (inputs |
338 | `(("java-jsr305" ,java-jsr305))))) |
339 | |
340 | (define-public java-j2objc |
341 | (package |
342 | (name "java-j2objc") |
343 | (version "1.3.1") |
344 | (source (origin |
345 | (method url-fetch) |
346 | (uri (string-append "https://github.com/google/j2objc/archive/" |
347 | version ".tar.gz")) |
348 | (file-name (string-append name "-" version ".tar.gz")) |
349 | (patches (search-patches "java-j2objc-add-build.xml.patch")) |
350 | (sha256 |
351 | (base32 |
352 | "0d5spbr1whw2afg6mknyr7ifm6xivn3bbvnzjxva2zzkyq944hv0")))) |
353 | (build-system ant-build-system) |
354 | (arguments |
355 | `(#:tests? #f)) |
356 | (home-page "http://j2objc.org") |
357 | (synopsis "") |
358 | (description "") |
359 | (license license:asl2.0))) |
360 | |
361 | (define-public java-j2objc-annotations |
362 | (package |
363 | (inherit java-j2objc) |
364 | (name "java-j2objc-annotations") |
365 | (version "1.3.1") |
366 | (arguments |
367 | `(#:tests? #f |
368 | #:jar-name (string-append ,name "-" ,version ".jar") |
369 | #:src-dir "annotations/src/main/java")))) |
370 | |
371 | (define-public java-animal-sniffer |
372 | (package |
373 | (name "java-animal-sniffer") |
374 | (version "1.15") |
375 | (source (origin |
376 | (method url-fetch) |
377 | (uri (string-append "https://github.com/mojohaus/animal-sniffer/" |
378 | "archive/animal-sniffer-parent-" |
379 | version ".tar.gz")) |
380 | (patches (search-patches "java-animal-sniffer-add-build.xml.patch")) |
381 | (file-name (string-append name "-" version ".tar.gz")) |
382 | (sha256 |
383 | (base32 |
384 | "1350yl003y1fjzdwis0dg5jhi5kggk2sxnkv9821z5janw4p986m")))) |
385 | (build-system ant-build-system) |
386 | (arguments |
387 | `(#:tests? #f)) |
388 | (home-page "http://www.mojohaus.org/animal-sniffer") |
389 | (synopsis "") |
390 | (description "") |
391 | (license license:asl2.0))) |
392 | |
393 | (define-public java-animal-sniffer-annotations |
394 | (package |
395 | (inherit java-animal-sniffer) |
396 | (name "java-animal-sniffer-annotations") |
397 | (version "1.15") |
398 | (arguments |
399 | `(#:tests? #f |
400 | #:jar-name (string-append ,name "-" ,version ".jar") |
401 | #:src-dir "animal-sniffer-annotations/src/main/java")))) |
402 | |
403 | (define-public java-guava |
404 | (package |
405 | (name "java-guava") |
406 | (version "20.0") |
407 | (source (origin |
408 | (method url-fetch) |
409 | (uri (string-append "https://github.com/google/guava/archive/v" |
410 | version ".tar.gz")) |
411 | (file-name (string-append name "-" version ".tar.gz")) |
412 | (sha256 |
413 | (base32 |
414 | "1kasavj973iblj1fj35gzbywhkljrnbjpymgqyqaibbbmmbzff8s")))) |
415 | (build-system ant-build-system) |
416 | (arguments |
417 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
418 | #:src-dir "guava/src" |
419 | #:tests? #f)) |
420 | (inputs |
421 | `(("java-jsr305" ,java-jsr305) |
422 | ("java-j2objc-annotations" ,java-j2objc-annotations) |
423 | ("java-animal-sniffer-annotations" ,java-animal-sniffer-annotations) |
424 | ("java-error-prone-annotations" ,java-error-prone-annotations))) |
425 | (home-page "https://github.com/google/guava") |
426 | (synopsis "") |
427 | (description "") |
428 | (license license:asl2.0))) |
429 | |
430 | (define-public java-joda-convert |
431 | (package |
432 | (name "java-joda-convert") |
433 | (version "1.8.1") |
434 | (source (origin |
435 | (method url-fetch) |
436 | (uri (string-append "https://github.com/JodaOrg/joda-convert/archive/v" |
437 | version ".tar.gz")) |
438 | (file-name (string-append name "-" version ".tar.gz")) |
439 | (sha256 |
440 | (base32 |
441 | "1di9chp0pgvd2gxsmdaxhldwns9a2ss9705jmn97mdd69cg5zcnc")))) |
442 | (build-system ant-build-system) |
443 | (arguments |
444 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
445 | #:src-dir "src/main/java" |
446 | #:tests? #f)) |
447 | (inputs |
448 | `(("java-google-collect" ,java-google-collect))) |
449 | (native-inputs |
450 | `(("junit" ,java-junit))) |
451 | (home-page "") |
452 | (synopsis "") |
453 | (description "") |
454 | (license license:asl2.0))) |
455 | |
456 | (define-public java-joda-time |
457 | (package |
458 | (name "java-joda-time") |
459 | (version "2.9.9") |
460 | (source (origin |
461 | (method url-fetch) |
462 | (uri (string-append "https://github.com/JodaOrg/joda-time/archive/v" |
463 | version ".tar.gz")) |
464 | (file-name (string-append name "-" version ".tar.gz")) |
465 | (sha256 |
466 | (base32 |
467 | "1i9x91mi7yg2pasl0k3912f1pg46n37sps6rdb0v1gs8hj9ppwc1")))) |
468 | (build-system ant-build-system) |
469 | (arguments |
470 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
471 | #:src-dir "src/main/java" |
472 | #:tests? #f)) |
473 | (inputs |
474 | `(("java-joda-convert" ,java-joda-convert))) |
475 | (native-inputs |
476 | `(("junit" ,java-junit))) |
477 | (home-page "") |
478 | (synopsis "") |
479 | (description "") |
480 | (license license:asl2.0))) |
481 | |
482 | (define-public java-xstream |
483 | (package |
484 | (name "java-xstream") |
485 | (version "1.4.9") |
486 | (source (origin |
487 | (method url-fetch) |
488 | (uri (string-append "https://repo1.maven.org/maven2/com/thoughtworks" |
489 | "/xstream/xstream-distribution/" version |
490 | "/xstream-distribution-" version "-src.zip")) |
491 | (file-name (string-append name "-" version ".zip")) |
492 | (sha256 |
493 | (base32 |
494 | "1cq9j9h839wc6pkrgd9bd7y94a3zrj1j741i134izqs9xx2b54fi")))) |
495 | (build-system ant-build-system) |
496 | (arguments |
497 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
498 | #:tests? #f |
499 | #:src-dir "xstream/src/java")) |
500 | (native-inputs |
501 | `(("unzip" ,unzip))) |
502 | (home-page "https://x-stream.github.io") |
503 | (synopsis "") |
504 | (description "") |
505 | (license license:x11))) |
506 | |
507 | (define-public java-jsonp |
508 | (package |
509 | (name "java-jsonp") |
510 | (version "1.0.4") |
511 | (source (origin |
512 | (method git-fetch) |
513 | (uri (git-reference |
514 | (url "git://java.net/jsonp~git") |
515 | (commit "a586e706aea82dc80fb05bdf59f2a25150ee1801"))) |
516 | (file-name (string-append name "-" version)) |
517 | (sha256 |
518 | (base32 |
519 | "01r4syivcywpvxkr1hn0az9316pr7qpnx154zzzw0nijfmdlbw7n")))) |
520 | (build-system ant-build-system) |
521 | (arguments |
522 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
523 | #:tests? #f |
524 | #:src-dir "api/src")) |
525 | (home-page "https://jsonp.java.net") |
526 | (synopsis "") |
527 | (description "") |
528 | (license (list license:gpl2 |
529 | ;; actually CDDL 1.1 |
530 | license:cddl1.0)))) |
531 | |
532 | ;; Can only be built with gradle. |
533 | (define-public groovy |
534 | (package |
535 | (name "groovy") |
536 | (version "2.4.10") |
537 | (source (origin |
538 | (method url-fetch) |
539 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
540 | "2_4_10.tar.gz")) |
541 | (file-name (string-append name "-" version ".tar.gz")) |
542 | (sha256 |
543 | (base32 |
544 | "0wapzqwpx4bh2fsqpzf3haakjz6wvfjx1vd9a4spavhlrjqk2pbb")))) |
545 | (build-system ant-build-system) |
546 | (arguments |
547 | `(#:jar-name "groovy.jar" |
548 | #:tests? #f)) |
549 | (native-inputs |
550 | `(("junit" ,java-junit))) |
551 | (inputs |
552 | `(("commons-cli" ,java-commons-cli) |
553 | ("antlr" ,antlr3) |
554 | ("asm" ,java-asm))) |
555 | (home-page "") |
556 | (synopsis "") |
557 | (description "") |
558 | (license license:asl2.0))) |
559 | |
560 | ;; requires jline, javax.servlet, org.fusesource.jansi, org.livetribe, |
561 | ;; com.thoughtworks.xstream, org.apache.ivy, bsf |
562 | ;; antlr |
563 | (define-public groovy-1.8.9 |
564 | (package |
565 | (inherit groovy) |
566 | (name "groovy") |
567 | (version "1.8.9") |
568 | (source (origin |
569 | (method url-fetch) |
570 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
571 | "1_8_9.tar.gz")) |
572 | (file-name (string-append name "-" version ".tar.gz")) |
573 | (sha256 |
574 | (base32 |
575 | "16z3jv5yw11wwwzbs6x41g83gqazhngg30ys2kpy7cpfm3rsqi71")))) |
576 | (arguments |
577 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
578 | #:tests? #f |
579 | #:src-dir "src/main")))) |
580 | |
581 | |
582 | ;; antlr2 is used to generate some java files in other packages. This is an old |
583 | ;; package, it is not maintained anymore. It also contains the definition |
584 | ;; for CommonTree and maybe other classes, so it is still required by more |
585 | ;; recent antlr versions. |
586 | ;; |
587 | ;; antlr3.5 requires an antlr3 generator and ST4. Unfortunately, ST4 requires |
588 | ;; an antlr3 generator. We use antlr3-3.1 that can be built with ST3 and antlr2 |
589 | ;; to build the intermediate antlr3-3.3 that requires only an antlr3 generator. |
590 | ;; This intermediate antlr3 is used to build a version of ST4 that do not depend |
591 | ;; on recent antlr3. Then this version is used to build the latest antlr3, |
592 | ;; which is used to build the latest ST4, which is used as a dependency of the |
593 | ;; latest antlr3. |
594 | ;; |
595 | ;; Then we can use the latest versions of ST4 and antlr3 to build antlr4. |
596 | (define-public antlr2 |
597 | (package |
598 | (name "antlr2") |
599 | (version "2.7.7") |
600 | (source (origin |
601 | (method url-fetch) |
602 | (uri (string-append "http://www.antlr2.org/download/antlr-" |
603 | version ".tar.gz")) |
604 | (sha256 |
605 | (base32 |
606 | "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5")) |
607 | (modules '((guix build utils))) |
608 | (snippet |
609 | '(begin |
610 | (delete-file "antlr.jar") |
611 | (substitute* "configure" |
612 | (("/bin/sh") "sh")))))) |
613 | (build-system gnu-build-system) |
614 | (arguments |
615 | `(#:tests? #f |
616 | #:phases |
617 | (modify-phases %standard-phases |
618 | (add-after 'configure 'fix-bin-ls |
619 | (lambda _ |
620 | (for-each (lambda (file) |
621 | (substitute* file |
622 | (("/bin/ls") "ls"))) |
623 | (find-files "Makefile"))))))) |
624 | (native-inputs |
625 | `(("which" ,which) |
626 | ("java" ,icedtea "jdk"))) |
627 | (propagated-inputs |
628 | `(("java" ,icedtea "jdk"))) |
629 | (inputs |
630 | `(("java" ,icedtea))) |
631 | (home-page "http://www.antlr2.org") |
632 | (synopsis "") |
633 | (description "") |
634 | (license license:public-domain))) |
635 | |
636 | (define-public stringtemplate3 |
637 | (package |
638 | (name "stringtemplate3") |
639 | (version "3.2.1") |
640 | (source (origin |
641 | (method url-fetch) |
642 | (uri (string-append "https://github.com/antlr/website-st4/raw/" |
643 | "gh-pages/download/stringtemplate-" |
644 | version ".tar.gz")) |
645 | (sha256 |
646 | (base32 |
647 | "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is")))) |
648 | (build-system ant-build-system) |
649 | (arguments |
650 | `(#:jar-name "stringtemplate-3.2.1.jar" |
651 | #:tests? #f |
652 | #:phases |
653 | (modify-phases %standard-phases |
654 | (add-before 'build 'generate-grammar |
655 | (lambda _ |
656 | (let ((dir "src/org/antlr/stringtemplate/language/")) |
657 | (for-each (lambda (file) |
658 | (display file) |
659 | (newline) |
660 | (system* "antlr" "-o" dir (string-append dir file))) |
661 | '("template.g" "angle.bracket.template.g" "action.g" |
662 | "eval.g" "group.g" "interface.g")))))))) |
663 | (native-inputs |
664 | `(("antlr" ,antlr2))) |
665 | (home-page "http://www.stringtemplate.org") |
666 | (synopsis "") |
667 | (description "") |
668 | (license license:bsd-3))) |
669 | |
670 | (define-public antlr3-temp |
671 | (package |
672 | (name "antlr3-temp") |
673 | (version "3.5.2") |
674 | (source (origin |
675 | (method url-fetch) |
676 | (uri (string-append "https://github.com/antlr/antlr3/archive/" |
677 | version ".tar.gz")) |
678 | (file-name (string-append name "-" version ".tar.gz")) |
679 | (sha256 |
680 | (base32 |
681 | "07zff5frmjd53rnqdx31h0pmswz1lv0p2lp28cspfszh25ysz6sj")))) |
682 | (build-system ant-build-system) |
683 | (arguments |
684 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
685 | #:src-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" |
686 | #:tests? #f |
687 | #:phases |
688 | (modify-phases %standard-phases |
689 | (add-after 'install 'bin-install |
690 | (lambda* (#:key inputs outputs #:allow-other-keys) |
691 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
692 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
693 | (mkdir-p bin) |
694 | (with-output-to-file (string-append bin "/antlr3") |
695 | (lambda _ |
696 | (display |
697 | (string-append "#!/bin/sh\n" |
698 | "java -cp " jar "/" ,name "-" ,version ".jar:" |
699 | (string-concatenate |
700 | (find-files (assoc-ref inputs "stringtemplate") |
701 | ".*\\.jar")) |
702 | ":" |
703 | (string-concatenate |
704 | (find-files (assoc-ref inputs "stringtemplate4") |
705 | ".*\\.jar")) |
706 | ":" |
707 | (string-concatenate |
708 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
709 | ".*\\.jar")) |
710 | " org.antlr.Tool $*")))) |
711 | (chmod (string-append bin "/antlr3") #o755)))) |
712 | (add-before 'build 'generate-grammar |
713 | (lambda _ |
714 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
715 | (for-each (lambda (file) |
716 | (display file) |
717 | (newline) |
718 | (system* "antlr3" file)) |
719 | '("ANTLR.g" "ANTLRTreePrinter.g" "ActionAnalysis.g" |
720 | "AssignTokenTypesWalker.g" |
721 | "ActionTranslator.g" "TreeToNFAConverter.g" |
722 | "ANTLRv3.g" "ANTLRv3Tree.g" "LeftRecursiveRuleWalker.g" |
723 | "CodeGenTreeWalker.g" "DefineGrammarItemsWalker.g")) |
724 | (chdir "../../../../../../../..") |
725 | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" |
726 | "tool/src/main/java/org/antlr/tool/serialize.g") |
727 | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" |
728 | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; |
729 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
730 | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" |
731 | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) |
732 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" |
733 | (("public Object getTree") "public GrammarAST getTree")) |
734 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" |
735 | (("public Object getTree") "public CommonTree getTree")))) |
736 | (add-before 'build 'fix-build-xml |
737 | (lambda _ |
738 | (substitute* "build.xml" |
739 | (("<exec") "<copy todir=\"${classes.dir}\"> |
740 | <fileset dir=\"tool/src/main/resources\"> |
741 | <include name=\"**/*.stg\"/> |
742 | <include name=\"**/*.st\"/> |
743 | <include name=\"**/*.sti\"/> |
744 | <include name=\"**/STLexer.tokens\"/> |
745 | </fileset> |
746 | </copy><exec"))))))) |
747 | (native-inputs |
748 | `(("antlr" ,antlr2) |
749 | ("antlr3" ,antlr3-3.3))) |
750 | (inputs |
751 | `(("junit" ,java-junit))) |
752 | (propagated-inputs |
753 | `(("stringtemplate" ,stringtemplate3) |
754 | ("antlr" ,antlr2) |
755 | ("stringtemplate4" ,stringtemplate4-4.0.6))) |
756 | (home-page "http://www.stringtemplate.org") |
757 | (synopsis "") |
758 | (description "") |
759 | (license license:bsd-3))) |
760 | |
761 | (define-public antlr3 |
762 | (package |
763 | (inherit antlr3-temp) |
764 | (name "antlr3") |
765 | (native-inputs |
766 | `(("antlr" ,antlr2) |
767 | ("antlr3" ,antlr3-temp))) |
768 | (inputs |
769 | `(("junit" ,java-junit) |
770 | ("stringtemplate" ,stringtemplate3) |
771 | ("stringtemplate4" ,stringtemplate4))))) |
772 | |
773 | (define-public antlr3-3.4 |
774 | (package |
775 | (name "antlr3") |
776 | (version "3.4") |
777 | (source (origin |
778 | (method url-fetch) |
779 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
780 | "gh-pages/download/antlr-" |
781 | version ".tar.gz")) |
782 | (sha256 |
783 | (base32 |
784 | "1cwfswpk3jlzl1dhc6b6586srza8q0bbzwlxcq136p29v62fjrb3")))) |
785 | (build-system ant-build-system) |
786 | (arguments |
787 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
788 | #:src-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr3" |
789 | #:tests? #f |
790 | #:phases |
791 | (modify-phases %standard-phases |
792 | (add-after 'install 'bin-install |
793 | (lambda* (#:key inputs outputs #:allow-other-keys) |
794 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
795 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
796 | (mkdir-p bin) |
797 | (with-output-to-file (string-append bin "/antlr3") |
798 | (lambda _ |
799 | (display |
800 | (string-append "#!/bin/sh\n" |
801 | "java -cp " jar "/antlr3-3.3.jar:" |
802 | (string-concatenate |
803 | (find-files (assoc-ref inputs "stringtemplate") |
804 | ".*\\.jar")) |
805 | ":" |
806 | (string-concatenate |
807 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
808 | ".*\\.jar")) |
809 | " org.antlr.Tool $*")))) |
810 | (chmod (string-append bin "/antlr3") #o755)))) |
811 | (add-before 'build 'generate-grammar |
812 | (lambda _ |
813 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
814 | (for-each (lambda (file) |
815 | (display file) |
816 | (newline) |
817 | (system* "antlr3" file)) |
818 | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLR.g" |
819 | "ANTLRTreePrinter.g" "ANTLRv3.g" "ANTLRv3Tree.g" |
820 | "AssignTokenTypesWalker.g" "CodeGenTreeWalker.g" |
821 | "DefineGrammarItemsWalker.g" "LeftRecursiveRuleWalker.g" |
822 | "TreeToNFAConverter.g")) |
823 | (chdir "../../../../../../../..") |
824 | (system* "antlr" "-o" "tool/src/main/java/org/antlr/tool" |
825 | "tool/src/main/java/org/antlr/tool/serialize.g") |
826 | (substitute* "tool/src/main/java/org/antlr/tool/LeftRecursiveRuleAnalyzer.java" |
827 | (("import org.antlr.grammar.v3.\\*;") "import org.antlr.grammar.v3.*; |
828 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
829 | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" |
830 | (("import org.antlr.grammar.v3.\\*;") |
831 | "import org.antlr.grammar.v3.*;\n |
832 | import org.antlr.grammar.v3.TreeToNFAConverter;\n |
833 | import org.antlr.grammar.v3.DefineGrammarItemsWalker;\n |
834 | import org.antlr.grammar.v3.ANTLRTreePrinter;")) |
835 | (substitute* "tool/src/main/java/org/antlr/tool/ErrorManager.java" |
836 | (("case NO_SUCH_ATTRIBUTE_PASS_THROUGH:") "")) |
837 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRParser.java" |
838 | (("public Object getTree") "public GrammarAST getTree")) |
839 | (substitute* "tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3Parser.java" |
840 | (("public Object getTree") "public CommonTree getTree")))) |
841 | (add-before 'build 'fix-build-xml |
842 | (lambda _ |
843 | (substitute* "build.xml" |
844 | (("<exec") "<copy todir=\"${classes.dir}\"> |
845 | <fileset dir=\"tool/src/main/resources\"> |
846 | <include name=\"**/*.stg\"/> |
847 | <include name=\"**/*.st\"/> |
848 | <include name=\"**/*.sti\"/> |
849 | <include name=\"**/STLexer.tokens\"/> |
850 | </fileset> |
851 | </copy><exec"))))))) |
852 | (native-inputs |
853 | `(("antlr" ,antlr2) |
854 | ("antlr3" ,antlr3-3.3))) |
855 | (inputs |
856 | `(("junit" ,java-junit))) |
857 | (propagated-inputs |
858 | `(("stringtemplate" ,stringtemplate3) |
859 | ("stringtemplate4" ,stringtemplate4) |
860 | ("antlr" ,antlr2) |
861 | ("antlr3" ,antlr3-3.1))) |
862 | (home-page "http://www.stringtemplate.org") |
863 | (synopsis "") |
864 | (description "") |
865 | (license license:bsd-3))) |
866 | |
867 | (define-public libantlr3c |
868 | (package |
869 | (inherit antlr3) |
870 | (name "libantlr3c") |
871 | (build-system gnu-build-system) |
872 | (native-inputs |
873 | `(("autoconf" ,autoconf) |
874 | ("automake" ,automake) |
875 | ("libtool" ,libtool))) |
876 | (propagated-inputs |
877 | `(("antlr" ,antlr3))) |
878 | (arguments |
879 | `(#:configure-flags (list "--enable-64bit" "--disable-static") |
880 | #:phases |
881 | (modify-phases %standard-phases |
882 | (add-before 'configure 'autoreconf |
883 | (lambda _ |
884 | (chdir "runtime/C") |
885 | (system* "libtoolize") |
886 | (system* "autoreconf" "-fiv")))))))) |
887 | |
888 | (define-public antlr3-3.3 |
889 | (package |
890 | (name "antlr3") |
891 | (version "3.3") |
892 | (source (origin |
893 | (method url-fetch) |
894 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
895 | "gh-pages/download/antlr-" |
896 | version ".tar.gz")) |
897 | (sha256 |
898 | (base32 |
899 | "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m")))) |
900 | (build-system ant-build-system) |
901 | (arguments |
902 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
903 | #:src-dir "tool/src/main/java:runtime/Java/src/main/java:tool/src/main/antlr2:tool/src/main/antlr3" |
904 | #:tests? #f |
905 | #:phases |
906 | (modify-phases %standard-phases |
907 | (add-after 'install 'bin-install |
908 | (lambda* (#:key inputs outputs #:allow-other-keys) |
909 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
910 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
911 | (mkdir-p bin) |
912 | (with-output-to-file (string-append bin "/antlr3") |
913 | (lambda _ |
914 | (display |
915 | (string-append "#!/bin/sh\n" |
916 | "java -cp " jar "/antlr3-3.3.jar:" |
917 | (string-concatenate |
918 | (find-files (assoc-ref inputs "stringtemplate") |
919 | ".*\\.jar")) |
920 | ":" |
921 | (string-concatenate |
922 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
923 | ".*\\.jar")) |
924 | " org.antlr.Tool $*")))) |
925 | (chmod (string-append bin "/antlr3") #o755)))) |
926 | (add-before 'build 'generate-grammar |
927 | (lambda _ |
928 | (let ((dir "tool/src/main/antlr2/org/antlr/grammar/v2/")) |
929 | (for-each (lambda (file) |
930 | (display file) |
931 | (newline) |
932 | (system* "antlr" "-o" dir (string-append dir file))) |
933 | '("antlr.g" "antlr.print.g" "assign.types.g" |
934 | "buildnfa.g" "codegen.g" "define.g"))) |
935 | (chdir "tool/src/main/antlr3/org/antlr/grammar/v3/") |
936 | (for-each (lambda (file) |
937 | (display file) |
938 | (newline) |
939 | (system* "antlr3" file)) |
940 | '("ActionAnalysis.g" "ActionTranslator.g" "ANTLRv3.g" |
941 | "ANTLRv3Tree.g")) |
942 | (chdir "../../../../../../../..") |
943 | (substitute* "tool/src/main/java/org/antlr/tool/Grammar.java" |
944 | (("import org.antlr.grammar.v2.\\*;") |
945 | "import org.antlr.grammar.v2.*;\n |
946 | import org.antlr.grammar.v2.TreeToNFAConverter;\n |
947 | import org.antlr.grammar.v2.DefineGrammarItemsWalker;\n |
948 | import org.antlr.grammar.v2.ANTLRTreePrinter;")))) |
949 | (add-before 'build 'fix-build-xml |
950 | (lambda _ |
951 | (substitute* "build.xml" |
952 | (("<exec") "<copy todir=\"${classes.dir}\"> |
953 | <fileset dir=\"tool/src/main/resources\"> |
954 | <include name=\"**/*.stg\"/> |
955 | <include name=\"**/*.st\"/> |
956 | <include name=\"**/*.sti\"/> |
957 | <include name=\"**/STLexer.tokens\"/> |
958 | </fileset> |
959 | </copy><exec"))))))) |
960 | (native-inputs |
961 | `(("antlr" ,antlr2) |
962 | ("antlr3" ,antlr3-3.1))) |
963 | (inputs |
964 | `(("junit" ,java-junit))) |
965 | (propagated-inputs |
966 | `(("stringtemplate" ,stringtemplate3) |
967 | ("antlr" ,antlr2) |
968 | ("antlr3" ,antlr3-3.1))) |
969 | (home-page "http://www.stringtemplate.org") |
970 | (synopsis "") |
971 | (description "") |
972 | (license license:bsd-3))) |
973 | |
974 | (define-public antlr3-3.1 |
975 | (package |
976 | (name "antlr3-3.1") |
977 | (version "3.1") |
978 | (source (origin |
979 | (method url-fetch) |
980 | (uri (string-append "https://github.com/antlr/website-antlr3/raw/" |
981 | "gh-pages/download/antlr-" |
982 | version ".tar.gz")) |
983 | (sha256 |
984 | (base32 |
985 | "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z")))) |
986 | (build-system ant-build-system) |
987 | (arguments |
988 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
989 | #:src-dir "src:runtime/Java/src" |
990 | #:tests? #f |
991 | #:phases |
992 | (modify-phases %standard-phases |
993 | (add-after 'install 'bin-install |
994 | (lambda* (#:key inputs outputs #:allow-other-keys) |
995 | (let ((jar (string-append (assoc-ref outputs "out") "/share/java")) |
996 | (bin (string-append (assoc-ref outputs "out") "/bin"))) |
997 | (mkdir-p bin) |
998 | (with-output-to-file (string-append bin "/antlr3") |
999 | (lambda _ |
1000 | (display |
1001 | (string-append "#!/bin/sh\n" |
1002 | "java -cp " jar "/antlr3-3.1-3.1.jar:" |
1003 | (string-concatenate |
1004 | (find-files (assoc-ref inputs "stringtemplate") |
1005 | ".*\\.jar")) |
1006 | ":" |
1007 | (string-concatenate |
1008 | (find-files (string-append (assoc-ref inputs "antlr") "/lib") |
1009 | ".*\\.jar")) |
1010 | " org.antlr.Tool $*")))) |
1011 | (chmod (string-append bin "/antlr3") #o755)))) |
1012 | (add-before 'build 'generate-grammar |
1013 | (lambda _ |
1014 | (let ((dir "src/org/antlr/tool/")) |
1015 | (for-each (lambda (file) |
1016 | (display file) |
1017 | (newline) |
1018 | (system* "antlr" "-o" dir (string-append dir file))) |
1019 | '("antlr.g" "antlr.print.g" "assign.types.g" |
1020 | "buildnfa.g" "define.g"))) |
1021 | (format #t "codegen.g\n") |
1022 | (system* "antlr" "-o" "src/org/antlr/codegen" |
1023 | "src/org/antlr/codegen/codegen.g"))) |
1024 | (add-before 'build 'fix-build-xml |
1025 | (lambda _ |
1026 | (substitute* "build.xml" |
1027 | (("<exec") "<copy todir=\"${classes.dir}\"> |
1028 | <fileset dir=\"src\"> |
1029 | <include name=\"**/*.stg\"/> |
1030 | <include name=\"**/*.st\"/> |
1031 | <include name=\"**/*.sti\"/> |
1032 | <include name=\"**/STLexer.tokens\"/> |
1033 | </fileset> |
1034 | </copy><exec"))))))) |
1035 | (native-inputs |
1036 | `(("antlr" ,antlr2))) |
1037 | (inputs |
1038 | `(("junit" ,java-junit))) |
1039 | (propagated-inputs |
1040 | `(("stringtemplate" ,stringtemplate3))) |
1041 | (home-page "http://www.stringtemplate.org") |
1042 | (synopsis "") |
1043 | (description "") |
1044 | (license license:bsd-3))) |
1045 | |
1046 | (define-public stringtemplate4-4.0.6 |
1047 | (package |
1048 | (name "stringtemplate4") |
1049 | (version "4.0.6") |
1050 | (source (origin |
1051 | (method url-fetch) |
1052 | (uri (string-append "https://github.com/antlr/stringtemplate4/archive/ST-" |
1053 | version ".tar.gz")) |
1054 | (file-name (string-append name "-" version ".tar.gz")) |
1055 | (sha256 |
1056 | (base32 |
1057 | "0hjmh1ahdsh3w825i67mli9l4nncc4l6hdbf9ma91jvlj590sljp")))) |
1058 | (build-system ant-build-system) |
1059 | (arguments |
1060 | `(#:tests? #f |
1061 | #:jar-name (string-append ,name "-" ,version ".jar") |
1062 | #:phases |
1063 | (modify-phases %standard-phases |
1064 | (add-before 'build 'generate-grammar |
1065 | (lambda* (#:key inputs #:allow-other-keys) |
1066 | (chdir "src/org/stringtemplate/v4/compiler/") |
1067 | (for-each (lambda (file) |
1068 | (display file) |
1069 | (newline) |
1070 | (system* "antlr3" file)) |
1071 | '("STParser.g" "Group.g" "CodeGenerator.g")) |
1072 | (chdir "../../../../..")))))) |
1073 | (inputs |
1074 | `(("antlr3" ,antlr3-3.3) |
1075 | ("antlr2" ,antlr2) |
1076 | ("stringtemplate" ,stringtemplate3))) |
1077 | (home-page "http://www.stringtemplate.org") |
1078 | (synopsis "") |
1079 | (description "") |
1080 | (license license:bsd-3))) |
1081 | |
1082 | (define-public stringtemplate4 |
1083 | (package |
1084 | (inherit stringtemplate4-4.0.6) |
1085 | (name "stringtemplate4") |
1086 | (version "4.0.8") |
1087 | (source (origin |
1088 | (method url-fetch) |
1089 | (uri (string-append "https://github.com/antlr/stringtemplate4/archive/" |
1090 | version ".tar.gz")) |
1091 | (file-name (string-append name "-" version ".tar.gz")) |
1092 | (sha256 |
1093 | (base32 |
1094 | "1pri8hqa95rfdkjy55icl5q1m09zwp5k67ib14abas39s4v3w087")))) |
1095 | (inputs |
1096 | `(("antlr3" ,antlr3-temp) |
1097 | ("antlr2" ,antlr2) |
1098 | ("stringtemplate" ,stringtemplate3))))) |
1099 | |
1100 | ;; javax.json.* |
1101 | ;; org.abego.treelayout.* |
1102 | ;; com.ibm.icu.* |
1103 | (define-public antlr4 |
1104 | (package |
1105 | (name "antlr4") |
1106 | (version "4.7") |
1107 | (source (origin |
1108 | (method url-fetch) |
1109 | (uri (string-append "https://github.com/antlr/antlr4/archive/" |
1110 | version ".tar.gz")) |
1111 | (file-name (string-append name "-" version ".tar.gz")) |
1112 | (sha256 |
1113 | (base32 |
1114 | "0y7lzkvx9wbbmwg45mb4icx7i66z6894qfygrbbs26sr5xxyml9h")))) |
1115 | (build-system ant-build-system) |
1116 | (arguments |
1117 | `(#:jar-name (string-append ,name "-" ,version ".jar") |
1118 | #:src-dir "runtime/Java/src:tool/src" |
1119 | #:phases |
1120 | (modify-phases %standard-phases |
1121 | (add-before 'build 'generate-grammar |
1122 | (lambda* (#:key inputs #:allow-other-keys) |
1123 | (chdir "tool/src/org/antlr/v4/parse") |
1124 | (for-each (lambda (file) |
1125 | (format #t "~a\n" file) |
1126 | (system* "antlr3" file)) |
1127 | '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g" |
1128 | "GrammarTreeVisitor.g" "ATNBuilder.g" |
1129 | "ActionSplitter.g" "LeftRecursiveRuleWalker.g")) |
1130 | (chdir "../codegen") |
1131 | (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens") |
1132 | (format #t "SourceGenTriggers.g\n") |
1133 | (system* "antlr3" "SourceGenTriggers.g") |
1134 | (chdir "../../../../../..")))))) |
1135 | (inputs |
1136 | `(("antlr3" ,antlr3) |
1137 | ("icu4j" ,java-icu4j) |
1138 | ("java-jsonp" ,java-jsonp) |
1139 | ("treelayout" ,java-treelayout) |
1140 | ("stringtemplate4" ,stringtemplate4))) |
1141 | (home-page "https://antlr.org") |
1142 | (synopsis "") |
1143 | (description "") |
1144 | (license license:bsd-3))) |
1145 | |
1146 | |
1147 | ;; requires groovy 2.4.7. |
1148 | ;(define-public gradle |
1149 | ; (package |
1150 | ; (name "gradle") |
1151 | ; (version "3.4.1") |
1152 | ; (source (origin |
1153 | ; (method url-fetch) |
1154 | ; (uri (string-append "https://github.com/gradle/gradle/archive/v" |
1155 | ; version ".tar.gz")) |
1156 | ; (file-name (string-append name "-" version ".tar.gz")) |
1157 | ; (sha256 |
1158 | ; (base32 "0fq30k51mkixg31z3d4fjq3zbnyjml4i530px6n1n947mqk3rgyl")))) |
1159 | ; (build-system ant-build-system) |
1160 | ; (arguments |
1161 | ; `(#:phases |
1162 | ; (modify-phases %standard-phases |
1163 | ; (replace 'build |
1164 | ; (lambda* _ |
1165 | ; (system* "sh" "-x" "gradlew" "prBuild" "-x" "integTest" "--continue" |
1166 | ; "--stacktrace")))))) |
1167 | ; ;(system* "sh" "-x" "travisci_build.sh")))))) |
1168 | ; (home-page "") |
1169 | ; (synopsis "Build system") |
1170 | ; (description "Build system") |
1171 | ; (license license:asl2.0))) |
1172 | ; |
1173 | ;;; Requires gradle. |
1174 | ;(define-public android-anysoft-keyboard |
1175 | ; (package |
1176 | ; (name "android-anysoft-keyboard") |
1177 | ; (version "1.8-r9") |
1178 | ; (source (origin |
1179 | ; (method url-fetch) |
1180 | ; (uri (string-append "https://github.com/AnySoftKeyboard/" |
1181 | ; "AnySoftKeyboard/archive/" version ".tar.gz")) |
1182 | ; (file-name (string-append name "-" version ".tar.gz")) |
1183 | ; (sha256 |
1184 | ; (base32 |
1185 | ; "1mrin9mw1rs23d25v8yx4jprx7j05zir6756sqvk4myxbkcp8mag")))) |
1186 | ; (build-system ant-build-system) |
1187 | ; (home-page "https://anysoftkeyboard.github.io/") |
1188 | ; (synopsis "Alternative on-screen keyboard for multiple languages") |
1189 | ; (description "Alternative on-screen keyboard for multiple languages.") |
1190 | ; (license license:asl2.0))) |
1191 |