| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages groovy)
|
| 22 | #:use-module ((guix licenses) #:prefix license:)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module (guix download)
|
| 25 | #:use-module (guix git-download)
|
| 26 | #:use-module (guix utils)
|
| 27 | #:use-module (guix build-system ant)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages java)
|
| 30 | #:use-module (gnu packages java-xml)
|
| 31 | #:use-module (gnu packages xml)
|
| 32 | #:use-module (srfi srfi-1))
|
| 33 |
|
| 34 | (define-public java-groovy-bootstrap
|
| 35 | (package
|
| 36 | (name "java-groovy-bootstrap")
|
| 37 | (version "3.0.5")
|
| 38 | (source
|
| 39 | (origin
|
| 40 | (method git-fetch)
|
| 41 | (uri (git-reference
|
| 42 | (url "https://github.com/apache/groovy")
|
| 43 | (commit (string-append
|
| 44 | "GROOVY_"
|
| 45 | (string-map (lambda (x) (if (eq? x #\.) #\_ x))
|
| 46 | version)))))
|
| 47 | (file-name (git-file-name name version))
|
| 48 | (sha256
|
| 49 | (base32 "00556qxjmcn3a3xhfy6n0zw3d69mnw72vzm2rb6n4ihzkk7579nm"))
|
| 50 | (patches
|
| 51 | (search-patches "groovy-add-exceptionutilsgenerator.patch"))))
|
| 52 | (build-system ant-build-system)
|
| 53 | (arguments
|
| 54 | `(#:jar-name "groovy.jar"
|
| 55 | #:source-dir "src/main/java:src/main/antlr2:subprojects/parser-antlr4/src/main/java:src/antlr"
|
| 56 | #:test-dir "src/test"
|
| 57 | #:tests? #f
|
| 58 | #:jdk ,openjdk9
|
| 59 | #:main-class "groovy.ui.GroovyMain"
|
| 60 | #:phases
|
| 61 | (modify-phases %standard-phases
|
| 62 | (add-before 'build 'generate-parsers
|
| 63 | (lambda _
|
| 64 | (with-directory-excursion "src/main/antlr2/org/codehaus/groovy/antlr/java"
|
| 65 | (invoke "antlr" "java.g"))
|
| 66 | (with-directory-excursion "src/main/antlr2/org/codehaus/groovy/antlr"
|
| 67 | (mkdir "parser")
|
| 68 | (with-directory-excursion "parser"
|
| 69 | (invoke "antlr" "../groovy.g")))
|
| 70 | (invoke "antlr4" "-lib" "src/antlr"
|
| 71 | "-package" "org.apache.groovy.parser.antlr4"
|
| 72 | "-visitor" "-no-listener" "src/antlr/GroovyLexer.g4")
|
| 73 | (invoke "antlr4" "-lib" "src/antlr"
|
| 74 | "-package" "org.apache.groovy.parser.antlr4"
|
| 75 | "-visitor" "-no-listener" "src/antlr/GroovyParser.g4")
|
| 76 | #t))
|
| 77 | (add-before 'build 'generate-exception-utils
|
| 78 | (lambda _
|
| 79 | (invoke "javac" "-cp" (getenv "CLASSPATH")
|
| 80 | "-source" "1.8" "-target" "1.8"
|
| 81 | "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java")
|
| 82 | (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
|
| 83 | ":config/ant/src")
|
| 84 | "org.codehaus.groovy.ExceptionUtilsGenerator"
|
| 85 | "build/classes/org/codehaus/groovy/runtime/ExceptionUtils.class")
|
| 86 | #t))
|
| 87 | (add-before 'build 'set-source-level
|
| 88 | (lambda _
|
| 89 | (substitute* "build.xml"
|
| 90 | (("<javac") "<javac source=\"1.8\" target=\"1.8\""))
|
| 91 | #t)))))
|
| 92 | (native-inputs
|
| 93 | `(("antlr2" ,antlr2)
|
| 94 | ("antlr4" ,java-tunnelvisionlabs-antlr4)
|
| 95 | ("java-jsr305" ,java-jsr305)
|
| 96 | ("java-junit" ,java-junit)
|
| 97 | ("java-hamcrest-core" ,java-hamcrest-core)
|
| 98 | ("java-jmock-1" ,java-jmock-1)
|
| 99 | ("java-xmlunit-legacy" ,java-xmlunit-legacy)))
|
| 100 | (inputs
|
| 101 | `(("java-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime)
|
| 102 | ("java-antlr4-runtime-annotations"
|
| 103 | ,java-tunnelvisionlabs-antlr4-runtime-annotations)
|
| 104 | ("java-asm" ,java-asm-8)
|
| 105 | ("java-asm-util" ,java-asm-util-8)
|
| 106 | ("java-classpathx-servletapi" ,java-classpathx-servletapi)
|
| 107 | ("java-commons-cli" ,java-commons-cli)
|
| 108 | ("java-jansi" ,java-jansi-1)
|
| 109 | ("java-jline-2" ,java-jline-2)
|
| 110 | ("java-picocli" ,java-picocli)
|
| 111 | ("java-xstream" ,java-xstream)))
|
| 112 | (home-page "http://groovy-lang.org/")
|
| 113 | (synopsis "Groovy's java bootstrap")
|
| 114 | (description "This package contains the java bootstrap that is used to build
|
| 115 | groovy submodules.")
|
| 116 | (properties '((hidden? . #t)))
|
| 117 | (license license:asl2.0)))
|
| 118 |
|
| 119 | (define-public groovy-bootstrap
|
| 120 | (package
|
| 121 | (inherit java-groovy-bootstrap)
|
| 122 | (name "groovy-bootstrap")
|
| 123 | (arguments
|
| 124 | `(#:jar-name "groovy.jar"
|
| 125 | #:jdk ,openjdk9
|
| 126 | |
| 127 | #:tests? #f
|
| 128 | #:phases
|
| 129 | (modify-phases %standard-phases
|
| 130 | (add-before 'build 'generate-parser
|
| 131 | (lambda _
|
| 132 | (with-directory-excursion "src/main/antlr2/org/codehaus/groovy/antlr/java"
|
| 133 | (invoke "antlr" "java.g"))
|
| 134 | (with-directory-excursion "src/main/antlr2/org/codehaus/groovy/antlr"
|
| 135 | (mkdir "parser")
|
| 136 | (with-directory-excursion "parser"
|
| 137 | (invoke "antlr" "../groovy.g")))
|
| 138 | (invoke "antlr4" "-lib" "src/antlr"
|
| 139 | "-package" "org.apache.groovy.parser.antlr4"
|
| 140 | "-visitor" "-no-listener" "src/antlr/GroovyLexer.g4")
|
| 141 | (invoke "antlr4" "-lib" "src/antlr"
|
| 142 | "-package" "org.apache.groovy.parser.antlr4"
|
| 143 | "-visitor" "-no-listener" "src/antlr/GroovyParser.g4")
|
| 144 | #t))
|
| 145 | (add-before 'build 'generate-exception-utils
|
| 146 | (lambda _
|
| 147 | (invoke "javac" "-cp" (getenv "CLASSPATH")
|
| 148 | |
| 149 | "-source" "1.8" "-target" "1.8"
|
| 150 | "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java")
|
| 151 | (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
|
| 152 | ":config/ant/src")
|
| 153 | "org.codehaus.groovy.ExceptionUtilsGenerator"
|
| 154 | "target/classes/org/codehaus/groovy/runtime/ExceptionUtils.class")
|
| 155 | #t))
|
| 156 | (add-before 'build 'generate-dgminfo
|
| 157 | (lambda _
|
| 158 | (mkdir-p "target/classes/org/codehaus/groovy/runtime")
|
| 159 | (mkdir-p "target/classes/META-INF")
|
| 160 | (invoke "javac" "-cp" (getenv "CLASSPATH")
|
| 161 | |
| 162 | "-source" "1.8" "-target" "1.8"
|
| 163 | "src/main/java/org/codehaus/groovy/tools/DgmConverter.java")
|
| 164 | (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
|
| 165 | ":src/main/java")
|
| 166 | "org.codehaus.groovy.tools.DgmConverter")
|
| 167 | #t))
|
| 168 | (add-before 'build 'copy-resources
|
| 169 | (lambda _
|
| 170 | (with-directory-excursion "src/main/java"
|
| 171 | (for-each (lambda (file)
|
| 172 | (mkdir-p (string-append "../../../target/classes/"
|
| 173 | (dirname file)))
|
| 174 | (copy-file file
|
| 175 | (string-append "../../../target/classes/"
|
| 176 | file)))
|
| 177 | (find-files "." ".*.(txt|properties|xml|html)")))
|
| 178 | #t))
|
| 179 | (replace 'build
|
| 180 | (lambda _
|
| 181 | (mkdir-p "build/jar")
|
| 182 | (apply invoke "java" "-cp" (getenv "CLASSPATH")
|
| 183 | "org.codehaus.groovy.tools.FileSystemCompiler"
|
| 184 | "-cp" (getenv "CLASSPATH")
|
| 185 | "-d" "target/classes"
|
| 186 | "-j" |
| 187 | |
| 188 | "-Jsource=1.8" "-Jtarget=1.8"
|
| 189 | (find-files "src/main"
|
| 190 | ".*\\.(groovy|java)$"))
|
| 191 | (invoke "jar" "-cf" "build/jar/groovy.jar"
|
| 192 | "-C" "target/classes" ".")
|
| 193 | #t)))))
|
| 194 | (inputs
|
| 195 | `(("java-apache-ivy" ,java-apache-ivy)
|
| 196 | ,@(package-inputs java-groovy-bootstrap)))
|
| 197 | (native-inputs
|
| 198 | `(("java-groovy-bootstrap" ,java-groovy-bootstrap)
|
| 199 | ,@(package-native-inputs java-groovy-bootstrap)))
|
| 200 | (synopsis "Groovy compiler")
|
| 201 | (description "This package contains the first version of the Groovy compiler.
|
| 202 | Although already usable, it doesn't contain the groovy library yet. This package
|
| 203 | is used to build the groovy submodules written in groovy.")))
|
| 204 |
|
| 205 | (define-public groovy-tests-bootstrap
|
| 206 | (package
|
| 207 | (inherit groovy-bootstrap)
|
| 208 | (name "groovy-tests-bootstrap")
|
| 209 | (arguments
|
| 210 | `(#:jar-name "groovy-tests-bootstrap.jar"
|
| 211 | #:jdk ,openjdk9
|
| 212 | #:tests? #f; no tests
|
| 213 | #:phases
|
| 214 | (modify-phases %standard-phases
|
| 215 | (replace 'build
|
| 216 | (lambda _
|
| 217 | (mkdir-p "build/classes")
|
| 218 | (mkdir-p "build/jar")
|
| 219 | (apply invoke "java" "-cp" (getenv "CLASSPATH")
|
| 220 | "org.codehaus.groovy.tools.FileSystemCompiler"
|
| 221 | "-cp" (getenv "CLASSPATH")
|
| 222 | "-d" "build/classes"
|
| 223 | "-j" |
| 224 | (append
|
| 225 | (find-files "src/test" "TestSupport.java")
|
| 226 | (find-files "src/test" "HeadlessTestSupport.java")
|
| 227 | (find-files "src/test" "AstAssert.groovy")
|
| 228 | (find-files "src/test" "XmlAssert.java")))
|
| 229 | (invoke "jar" "-cf" "build/jar/groovy-tests-bootstrap.jar"
|
| 230 | "-C" "build/classes" ".")
|
| 231 | #t)))))
|
| 232 | (inputs
|
| 233 | `(("groovy-test" ,groovy-test)
|
| 234 | ("groovy-parser-antlr4" ,groovy-parser-antlr4)
|
| 235 | ,@(package-inputs groovy-bootstrap)))
|
| 236 | (native-inputs
|
| 237 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 238 | ,@(package-native-inputs java-groovy-bootstrap)))
|
| 239 | (synopsis "Groovy test classes")
|
| 240 | (description "This package contains three classes required for testing
|
| 241 | other groovy submodules.")))
|
| 242 |
|
| 243 | (define (groovy-subproject name)
|
| 244 | (package
|
| 245 | (inherit groovy-bootstrap)
|
| 246 | (name name)
|
| 247 | (arguments
|
| 248 | `(#:jar-name ,(string-append name ".jar")
|
| 249 | #:test-dir ,(string-append name "/src/test")
|
| 250 | #:test-include (list "**/*Test.java" "**/*.groovy")
|
| 251 | #:jdk ,openjdk9
|
| 252 | #:phases
|
| 253 | (modify-phases %standard-phases
|
| 254 | (replace 'build
|
| 255 | (lambda _
|
| 256 | (mkdir-p "build/classes")
|
| 257 | (mkdir-p "build/jar")
|
| 258 | (apply invoke "java" "-cp" (getenv "CLASSPATH")
|
| 259 | "org.codehaus.groovy.tools.FileSystemCompiler"
|
| 260 | "-cp" (getenv "CLASSPATH")
|
| 261 | "-d" "build/classes" "-j"
|
| 262 | |
| 263 | "-Jsource=1.8" "-Jtarget=1.8"
|
| 264 | (append
|
| 265 | (find-files ,(string-append "subprojects/" name "/src/main/java")
|
| 266 | ".*\\.(groovy|java)$")
|
| 267 | (find-files ,(string-append "subprojects/" name "/src/main/groovy")
|
| 268 | ".*\\.(groovy|java)$")))
|
| 269 | (invoke "jar" "-cf" ,(string-append "build/jar/" name ".jar")
|
| 270 | "-C" "build/classes" ".")
|
| 271 | #t))
|
| 272 | (add-before 'build 'copy-resources
|
| 273 | (lambda _
|
| 274 | (let ((resource-dir ,(string-append "subprojects/" name
|
| 275 | "/src/main/resources")))
|
| 276 | (when (file-exists? resource-dir)
|
| 277 | (copy-recursively resource-dir "build/classes")))
|
| 278 | #t))
|
| 279 | (replace 'check
|
| 280 | (lambda* (#:key tests? #:allow-other-keys)
|
| 281 | (when tests?
|
| 282 | (mkdir-p "build/test-classes")
|
| 283 | (substitute* "build.xml"
|
| 284 | (("depends=\"compile-tests\"") "depends=\"\"")
|
| 285 | (("}/java") "}/"))
|
| 286 | (apply invoke "java" "-cp"
|
| 287 | (string-append (getenv "CLASSPATH") ":build/classes")
|
| 288 | "org.codehaus.groovy.tools.FileSystemCompiler" "-cp"
|
| 289 | (string-append (getenv "CLASSPATH") ":build/classes")
|
| 290 | "-d" "build/test-classes" "-j"
|
| 291 | (append
|
| 292 | (find-files ,(string-append "subprojects/" name "/src/test/java")
|
| 293 | ".*\\.(groovy|java)$")
|
| 294 | (find-files ,(string-append "subprojects/" name "/src/test/groovy")
|
| 295 | ".*\\.(groovy|java)$")))
|
| 296 | (invoke "ant" "check"))
|
| 297 | #t)))))))
|
| 298 |
|
| 299 | (define-public groovy-parser-antlr4
|
| 300 | (let ((base (groovy-subproject "parser-antlr4")))
|
| 301 | (package
|
| 302 | (inherit base)
|
| 303 | (name "groovy-parser-antlr4")
|
| 304 | (arguments
|
| 305 | `(#:tests? #f
|
| 306 | ,@(substitute-keyword-arguments arguments
|
| 307 | ((#:phases phases)
|
| 308 | `(modify-phases ,phases
|
| 309 | (add-before 'build 'generate-parser
|
| 310 | (lambda _
|
| 311 | (invoke "antlr4" "-lib" "src/antlr"
|
| 312 | "-package" "org.apache.groovy.parser.antlr4"
|
| 313 | "-visitor" "-no-listener" "src/antlr/GroovyLexer.g4")
|
| 314 | (invoke "antlr4" "-lib" "src/antlr"
|
| 315 | "-package" "org.apache.groovy.parser.antlr4"
|
| 316 | "-visitor" "-no-listener" "src/antlr/GroovyParser.g4")
|
| 317 | (for-each
|
| 318 | (lambda (file)
|
| 319 | (install-file file
|
| 320 | "subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4"))
|
| 321 | (find-files "src/antlr" ".*.java$"))
|
| 322 | #t)))))))
|
| 323 | (native-inputs
|
| 324 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 325 | ,@(package-native-inputs java-groovy-bootstrap)))
|
| 326 | (synopsis "Groovy antlr4 parser submodule")
|
| 327 | (description "This package contains the new parser Parrot for Groovy, which
|
| 328 | is based on Antlr4. The new parser can parse Groovy source code and construct
|
| 329 | the related AST, which is almost identical to the one generated by the old
|
| 330 | parser. Currently all features of Groovy are available."))))
|
| 331 |
|
| 332 | (define-public groovy-test
|
| 333 | (let ((base (groovy-subproject "groovy-test")))
|
| 334 | (package
|
| 335 | (inherit base)
|
| 336 | (arguments
|
| 337 | `( |
| 338 | ,@(package-arguments base)))
|
| 339 | (synopsis "Groovy test submodule")
|
| 340 | (description "This package contains the test submodules used to test
|
| 341 | other groovy submodules."))))
|
| 342 |
|
| 343 | (define-public groovy-xml
|
| 344 | (let ((base (groovy-subproject "groovy-xml")))
|
| 345 | (package
|
| 346 | (inherit base)
|
| 347 | (native-inputs
|
| 348 | `(("groovy-test" ,groovy-test)
|
| 349 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 350 | ,@(package-native-inputs base)))
|
| 351 | (inputs
|
| 352 | `(("groovy-parser-antlr4" ,groovy-parser-antlr4)
|
| 353 | ,@(package-inputs base)))
|
| 354 | (synopsis "Groovy XML")
|
| 355 | (description "This package contains XML-related utilities for groovy."))))
|
| 356 |
|
| 357 | (define-public groovy-templates
|
| 358 | (let ((base (groovy-subproject "groovy-templates")))
|
| 359 | (package
|
| 360 | (inherit base)
|
| 361 | (arguments
|
| 362 | `(#:tests? #f;Requires spock-framework which is a circular dependency
|
| 363 | ,@(substitute-keyword-arguments arguments
|
| 364 | ((#:phases phases)
|
| 365 | `(modify-phases ,phases
|
| 366 | |
| 367 | |
| 368 | (add-before 'build 'remove-annotation
|
| 369 | (lambda _
|
| 370 | (substitute* '("subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java"
|
| 371 | "subprojects/groovy-templates/src/main/groovy/groovy/text/TemplateEngine.java")
|
| 372 | (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") "")
|
| 373 | (("@SuppressFBWarnings.*") ""))
|
| 374 | #t)))))))
|
| 375 | (inputs
|
| 376 | `(("groovy-xml" ,groovy-xml)
|
| 377 | ,@(package-inputs base)))
|
| 378 | (native-inputs
|
| 379 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 380 | ("groovy-test" ,groovy-test)
|
| 381 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 382 | ,@(package-native-inputs base)))
|
| 383 | (synopsis "Groovy template engine")
|
| 384 | (description "This package contains a template framework which is
|
| 385 | well-suited to applications where the text to be generated follows the form of
|
| 386 | a static template."))))
|
| 387 |
|
| 388 | (define-public groovy-groovydoc
|
| 389 | (let ((base (groovy-subproject "groovy-groovydoc")))
|
| 390 | (package
|
| 391 | (inherit base)
|
| 392 | (arguments
|
| 393 | `(#:tests? #f; Requires groovy-ant which is a circular dependency
|
| 394 | ,@(package-arguments base)))
|
| 395 | (inputs
|
| 396 | `(("groovy-templates" ,groovy-templates)
|
| 397 | ("groovy-parser-antlr4" ,groovy-parser-antlr4)
|
| 398 | ("java-javaparser" ,java-javaparser)
|
| 399 | ,@(package-inputs groovy-bootstrap)))
|
| 400 | (native-inputs
|
| 401 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 402 | ("groovy-test" ,groovy-test)
|
| 403 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 404 | ,@(package-native-inputs java-groovy-bootstrap)))
|
| 405 | (synopsis "Groovy documentation generation")
|
| 406 | (description "This package contains the groovy documentation generator,
|
| 407 | similar to javadoc."))))
|
| 408 |
|
| 409 | (define-public groovy-ant
|
| 410 | (let ((base (groovy-subproject "groovy-ant")))
|
| 411 | (package
|
| 412 | (inherit base)
|
| 413 | (arguments
|
| 414 | `( |
| 415 | #:ant ,ant/java8 |
| 416 | ,@(substitute-keyword-arguments arguments
|
| 417 | ((#:phases phases)
|
| 418 | `(modify-phases ,phases
|
| 419 | |
| 420 | |
| 421 | (add-before 'build 'remove-annotation
|
| 422 | (lambda _
|
| 423 | (substitute* (find-files "subprojects/groovy-ant"
|
| 424 | ".*.java$")
|
| 425 | (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") "")
|
| 426 | (("@SuppressFBWarnings.*") ""))
|
| 427 | #t)))))))
|
| 428 | (inputs
|
| 429 | `(("groovy-groovydoc" ,groovy-groovydoc)
|
| 430 | ("java-asm-tree" ,java-asm-tree-8)
|
| 431 | ("java-asm-analysis" ,java-asm-analysis-8)
|
| 432 | ,@(package-inputs base)))
|
| 433 | (native-inputs
|
| 434 | `(("ant-junit" ,ant-junit)
|
| 435 | ("groovy-bootstrap" ,groovy-bootstrap)
|
| 436 | ("groovy-xml" ,groovy-xml)
|
| 437 | ("groovy-test" ,groovy-test)
|
| 438 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 439 | ,@(package-native-inputs base)))
|
| 440 | (synopsis "Groovy ant tasks")
|
| 441 | (description "This package contains groovy-related ant tasks definitions."))))
|
| 442 |
|
| 443 | (define-public groovy-astbuilder
|
| 444 | (let ((base (groovy-subproject "groovy-astbuilder")))
|
| 445 | (package
|
| 446 | (inherit base)
|
| 447 | (arguments
|
| 448 | (substitute-keyword-arguments arguments
|
| 449 | ((#:phases phases)
|
| 450 | `(modify-phases ,phases
|
| 451 | (delete 'copy-resources)
|
| 452 | (add-after 'build 'copy-resources
|
| 453 | (lambda _
|
| 454 | (copy-recursively
|
| 455 | "subprojects/groovy-astbuilder/src/main/resources"
|
| 456 | "build/classes")
|
| 457 | (substitute* "build.xml"
|
| 458 | (("depends=\"compile,") "depends=\""))
|
| 459 | (invoke "ant" "jar")
|
| 460 | #t))))))
|
| 461 | (inputs
|
| 462 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 463 | ,@(package-inputs base)))
|
| 464 | (native-inputs
|
| 465 | `(("groovy-test" ,groovy-test)
|
| 466 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 467 | ,@(package-native-inputs base)))
|
| 468 | (synopsis "Transformation to capture ASTBuilder from code statements")
|
| 469 | (description "This package contains an AST transformation for use with
|
| 470 | ASTBuilder when building \"from string\" Groovy statements."))))
|
| 471 |
|
| 472 | (define-public groovy-bsf
|
| 473 | (let ((base (groovy-subproject "groovy-bsf")))
|
| 474 | (package
|
| 475 | (inherit base)
|
| 476 | (arguments
|
| 477 | `(#:test-exclude (list
|
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | "**/BSFTest.java")
|
| 484 | ,@(package-arguments base)))
|
| 485 | (inputs
|
| 486 | `(("java-commons-bsf" ,java-commons-bsf)
|
| 487 | ,@(package-inputs base)))
|
| 488 | (native-inputs
|
| 489 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 490 | ("groovy-test" ,groovy-test)
|
| 491 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 492 | ("java-commons-logging-minimal" ,java-commons-logging-minimal)
|
| 493 | ,@(package-native-inputs base)))
|
| 494 | (synopsis "Groovy BSF engine")
|
| 495 | (description "This package defines the BSF engine for using Groovy inside
|
| 496 | any @dfn{Bean Scripting Framework} (BSF) application."))))
|
| 497 |
|
| 498 | (define-public groovy-cli-commons
|
| 499 | (let ((base (groovy-subproject "groovy-cli-commons")))
|
| 500 | (package
|
| 501 | (inherit base)
|
| 502 | (inputs
|
| 503 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 504 | ,@(package-inputs base)))
|
| 505 | (native-inputs
|
| 506 | `(("groovy-test" ,groovy-test)
|
| 507 | ,@(package-native-inputs base)))
|
| 508 | (synopsis "Groovy CLI common classes")
|
| 509 | (description "This package defines common classes for dealing with
|
| 510 | command-line arguments in Groovy."))))
|
| 511 |
|
| 512 | (define-public groovy-cli-picocli
|
| 513 | (let ((base (groovy-subproject "groovy-cli-picocli")))
|
| 514 | (package
|
| 515 | (inherit base)
|
| 516 | (inputs
|
| 517 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 518 | ("java-picocli" ,java-picocli)
|
| 519 | ,@(package-inputs base)))
|
| 520 | (native-inputs
|
| 521 | `(("groovy-test" ,groovy-test)
|
| 522 | ,@(package-native-inputs base)))
|
| 523 | (synopsis "Groovy CLI classes that use picocli")
|
| 524 | (description "This package defines classes for dealing with command-line
|
| 525 | arguments in Groovy using the picocli library."))))
|
| 526 |
|
| 527 | (define-public groovy-swing
|
| 528 | (let ((base (groovy-subproject "groovy-swing")))
|
| 529 | (package
|
| 530 | (inherit base)
|
| 531 | (arguments
|
| 532 | (substitute-keyword-arguments arguments
|
| 533 | ((#:phases phases)
|
| 534 | `(modify-phases ,phases
|
| 535 | (add-before 'check 'fix-test
|
| 536 | (lambda _
|
| 537 | (substitute*
|
| 538 | "subprojects/groovy-swing/src/test/groovy/groovy/swing/GroovySwingTestCase.groovy"
|
| 539 | (("HeadlessTestSupport.headless") "isHeadless()"))
|
| 540 | #t))))))
|
| 541 | (native-inputs
|
| 542 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 543 | ("groovy-test" ,groovy-test)
|
| 544 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 545 | ("java-commons-logging-minimal" ,java-commons-logging-minimal)
|
| 546 | ,@(package-native-inputs base)))
|
| 547 | (synopsis "Groovy graphical library")
|
| 548 | (description "This package contains the groovy bindings to Java Swing, a
|
| 549 | library used to build graphical interfaces."))))
|
| 550 |
|
| 551 | (define-public groovy-console
|
| 552 | (let ((base (groovy-subproject "groovy-console")))
|
| 553 | (package
|
| 554 | (inherit base)
|
| 555 | (arguments
|
| 556 | (substitute-keyword-arguments arguments
|
| 557 | ((#:phases phases)
|
| 558 | `(modify-phases ,phases
|
| 559 | (add-before 'check 'build-swing
|
| 560 | (lambda _
|
| 561 | (substitute*
|
| 562 | "subprojects/groovy-swing/src/test/groovy/groovy/swing/GroovySwingTestCase.groovy"
|
| 563 | (("HeadlessTestSupport.headless") "isHeadless()"))
|
| 564 | (mkdir-p "build/test-classes")
|
| 565 | (apply invoke "java" "-cp"
|
| 566 | (string-append (getenv "CLASSPATH") ":build/classes")
|
| 567 | "org.codehaus.groovy.tools.FileSystemCompiler" "-cp"
|
| 568 | (string-append (getenv "CLASSPATH") ":build/classes")
|
| 569 | "-d" "build/test-classes" "-j"
|
| 570 | |
| 571 | "-Jsource=1.8" "-Jtarget=1.8"
|
| 572 | (append
|
| 573 | (find-files "subprojects/groovy-swing/src/test/java"
|
| 574 | ".*\\.(groovy|java)$")
|
| 575 | (find-files "subprojects/groovy-swing/src/test/groovy"
|
| 576 | ".*\\.(groovy|java)$")))
|
| 577 | #t))))))
|
| 578 | (inputs
|
| 579 | `(("groovy-swing" ,groovy-swing)
|
| 580 | ("groovy-templates" ,groovy-templates)
|
| 581 | ,@(package-inputs base)))
|
| 582 | (native-inputs
|
| 583 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 584 | ("groovy-test" ,groovy-test)
|
| 585 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 586 | ("java-commons-logging-minimal" ,java-commons-logging-minimal)
|
| 587 | ,@(package-native-inputs base)))
|
| 588 | (synopsis "Groovy graphical interface")
|
| 589 | (description "This package contains a graphical interface to run groovy."))))
|
| 590 |
|
| 591 | (define-public groovy-datetime
|
| 592 | (let ((base (groovy-subproject "groovy-datetime")))
|
| 593 | (package
|
| 594 | (inherit base)
|
| 595 | (native-inputs
|
| 596 | `(("groovy-test" ,groovy-test)
|
| 597 | ,@(package-native-inputs base)))
|
| 598 | (synopsis "Date/Time API for Groovy")
|
| 599 | (description "This package defines new Groovy methods which appear on
|
| 600 | normal JDK Date/Time API (@code{java.time}) classes inside the Groovy
|
| 601 | environment."))))
|
| 602 |
|
| 603 | (define-public groovy-dateutil
|
| 604 | (let ((base (groovy-subproject "groovy-dateutil")))
|
| 605 | (package
|
| 606 | (inherit base)
|
| 607 | (native-inputs
|
| 608 | `(("groovy-test" ,groovy-test)
|
| 609 | ,@(package-native-inputs base)))
|
| 610 | (synopsis "Date and Calendar API for Groovy")
|
| 611 | (description "This package defines new groovy methods which appear on
|
| 612 | normal JDK Date and Calendar classes inside the Groovy environment."))))
|
| 613 |
|
| 614 | (define-public groovy-docgenerator
|
| 615 | (let ((base (groovy-subproject "groovy-docgenerator")))
|
| 616 | (package
|
| 617 | (inherit base)
|
| 618 | (arguments
|
| 619 | `(#:tests? #f; No tests
|
| 620 | ,@(package-arguments base)))
|
| 621 | (inputs
|
| 622 | `(("groovy-templates" ,groovy-templates)
|
| 623 | ("groovy-swing" ,groovy-swing)
|
| 624 | ("java-qdox-1.12" ,java-qdox-1.12)
|
| 625 | ,@(package-inputs base)))
|
| 626 | (native-inputs
|
| 627 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 628 | ("groovy-test" ,groovy-test)
|
| 629 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 630 | ,@(package-native-inputs base)))
|
| 631 | (synopsis "Groovy documentation generation")
|
| 632 | (description "This package contains a command line tool to generate
|
| 633 | documentation for groovy applications."))))
|
| 634 |
|
| 635 | (define-public groovy-groovysh
|
| 636 | (let ((base (groovy-subproject "groovy-groovysh")))
|
| 637 | (package
|
| 638 | (inherit base)
|
| 639 | (inputs
|
| 640 | `(("groovy-xml" ,groovy-xml)
|
| 641 | ("groovy-console" ,groovy-console)
|
| 642 | ,@(package-inputs base)))
|
| 643 | (native-inputs
|
| 644 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 645 | ("groovy-test" ,groovy-test)
|
| 646 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 647 | ,@(package-native-inputs base)))
|
| 648 | (synopsis "Groovy REPL")
|
| 649 | (description "This package contains the Groovy REPL."))))
|
| 650 |
|
| 651 | (define-public groovy-jmx
|
| 652 | (let ((base (groovy-subproject "groovy-jmx")))
|
| 653 | (package
|
| 654 | (inherit base)
|
| 655 | (native-inputs
|
| 656 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 657 | ("groovy-test" ,groovy-test)
|
| 658 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 659 | ,@(package-native-inputs base)))
|
| 660 | (synopsis "Groovy JMX extension")
|
| 661 | (description "This package contains the JMX extension of Groovy, for
|
| 662 | management and monitoring of JVM-based solutions."))))
|
| 663 |
|
| 664 | (define-public groovy-json
|
| 665 | (let ((base (groovy-subproject "groovy-json")))
|
| 666 | (package
|
| 667 | (inherit base)
|
| 668 | (native-inputs
|
| 669 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 670 | ("groovy-test" ,groovy-test)
|
| 671 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 672 | ,@(package-native-inputs base)))
|
| 673 | (synopsis "Groovy JSON")
|
| 674 | (description "This package contains JSON-related utilities for groovy."))))
|
| 675 |
|
| 676 | (define-public groovy-jsr223
|
| 677 | (let ((base (groovy-subproject "groovy-jsr223")))
|
| 678 | (package
|
| 679 | (inherit base)
|
| 680 | (native-inputs
|
| 681 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 682 | ("groovy-test" ,groovy-test)
|
| 683 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 684 | ,@(package-native-inputs base)))
|
| 685 | (synopsis "Groovy's own JSR223 implementation")
|
| 686 | (description "This package contains Groovy's own JSR223 implementation. This
|
| 687 | module is used for interaction between Groovy and Java code."))))
|
| 688 |
|
| 689 | (define-public groovy-nio
|
| 690 | (let ((base (groovy-subproject "groovy-nio")))
|
| 691 | (package
|
| 692 | (inherit base)
|
| 693 | (arguments
|
| 694 | `(#:tests? #f; Require spock-framework
|
| 695 | ,@(package-arguments base)))
|
| 696 | (synopsis "Groovy input-output library")
|
| 697 | (description "This package implements an input/output library that extends
|
| 698 | the functionality of the common library of Java."))))
|
| 699 |
|
| 700 | (define-public groovy-servlet
|
| 701 | (let ((base (groovy-subproject "groovy-servlet")))
|
| 702 | (package
|
| 703 | (inherit base)
|
| 704 | (inputs
|
| 705 | `(("groovy-templates" ,groovy-templates)
|
| 706 | ("groovy-xml" ,groovy-xml)
|
| 707 | ,@(package-inputs base)))
|
| 708 | (native-inputs
|
| 709 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 710 | ("groovy-json" ,groovy-json)
|
| 711 | ("groovy-test" ,groovy-test)
|
| 712 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 713 | ,@(package-native-inputs base)))
|
| 714 | (synopsis "Groovy's servlet implementation")
|
| 715 | (description "This package contains a library to create groovlets, Groovy's
|
| 716 | version of Java servlets."))))
|
| 717 |
|
| 718 | (define-public groovy-sql
|
| 719 | (let ((base (groovy-subproject "groovy-sql")))
|
| 720 | (package
|
| 721 | (inherit base)
|
| 722 | (arguments
|
| 723 | `(#:tests? #f;TODO: Requires hsqldb
|
| 724 | ,@(package-arguments base)))
|
| 725 | (synopsis "Groovy SQL library")
|
| 726 | (description "This package contains a facade over Java's normal JDBC APIs
|
| 727 | providing greatly simplified resource management and result set handling."))))
|
| 728 |
|
| 729 | (define-public groovy-testng
|
| 730 | (let ((base (groovy-subproject "groovy-testng")))
|
| 731 | (package
|
| 732 | (inherit base)
|
| 733 | (native-inputs
|
| 734 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 735 | ("groovy-test" ,groovy-test)
|
| 736 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 737 | ,@(package-native-inputs base)))
|
| 738 | (synopsis "Groovy testing framework")
|
| 739 | (description "This package contains integration code for running TestNG
|
| 740 | tests in Groovy."))))
|
| 741 |
|
| 742 | (define-public groovy-macro
|
| 743 | (let ((base (groovy-subproject "groovy-macro")))
|
| 744 | (package
|
| 745 | (inherit base)
|
| 746 | (arguments
|
| 747 | (substitute-keyword-arguments arguments
|
| 748 | ((#:phases phases)
|
| 749 | `(modify-phases ,phases
|
| 750 | (delete 'copy-resources)
|
| 751 | (add-after 'build 'copy-resources
|
| 752 | (lambda _
|
| 753 | (copy-recursively "subprojects/groovy-macro/src/main/resources"
|
| 754 | "build/classes")
|
| 755 | (substitute* "build.xml"
|
| 756 | (("depends=\"compile,") "depends=\""))
|
| 757 | (invoke "ant" "jar")
|
| 758 | #t))))))
|
| 759 | (inputs
|
| 760 | `(("groovy-templates" ,groovy-templates)
|
| 761 | ("groovy-xml" ,groovy-xml)
|
| 762 | ,@(package-inputs base)))
|
| 763 | (native-inputs
|
| 764 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 765 | ("groovy-json" ,groovy-json)
|
| 766 | ("groovy-test" ,groovy-test)
|
| 767 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap)
|
| 768 | ,@(package-native-inputs base)))
|
| 769 | (synopsis "Groovy macro processor")
|
| 770 | (description "This package contains a high-level library to create macro
|
| 771 | and modify groovy's @dfn{Abstract Syntax Tree} (AST)."))))
|
| 772 |
|
| 773 | (define-public groovy-yaml
|
| 774 | (let ((base (groovy-subproject "groovy-yaml")))
|
| 775 | (package
|
| 776 | (inherit base)
|
| 777 | (inputs
|
| 778 | `(("groovy-json" ,groovy-json)
|
| 779 | ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations)
|
| 780 | ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core)
|
| 781 | ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind)
|
| 782 | ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml)
|
| 783 | ,@(package-inputs base)))
|
| 784 | (native-inputs
|
| 785 | `(("groovy-test" ,groovy-test)
|
| 786 | ,@(package-native-inputs base)))
|
| 787 | (synopsis "Groovy YAML")
|
| 788 | (description "This package contains YAML-related utilities for groovy."))))
|
| 789 |
|
| 790 | (define-public groovy
|
| 791 | (package
|
| 792 | (inherit groovy-bootstrap)
|
| 793 | (name "groovy")
|
| 794 | (arguments
|
| 795 | `(#:tests? #f; No tests
|
| 796 | #:jdk ,openjdk9
|
| 797 | #:phases
|
| 798 | (modify-phases %standard-phases
|
| 799 | (delete 'configure)
|
| 800 | (delete 'build)
|
| 801 | (replace 'install
|
| 802 | (lambda* (#:key outputs inputs #:allow-other-keys)
|
| 803 | (let* ((out (assoc-ref outputs "out"))
|
| 804 | (out-bin (string-append out "/bin"))
|
| 805 | (out-lib (string-append out "/lib")))
|
| 806 | (with-directory-excursion "src/bin"
|
| 807 | (substitute* "startGroovy"
|
| 808 | (("\"\\\\\"") "\"")
|
| 809 | (("\\\\\"\"") "\"")
|
| 810 | (("\\\\\\$") "$")
|
| 811 | (("@GROOVYJAR@") "groovy.jar")
|
| 812 | (("MAX_FD=\"maximum\"")
|
| 813 | (string-append
|
| 814 | "MAX_FD=\"maximum\"\nJAVA_HOME="
|
| 815 | (assoc-ref inputs "jdk"))))
|
| 816 | |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | (mkdir-p out-lib)
|
| 824 | (for-each
|
| 825 | (lambda (input)
|
| 826 | (for-each
|
| 827 | (lambda (jar)
|
| 828 | (symlink jar (string-append out-lib "/" (basename jar))))
|
| 829 | (find-files (assoc-ref inputs input) ".*.jar")))
|
| 830 | '("groovy-bootstrap" "groovy-ant" "groovy-astbuilder"
|
| 831 | "groovy-bsf" "groovy-cli-commons" "groovy-cli-picocli"
|
| 832 | "groovy-console" "groovy-datetime" "groovy-dateutil"
|
| 833 | "groovy-docgenerator" "groovy-groovydoc" "groovy-groovysh"
|
| 834 | "groovy-jmx" "groovy-json" "groovy-jsr223" "groovy-nio"
|
| 835 | "groovy-parser-antlr4" "groovy-servlet" "groovy-sql"
|
| 836 | "groovy-swing" "groovy-templates" "groovy-testng"
|
| 837 | "groovy-xml" "groovy-yaml" "java-commons-cli"
|
| 838 | "java-tunnelvisionlabs-antlr4-runtime" "java-asm"
|
| 839 | "java-asm-analysis" "java-asm-tree" "java-asm-util"
|
| 840 | "java-classpathx-servletapi" "java-xstream" "java-picocli"
|
| 841 | "java-jansi" "java-jline-2"))
|
| 842 | |
| 843 | |
| 844 | (symlink (search-input-file inputs "/lib/antlr.jar")
|
| 845 | (string-append out-lib "/antlr.jar"))
|
| 846 | (for-each
|
| 847 | (lambda (tool)
|
| 848 | (install-file tool out-bin)
|
| 849 | (chmod (string-append out-bin "/" tool) #o755))
|
| 850 | '("grape" "groovy" "groovyc" "groovyConsole" "groovydoc"
|
| 851 | "groovysh" "java2groovy" "startGroovy")))
|
| 852 | (install-file "src/conf/groovy-starter.conf"
|
| 853 | (string-append out "/conf"))
|
| 854 | #t))))))
|
| 855 | (inputs
|
| 856 | `(("groovy-bootstrap" ,groovy-bootstrap)
|
| 857 | ("groovy-ant" ,groovy-ant)
|
| 858 | ("groovy-astbuilder" ,groovy-astbuilder)
|
| 859 | ("groovy-bsf" ,groovy-bsf)
|
| 860 | ("groovy-cli-commons" ,groovy-cli-commons)
|
| 861 | ("groovy-cli-picocli" ,groovy-cli-picocli)
|
| 862 | ("groovy-console" ,groovy-console)
|
| 863 | ("groovy-datetime" ,groovy-datetime)
|
| 864 | ("groovy-dateutil" ,groovy-dateutil)
|
| 865 | ("groovy-docgenerator" ,groovy-docgenerator)
|
| 866 | ("groovy-groovydoc" ,groovy-groovydoc)
|
| 867 | ("groovy-groovysh" ,groovy-groovysh)
|
| 868 | ("groovy-jmx" ,groovy-jmx)
|
| 869 | ("groovy-json" ,groovy-json)
|
| 870 | ("groovy-jsr223" ,groovy-jsr223)
|
| 871 | ("groovy-nio" ,groovy-nio)
|
| 872 | ("groovy-parser-antlr4" ,groovy-parser-antlr4)
|
| 873 | ("groovy-servlet" ,groovy-servlet)
|
| 874 | ("groovy-sql" ,groovy-sql)
|
| 875 | ("groovy-swing" ,groovy-swing)
|
| 876 | ("groovy-templates" ,groovy-templates)
|
| 877 | ("groovy-testng" ,groovy-testng)
|
| 878 | ("groovy-xml" ,groovy-xml)
|
| 879 | ("groovy-yaml" ,groovy-yaml)
|
| 880 | ("java-tunnelvisionlabs-antlr4-runtime"
|
| 881 | ,java-tunnelvisionlabs-antlr4-runtime)
|
| 882 | ("java-commons-cli" ,java-commons-cli)
|
| 883 | ("java-asm" ,java-asm-8)
|
| 884 | ("java-asm-analysis" ,java-asm-analysis-8)
|
| 885 | ("java-asm-tree" ,java-asm-tree-8)
|
| 886 | ("java-asm-util" ,java-asm-util-8)
|
| 887 | ("java-classpathx-servletapi" ,java-classpathx-servletapi)
|
| 888 | ("java-picocli" ,java-picocli)
|
| 889 | ("java-jansi" ,java-jansi)
|
| 890 | ("java-jline-2" ,java-jline-2)
|
| 891 | ("java-xstream" ,java-xstream)
|
| 892 | ("antlr2" ,antlr2)))
|
| 893 | (synopsis "Programming language for the JVM")
|
| 894 | (description "Apache Groovy is a powerful, optionally typed and dynamic
|
| 895 | language, with static-typing and static compilation capabilities, for the Java
|
| 896 | platform. It integrates smoothly with any Java program, and immediately
|
| 897 | delivers to your application powerful features, including scripting
|
| 898 | capabilities, Domain-Specific Language authoring, runtime and compile-time
|
| 899 | meta-programming and functional programming.")
|
| 900 | (properties
|
| 901 | (alist-delete 'hidden? (package-properties groovy-bootstrap)))))
|