Work toward getting antlr4

Julien LepillerTue May 16 15:56:27+0200 2017

68bcd65

Work toward getting antlr4

more/packages/java.scm

442442
       #:source-dir "annotations/src/main/java"))
443443
    (synopsis "")
444444
    (description "")
445+
    (home-page "https://github.com/google/j2objc")
445446
    (license license:asl2.0)))
446447
447448
;; TODO: animal-sniffer-enforcer-rule and animal-sniffer-maven-plugin depend

609610
    (description "")
610611
    (license license:x11)))
611612
613+
;; vanished from the face of the earth :/
612614
(define-public java-jsonp
613615
  (package
614616
    (name "java-jsonp")

660662
    (home-page "")
661663
    (synopsis "")
662664
    (description "")
663-
    (license license:asl2.0)))
665+
    (license (list license:gpl2
666+
                   ;; actually CDDL 1.1
667+
                   license:cddl1.0))))
664668
665669
;; requires jline, javax.servlet, org.fusesource.jansi, org.livetribe,
666670
;;   com.thoughtworks.xstream, org.apache.ivy, bsf

799803
             (system* "libtoolize")
800804
             (system* "autoreconf" "-fiv"))))))))
801805
802-
;; javax.json.*
803-
;; org.abego.treelayout.*
804-
;; com.ibm.icu.*
805-
(define-public antlr4
806+
(define-public java-json
807+
  (package
808+
    (name "java-json")
809+
    (version "1.1.0-M2")
810+
    (source (origin
811+
              (method url-fetch)
812+
              (uri (string-append "https://repo1.maven.org/maven2/javax/json/"
813+
                                  "javax.json-api/" version "/javax.json-api-"
814+
                                  version "-sources.jar"))
815+
              (file-name (string-append name "-" version ".jar"))
816+
              (sha256
817+
               (base32
818+
                "0gam8w52xjbmfc1inviyajk36jnj3lg4bzwhw05iq52kadycy6v0"))))
819+
    (build-system ant-build-system)
820+
    (arguments
821+
     `(#:jar-name (string-append ,name "-" ,version ".jar")
822+
       #:tests? #f
823+
       #:jdk ,icedtea-8
824+
       #:source-dir "src"
825+
       #:phases
826+
       (modify-phases %standard-phases
827+
         (add-after 'unpack 'remove-module-info
828+
           (lambda _
829+
             (format #t "~a\n" (getcwd))
830+
             (delete-file "src/module-info.java"))))))
831+
    (home-page "")
832+
    (synopsis "")
833+
    (description "")
834+
    (license license:asl2.0)))
835+
836+
;; We still need one file to be generated with ST4.
837+
;; tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
838+
;; See https://github.com/kevinbirch/string-template-maven-plugin
839+
;; We should take this and adapt to get a standalone tool.
840+
(define-public java-antlr4
806841
  (package
807-
    (name "antlr4")
842+
    (name "java-antlr4")
808843
    (version "4.7")
809844
    (source (origin
810845
              (method url-fetch)

818853
    (arguments
819854
     `(#:jar-name (string-append ,name "-" ,version ".jar")
820855
       #:source-dir "runtime/Java/src:tool/src"
856+
       #:jdk ,icedtea-8
857+
       #:tests? #f
821858
       #:phases
822859
       (modify-phases %standard-phases
823860
         (add-before 'build 'generate-grammar
824861
           (lambda* (#:key inputs #:allow-other-keys)
825-
             (chdir "tool/src/org/antlr/v4/parse")
826-
             (for-each (lambda (file)
827-
                         (format #t "~a\n" file)
828-
                         (system* "antlr3" file))
829-
                       '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
830-
                         "GrammarTreeVisitor.g" "ATNBuilder.g"
831-
                         "ActionSplitter.g" "LeftRecursiveRuleWalker.g"))
832-
             (chdir "../codegen")
833-
             (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens")
834-
             (format #t "SourceGenTriggers.g\n")
835-
             (system* "antlr3" "SourceGenTriggers.g")
836-
             (chdir "../../../../../.."))))))
862+
             (with-directory-excursion "tool/src/org/antlr/v4/parse"
863+
               (for-each (lambda (file)
864+
                           (format #t "~a\n" file)
865+
                           (system* "antlr3" file))
866+
                         '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
867+
                           "GrammarTreeVisitor.g" "ATNBuilder.g"
868+
                           "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
869+
             (with-directory-excursion "tool/src/org/antlr/v4/codegen"
870+
               (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens")
871+
               (format #t "SourceGenTriggers.g\n")
872+
               (system* "antlr3" "SourceGenTriggers.g")))))))
837873
    (inputs
838874
     `(("antlr3" ,antlr3)
839875
       ("icu4j" ,java-icu4j)
840-
       ("java-jsonp" ,java-jsonp)
876+
       ("java-json" ,java-json)
841877
       ("treelayout" ,java-treelayout)
842878
       ("stringtemplate4" ,stringtemplate4)))
843879
    (home-page "https://antlr.org")

845881
    (description "")
846882
    (license license:bsd-3)))
847883
848-
849884
;; requires groovy 2.4.7.
850885
;(define-public gradle
851886
;  (package