java: remove groovy and improve antlr4

Julien LepillerWed Dec 13 23:34:10+0100 2017

7cfd9fb

java: remove groovy and improve antlr4

more/packages/java.scm

352352
       #:source-dir "spock-core/src/main/java"
353353
       #:tests? #f)); No tests
354354
    (inputs
355-
     `(("groovy-bootstrap" ,groovy-bootstrap)
355+
     `(("groovy" ,groovy)
356356
       ("java-asm" ,java-asm)
357357
       ("java-cglib" ,java-cglib)
358358
       ("java-hamcrest-core" ,java-hamcrest-core)

37723772
these scripting language engines.")
37733773
    (license license:asl2.0)))
37743774
3775-
;(define-public groovy
3776-
;  (package
3777-
;    (name "groovy")
3778-
;    (version "2.4.10")
3779-
;    (source (origin
3780-
;              (method url-fetch)
3781-
;              (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_"
3782-
;                                  "2_4_10.tar.gz"))
3783-
;              (file-name (string-append name "-" version ".tar.gz"))
3784-
;              (sha256
3785-
;               (base32
3786-
;                "15c9xmf7rhr5w4qk2jcb6swds336l4l5gyb51pcjay2ywnigk8sa"))
3787-
;              (patches
3788-
;                (search-patches
3789-
;                  "groovy-Add-exceptionutilsgenerator.patch"))))
3790-
;    (build-system ant-build-system)
3791-
;    (arguments
3792-
;     `(#:jar-name "groovy.jar"
3793-
;       #:source-dir "src/main:subprojects/groovy-test/src/main/java"
3794-
;       #:test-dir "src/test"
3795-
;       #:tests? #f
3796-
;       #:main-class "groovy.ui.GroovyMain"
3797-
;       #:phases
3798-
;       (modify-phases %standard-phases
3799-
;         (add-before 'build 'generate-parser
3800-
;           (lambda _
3801-
;             (with-directory-excursion "src/main/org/codehaus/groovy/antlr/java"
3802-
;               (zero? (system* "antlr" "java.g")))
3803-
;             (with-directory-excursion "src/main/org/codehaus/groovy/antlr"
3804-
;               (mkdir "parser")
3805-
;               (with-directory-excursion "parser"
3806-
;                 (zero? (system* "antlr" "../groovy.g"))))))
3807-
;         (add-before 'build 'generate-exception-utils
3808-
;           (lambda _
3809-
;             (system* "javac" "-cp" (getenv "CLASSPATH")
3810-
;                      "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java")
3811-
;             (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
3812-
;                                                         ":config/ant/src")
3813-
;                             "org.codehaus.groovy.ExceptionUtilsGenerator"
3814-
;                             "build/classes/org/codehaus/groovy/runtime/ExceptionUtils.class"))))
3815-
;         (add-after 'install 'install-sh
3816-
;           (lambda* (#:key outputs #:allow-other-keys)
3817-
;             (substitute* "src/bin/startGroovy"
3818-
;               ((" -classpath .*")
3819-
;                (string-append " -classpath " (getenv "CLASSPATH") ":"
3820-
;                               (assoc-ref outputs "out") "/share/java/groovy.jar \\")))
3821-
;             (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
3822-
;               (for-each (lambda (script)
3823-
;                           (install-file (string-append "src/bin/" script) bin)
3824-
;                           (chmod (string-append bin "/" script) #o755))
3825-
;                 '("grape" "groovy" "groovyc" "groovyConsole" "groovydoc"
3826-
;                   "groovysh" "java2groovy" "startGroovy")))
3827-
;             (install-file "src/conf/groovy-starter.conf"
3828-
;                           (string-append (assoc-ref outputs "out") "/conf"))
3829-
;             #t))
3830-
;         (add-before 'check 'add-groovy-classes
3831-
;           (lambda _
3832-
;             (substitute* "build.xml"
3833-
;               (("a") "a")))))))
3834-
;    (native-inputs
3835-
;     `(("java-junit" ,java-junit)
3836-
;       ("antlr2" ,antlr2)
3837-
;       ("java-jmock-1" ,java-jmock-1)
3838-
;       ("java-xmlunit-legacy" ,java-xmlunit-legacy)))
3839-
;    (inputs
3840-
;     `(("java-commons-cli" ,java-commons-cli)
3841-
;       ("java-asm" ,java-asm)
3842-
;       ("java-tomcat" ,java-tomcat)
3843-
;       ("java-xstream" ,java-xstream)
3844-
;       ("java-jansi" ,java-jansi)
3845-
;       ("java-jline" ,java-jline)))
3846-
;    (home-page "")
3847-
;    (synopsis "")
3848-
;    (description "")
3849-
;    (license (list license:gpl2
3850-
;                   license:cddl1.1))))
3851-
38523775
(define-public java-apache-ivy-bootstrap
38533776
  (package
38543777
    (name "java-apache-ivy-bootstrap")

38763799
    (description "")
38773800
    (license license:asl2.0)))
38783801
3879-
;(define-public groovy-bootstrap
3880-
;  (package
3881-
;    (name "groovy")
3882-
;    (version "2.0.0beta3")
3883-
;    (source (origin
3884-
;              (method url-fetch)
3885-
;              (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_"
3886-
;                                  "2_0_0_BETA_3.tar.gz"))
3887-
;              (file-name (string-append "groovy-" version ".tar.gz"))
3888-
;              (sha256
3889-
;               (base32
3890-
;                "1hm6kbwy5yhkzz7d2ln29k51iar6m7rwrzimsawgschvvqyrdxna"))))
3891-
;    (build-system ant-build-system)
3892-
;    (arguments
3893-
;     `(#:build-target "createJars"
3894-
;       #:tests? #f; part of build
3895-
;       #:make-flags
3896-
;       (list "-D_skipFetch_=true"
3897-
;             ;; FIXME: Tests require at least hsqldb and a part of ant testsuite
3898-
;             "-D_skipTests_=true"
3899-
;             ;; FIXME: Find aQute/bnd/ant/taskdef.properties.
3900-
;             "-D_skipOsgi_=true"
3901-
;             (string-append "-DinstallDirectory=" (assoc-ref %outputs "out")))
3902-
;       #:phases
3903-
;       (modify-phases %standard-phases
3904-
;         (add-before 'build 'make-build-dir
3905-
;           (lambda* (#:key inputs #:allow-other-keys)
3906-
;             (substitute* "build.xml"
3907-
;               (("<property file=\"local.build.properties\"/>")
3908-
;                (string-append "<property file=\"local.build.properties\"/>
3909-
;<path id=\"classpath\">
3910-
;<fileset dir=\"" (assoc-ref inputs "java-asm") "\">
3911-
;<include name=\"**/*.jar\" />
3912-
;</fileset>
3913-
;<fileset dir=\"" (assoc-ref inputs "antlr2") "\">
3914-
;<include name=\"**/*.jar\" />
3915-
;</fileset>
3916-
;<fileset dir=\"" (assoc-ref inputs "java-classpathx-servletapi") "\">
3917-
;<include name=\"**/*.jar\" />
3918-
;</fileset>
3919-
;<fileset dir=\"" (assoc-ref inputs "java-xstream") "\">
3920-
;<include name=\"**/*.jar\" />
3921-
;</fileset>
3922-
;<fileset dir=\"" (assoc-ref inputs "java-commons-cli") "\">
3923-
;<include name=\"**/*.jar\" />
3924-
;</fileset>
3925-
;<fileset dir=\"" (assoc-ref inputs "ant") "\">
3926-
;<include name=\"**/*.jar\" />
3927-
;</fileset>
3928-
;<fileset dir=\"" (assoc-ref inputs "java-jline") "\">
3929-
;<include name=\"**/*.jar\" />
3930-
;</fileset>
3931-
;<fileset dir=\"" (assoc-ref inputs "java-junit") "\">
3932-
;<include name=\"**/*.jar\" />
3933-
;</fileset>
3934-
;<fileset dir=\"" (assoc-ref inputs "java-jansi") "\">
3935-
;<include name=\"**/*.jar\" />
3936-
;</fileset>
3937-
;<fileset dir=\"" (assoc-ref inputs "java-commons-bsf") "\">
3938-
;<include name=\"**/*.jar\" />
3939-
;</fileset>
3940-
;<fileset dir=\"" (assoc-ref inputs "java-apache-ivy-bootstrap") "\">
3941-
;<include name=\"**/*.jar\" />
3942-
;</fileset>
3943-
;</path>"))
3944-
;               (("compilePath") "classpath"))
3945-
;             (substitute* "config/ant/build-setup.xml"
3946-
;               (("runtimePath") "classpath"))
3947-
;             ;; --classpath is not recognized (bug in commons-cli?)
3948-
;             (substitute* "src/main/org/codehaus/groovy/ant/Groovyc.java"
3949-
;               (("--classpath") "-cp"))
3950-
;             ;; These directories would have been created by maven initialization
3951-
;             (mkdir-p "target/lib/compile")
3952-
;             (mkdir-p "target/lib/test")
3953-
;             (mkdir-p "target/lib/tools")
3954-
;             (mkdir-p "target/lib/runtime")
3955-
;             #t))
3956-
;         (add-after 'install 'remove-embeddable
3957-
;           (lambda* (#:key outputs #:allow-other-keys)
3958-
;             (delete-file (string-append (assoc-ref outputs "out")
3959-
;                                         "/embeddable/groovy-all-2.0.0-beta-3.jar"))
3960-
;             #t)))))
3961-
;    (inputs
3962-
;     `(("java-commons-cli" ,java-commons-cli)
3963-
;       ("java-asm" ,java-asm)
3964-
;       ("ant-junit-tests" ,ant-junit-tests)
3965-
;       ("java-commons-bsf" ,java-commons-bsf)
3966-
;       ("java-classpathx-servletapi" ,java-classpathx-servletapi)
3967-
;       ("java-xstream" ,java-xstream)
3968-
;       ("java-jansi" ,java-jansi)
3969-
;       ("java-jline" ,java-jline)
3970-
;       ("java-apache-ivy-bootstrap" ,java-apache-ivy-bootstrap)
3971-
;       ("antlr2" ,antlr2)))
3972-
;    (native-inputs
3973-
;     `(("ant-antlr" ,ant-antlr)
3974-
;       ("java-aqute-bndlib" ,java-aqute-bndlib)
3975-
;       ("ant-junit-tests" ,ant-junit-tests)
3976-
;       ("java-jarjar" ,java-jarjar)
3977-
;       ("java-junit" ,java-junit)
3978-
;       ("java-jmock-1" ,java-jmock-1)
3979-
;       ("java-xmlunit-legacy" ,java-xmlunit-legacy)))
3980-
;    (home-page "")
3981-
;    (synopsis "")
3982-
;    (description "")
3983-
;    (license (list license:gpl2
3984-
;                   license:cddl1.1))))
3985-
;
3986-
;(define-public groovy-2.4
3987-
;  (package
3988-
;    (inherit groovy-bootstrap)
3989-
;    (name "groovy")
3990-
;    (version "2.2.0")
3991-
;    (source (origin
3992-
;              (method url-fetch)
3993-
;              (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_"
3994-
;                                  "2_2_0.tar.gz"))
3995-
;              (file-name (string-append name "-" version ".tar.gz"))
3996-
;              (sha256
3997-
;               (base32
3998-
;                "1fx9a71f0n5jr52zzyayia2hmbsr9pnd76rnh0z3y9ys1c5k8g7w"))
3999-
;              (patches
4000-
;                (search-patches
4001-
;                  "groovy-Add-exceptionutilsgenerator.patch"))))
4002-
;    (arguments
4003-
;     `(#:build-target "createJars"
4004-
;       #:tests? #f; part of build
4005-
;       #:jdk ,icedtea-8
4006-
;       #:make-flags
4007-
;       (list "-D_skipFetch_=true"
4008-
;             ;; FIXME: Tests require at least hsqldb and a part of ant testsuite
4009-
;             "-D_skipTests_=true"
4010-
;             ;; FIXME: Find aQute/bnd/ant/taskdef.properties.
4011-
;             "-D_skipOsgi_=true"
4012-
;             (string-append "-DinstallDirectory=" (assoc-ref %outputs "out")))
4013-
;       #:phases
4014-
;       (modify-phases %standard-phases
4015-
;         ;; FIXME: This should be taken care of by build.xml. Why doesn't it work?
4016-
;         (add-before 'build 'generate-parser
4017-
;           (lambda _
4018-
;             (with-directory-excursion "src/main/org/codehaus/groovy/antlr/java"
4019-
;               (zero? (system* "antlr" "java.g")))
4020-
;             (with-directory-excursion "src/main/org/codehaus/groovy/antlr"
4021-
;               (mkdir "parser")
4022-
;               (with-directory-excursion "parser"
4023-
;                 (zero? (system* "antlr" "../groovy.g"))))))
4024-
;         (add-before 'build 'generate-exception-utils
4025-
;           (lambda _
4026-
;             (system* "javac" "-cp" (getenv "CLASSPATH")
4027-
;                      "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java")
4028-
;             (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
4029-
;                                                         ":config/ant/src")
4030-
;                             "org.codehaus.groovy.ExceptionUtilsGenerator"
4031-
;                             "target/classes/org/codehaus/groovy/runtime/ExceptionUtils.class"))))
4032-
;         (add-before 'configure 'copy-build.xml
4033-
;           (lambda* (#:key inputs #:allow-other-keys)
4034-
;             (mkdir "old-groovy-tmp")
4035-
;             (mkdir-p "config/ant")
4036-
;             (with-directory-excursion "old-groovy-tmp"
4037-
;               (system* "tar" "xf" (assoc-ref inputs "build.xml"))
4038-
;               (copy-file "groovy-GROOVY_2_0_0_BETA_3/build.xml"
4039-
;                          "../build.xml")
4040-
;               (copy-recursively "groovy-GROOVY_2_0_0_BETA_3/config/ant"
4041-
;                                 "../config/ant"))
4042-
;             #t))
4043-
;         (add-before 'build 'make-build-dir
4044-
;           (lambda* (#:key inputs #:allow-other-keys)
4045-
;             (substitute* "build.xml"
4046-
;               (("<property file=\"local.build.properties\"/>")
4047-
;                (string-append "<property file=\"local.build.properties\"/>
4048-
;<path id=\"classpath\">
4049-
;<pathelement path=\"${mainClassesDirectory}\" />
4050-
;<fileset dir=\"" (assoc-ref inputs "java-asm") "\">
4051-
;<include name=\"**/*.jar\" />
4052-
;</fileset>
4053-
;<fileset dir=\"" (assoc-ref inputs "antlr2") "\">
4054-
;<include name=\"**/*.jar\" />
4055-
;</fileset>
4056-
;<fileset dir=\"" (assoc-ref inputs "java-classpathx-servletapi") "\">
4057-
;<include name=\"**/*.jar\" />
4058-
;</fileset>
4059-
;<fileset dir=\"" (assoc-ref inputs "java-xstream") "\">
4060-
;<include name=\"**/*.jar\" />
4061-
;</fileset>
4062-
;<fileset dir=\"" (assoc-ref inputs "java-commons-cli") "\">
4063-
;<include name=\"**/*.jar\" />
4064-
;</fileset>
4065-
;<fileset dir=\"" (assoc-ref inputs "ant") "\">
4066-
;<include name=\"**/*.jar\" />
4067-
;</fileset>
4068-
;<fileset dir=\"" (assoc-ref inputs "java-jline") "\">
4069-
;<include name=\"**/*.jar\" />
4070-
;</fileset>
4071-
;<fileset dir=\"" (assoc-ref inputs "java-junit") "\">
4072-
;<include name=\"**/*.jar\" />
4073-
;</fileset>
4074-
;<fileset dir=\"" (assoc-ref inputs "java-jansi") "\">
4075-
;<include name=\"**/*.jar\" />
4076-
;</fileset>
4077-
;<fileset dir=\"" (assoc-ref inputs "java-commons-bsf") "\">
4078-
;<include name=\"**/*.jar\" />
4079-
;</fileset>
4080-
;<fileset dir=\"" (assoc-ref inputs "java-apache-ivy-bootstrap") "\">
4081-
;<include name=\"**/*.jar\" />
4082-
;</fileset>
4083-
;</path>"))
4084-
;               (("compilePath") "classpath")
4085-
;             ;; groovy-ant is no longer in the main sources
4086-
;             (("<path id=\"groovyMainClasses\">")
4087-
;              "<javac srcdir=\"./subprojects/groovy-groovydoc/src/main/java\"
4088-
;includeantruntime=\"false\" destdir=\"${mainClassesDirectory}\"
4089-
;deprecation=\"on\" debug=\"yes\" source=\"1.5\" target=\"1.5\" fork=\"true\"
4090-
;classpathref=\"classpath\" />
4091-
;<javac srcdir=\"./subprojects/groovy-ant/src/main/java\"
4092-
;includeantruntime=\"false\" destdir=\"${mainClassesDirectory}\"
4093-
;deprecation=\"on\" debug=\"yes\" source=\"1.5\" target=\"1.5\" fork=\"true\"
4094-
;classpathref=\"classpath\" />
4095-
;<path id=\"groovyMainClasses\">"))
4096-
;             (substitute* "config/ant/build-setup.xml"
4097-
;               (("runtimePath") "classpath"))
4098-
;             ;; --classpath is not recognized (bug in commons-cli?)
4099-
;             ;(substitute* "subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java"
4100-
;             ;  (("--classpath") "-cp"))
4101-
;             ;; These directories would have been created by maven initialization
4102-
;             (mkdir-p "target/lib/compile")
4103-
;             (mkdir-p "target/lib/test")
4104-
;             (mkdir-p "target/lib/tools")
4105-
;             (mkdir-p "target/lib/runtime")
4106-
;             #t))
4107-
;         (add-after 'install 'remove-embeddable
4108-
;           (lambda* (#:key outputs #:allow-other-keys)
4109-
;             (delete-file (string-append (assoc-ref outputs "out")
4110-
;                                         "/embeddable/groovy-all-2.0.0-beta-3.jar"))
4111-
;             #t)))))
4112-
;    (native-inputs
4113-
;     `(("build.xml" ,(package-source groovy-bootstrap))
4114-
;       ,@(package-native-inputs groovy-bootstrap)))))
4115-
41163802
(define-public ant-junit
41173803
  (package
41183804
    (inherit ant)

44204106
(define-public java-antlr4
44214107
  (package
44224108
    (name "java-antlr4")
4423-
    (version "4.7")
4109+
    (version "4.7.1")
44244110
    (source (origin
44254111
              (method url-fetch)
44264112
              (uri (string-append "https://github.com/antlr/antlr4/archive/"

44284114
              (file-name (string-append name "-" version ".tar.gz"))
44294115
              (sha256
44304116
               (base32
4431-
                "0y7lzkvx9wbbmwg45mb4icx7i66z6894qfygrbbs26sr5xxyml9h"))
4117+
                "0x355893x029d50lcg853v9g6y0ci7jfij9i03jn6fik87s181sd"))
44324118
              (patches
44334119
                (search-patches "java-antlr4-Add-standalone-generator.patch"))))
44344120
    (build-system ant-build-system)

44494135
                   (display
44504136
                     (string-append "#!" (which "sh") "\n"
44514137
                                    "java -cp " jar "/" ,name "-" ,version ".jar:"
4452-
                                    (string-concatenate
4453-
                                      (find-files (assoc-ref inputs "stringtemplate")
4454-
                                                  ".*\\.jar"))
4455-
                                    ":"
4456-
                                    (string-concatenate
4457-
                                      (find-files (assoc-ref inputs "stringtemplate4")
4458-
                                                  ".*\\.jar"))
4459-
                                    ":"
4460-
                                    (string-concatenate
4461-
                                      (find-files (assoc-ref inputs "antlr3")
4138+
                                    (string-join
4139+
                                      (apply
4140+
                                        append
4141+
                                        (map
4142+
                                          (lambda (input)
4143+
                                            (find-files (assoc-ref inputs input)
44624144
                                                  ".*\\.jar"))
4145+
                                          '("antlr3" "java-stringtemplate"
4146+
                                            "java-antlr4-runtime" "java-treelayout"
4147+
                                            "java-json" "java-icu4j")))
4148+
                                      ":")
44634149
                                    " org.antlr.v4.Tool $*"))))
44644150
               (chmod (string-append bin "/antlr4") #o755))))
44654151
         (add-before 'build 'copy-resources

57295415
         (add-before 'configure 'chdir
57305416
           (lambda _
57315417
             (chdir "logback-classic")))
5732-
         ;(add-after 'configure 'build-groovy
57335418
         (replace 'build
57345419
           (lambda _
5735-
             ;(delete-file "src/main/java/ch/qos/logback/classic/boolex/GEventEvaluator.java"))))))
57365420
             (mkdir-p "build/classes")
57375421
             (and
5738-
               (zero? (apply system* "java" "-cp" (getenv "CLASSPATH")
5739-
                             "org.codehaus.groovy.tools.FileSystemCompiler"
5740-
                             "-d" "build/classes"
5741-
                             "-j"; joint compilation
5422+
               (zero? (apply system* "groovyc" "-d" "build/classes" "-j"
57425423
                             (find-files "src/main/" ".*\\.(groovy|java)$")))
57435424
               (zero? (system* "ant" "jar"))))))))
57445425
    (inputs

57475428
       ,@(package-inputs java-logback-core)))
57485429
    (native-inputs
57495430
     `(("groovy" ,groovy)
5750-
       ;; for groovy
5751-
       ("java-commons-cli" ,java-commons-cli)
5752-
       ("java-asm" ,java-asm)
5753-
       ("antlr2" ,antlr2)
57545431
       ;; for tests
57555432
       ("java-junit" ,java-junit)
57565433
       ("java-hamcrest-core" ,java-hamcrest-core)

71216798
           (lambda* (#:key inputs #:allow-other-keys)
71226799
             (mkdir-p "maven-slf4j-provider/target/generated-sources")
71236800
             (with-directory-excursion "maven-slf4j-provider/target/generated-sources"
7124-
               (system* "tar" "xf" (assoc-ref inputs "simple")))
6801+
               (system* "tar" "xf" (assoc-ref inputs "java-slf4j-simple")))
71256802
             (with-directory-excursion "maven-slf4j-provider/"
7126-
               (zero? (system* "java" "-cp" (getenv "CLASSPATH")
7127-
                               "groovy.ui.GroovyMain" "-Db/c gasedir=/tmp"
6803+
               (zero? (system* "groovy"
71286804
                               "src/main/script/patch-slf4j-simple.groovy"))))))))
71296805
    (inputs
71306806
     `(("java-slf4j-api" ,java-slf4j-api)
71316807
       ("java-slf4j-simple" ,(package-source java-slf4j-simple))
71326808
       ("maven-shared-utils" ,maven-shared-utils)))
71336809
    (native-inputs
7134-
     `(("groovy" ,groovy)
7135-
       ("java-asm" ,java-asm)
7136-
       ("antlr2" ,antlr2)
7137-
       ("java-commons-cli" ,java-commons-cli)))))
6810+
     `(("groovy" ,groovy)))))
71386811
71396812
(define-public maven-compat
71406813
  (package