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