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