groovy.scm
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017, 2018 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 groovy) |
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 utils) |
25 | #:use-module (guix build-system ant) |
26 | #:use-module (gnu packages java) |
27 | #:use-module (gnu packages web) |
28 | #:use-module (gnu packages xml) |
29 | #:use-module (more packages java)) |
30 | |
31 | ;; This package contains the java bootstrap that is used to build groovy submodules. |
32 | (define-public groovy-java-bootstrap |
33 | (package |
34 | (name "groovy-java-bootstrap") |
35 | (version "2.4.14") |
36 | (source (origin |
37 | (method url-fetch) |
38 | (uri (string-append "https://github.com/apache/groovy/archive/GROOVY_" |
39 | (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) |
40 | ".tar.gz")) |
41 | (file-name (string-append name "-" version ".tar.gz")) |
42 | (sha256 |
43 | (base32 |
44 | "0f9z2lj5salxnlpbqvxck55i8xqswq081yldvyjpbsrnpdxm91vz")) |
45 | (patches |
46 | (search-patches |
47 | "groovy-Add-exceptionutilsgenerator.patch")))) |
48 | (build-system ant-build-system) |
49 | (arguments |
50 | `(#:jar-name "groovy.jar" |
51 | #:source-dir "src/main:subprojects/groovy-test/src/main/java" |
52 | #:test-dir "src/test" |
53 | #:tests? #f |
54 | #:jdk ,icedtea-8 |
55 | #:main-class "groovy.ui.GroovyMain" |
56 | #:phases |
57 | (modify-phases %standard-phases |
58 | (add-before 'build 'fix-java8 |
59 | ;; Fix "Reference to plus is ambiguous" |
60 | (lambda _ |
61 | (substitute* "src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java" |
62 | (("toList\\(left\\)") |
63 | "(List<T>)toList(left)")))) |
64 | (add-before 'build 'generate-parsers |
65 | (lambda _ |
66 | (with-directory-excursion "src/main/org/codehaus/groovy/antlr/java" |
67 | (zero? (system* "antlr" "java.g"))) |
68 | (with-directory-excursion "src/main/org/codehaus/groovy/antlr" |
69 | (mkdir "parser") |
70 | (with-directory-excursion "parser" |
71 | (zero? (system* "antlr" "../groovy.g")))))) |
72 | (add-before 'build 'generate-exception-utils |
73 | (lambda _ |
74 | (system* "javac" "-cp" (getenv "CLASSPATH") |
75 | "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java") |
76 | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") |
77 | ":config/ant/src") |
78 | "org.codehaus.groovy.ExceptionUtilsGenerator" |
79 | "build/classes/org/codehaus/groovy/runtime/ExceptionUtils.class"))))))) |
80 | (native-inputs |
81 | `(("java-junit" ,java-junit) |
82 | ("java-hamcrest-core" ,java-hamcrest-core) |
83 | ("antlr2" ,antlr2) |
84 | ("java-jmock-1" ,java-jmock-1) |
85 | ("java-xmlunit-legacy" ,java-xmlunit-legacy))) |
86 | (inputs |
87 | `(("java-commons-cli" ,java-commons-cli) |
88 | ("java-asm" ,java-asm) |
89 | ("java-classpathx-servletapi" ,java-classpathx-servletapi) |
90 | ("java-xstream" ,java-xstream) |
91 | ("java-jansi" ,java-jansi) |
92 | ("java-jline-2" ,java-jline-2))) |
93 | (home-page "http://groovy-lang.org/") |
94 | (synopsis "Programming language for the JVM") |
95 | (description "Apache Groovy is a powerful, optionally typed and dynamic |
96 | language, with static-typing and static compilation capabilities, for the Java |
97 | platform. It integrates smoothly with any Java program, and immediately |
98 | delivers to your application powerful features, including scripting |
99 | capabilities, Domain-Specific Language authoring, runtime and compile-time |
100 | meta-programming and functional programming.") |
101 | (license (list license:gpl2 |
102 | license:cddl1.1)))) |
103 | |
104 | (define-public groovy-bootstrap |
105 | (package |
106 | (inherit groovy-java-bootstrap) |
107 | (name "groovy-bootstrap") |
108 | (arguments |
109 | `(#:jar-name "groovy.jar" |
110 | #:jdk ,icedtea-8 |
111 | ;Requires groovy-xml and logback-classic which are circular dependencies |
112 | #:tests? #f |
113 | #:phases |
114 | (modify-phases %standard-phases |
115 | (add-before 'build 'fix-java8 |
116 | ;; Fix "Reference to plus is ambiguous" |
117 | (lambda _ |
118 | (substitute* "src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java" |
119 | (("toList\\(left\\)") |
120 | "(List<T>)toList(left)")))) |
121 | (add-before 'build 'generate-parser |
122 | (lambda _ |
123 | (with-directory-excursion "src/main/org/codehaus/groovy/antlr/java" |
124 | (zero? (system* "antlr" "java.g"))) |
125 | (with-directory-excursion "src/main/org/codehaus/groovy/antlr" |
126 | (mkdir "parser") |
127 | (with-directory-excursion "parser" |
128 | (zero? (system* "antlr" "../groovy.g")))))) |
129 | (add-before 'build 'generate-exception-utils |
130 | (lambda _ |
131 | (system* "javac" "-cp" (getenv "CLASSPATH") |
132 | "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java") |
133 | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") |
134 | ":config/ant/src") |
135 | "org.codehaus.groovy.ExceptionUtilsGenerator" |
136 | "target/classes/org/codehaus/groovy/runtime/ExceptionUtils.class")))) |
137 | (add-before 'build 'generate-dgminfo |
138 | (lambda _ |
139 | (mkdir-p "target/classes/org/codehaus/groovy/runtime") |
140 | (mkdir-p "target/classes/META-INF") |
141 | (system* "javac" "-cp" (getenv "CLASSPATH") |
142 | "src/main/org/codehaus/groovy/tools/DgmConverter.java") |
143 | (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH") |
144 | ":src/main") |
145 | "org.codehaus.groovy.tools.DgmConverter")))) |
146 | (add-before 'build 'copy-resources |
147 | (lambda _ |
148 | (with-directory-excursion "src/main" |
149 | (for-each (lambda (file) |
150 | (mkdir-p (string-append "../../target/classes/" |
151 | (dirname file))) |
152 | (copy-file file |
153 | (string-append "../../target/classes/" |
154 | file))) |
155 | (find-files "." ".*.(txt|properties|xml|html)"))))) |
156 | (replace 'build |
157 | (lambda _ |
158 | (mkdir-p "build/jar") |
159 | (and |
160 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
161 | "org.codehaus.groovy.tools.FileSystemCompiler" |
162 | "-d" "target/classes" |
163 | "-j"; joint compilation |
164 | (find-files "src/main" |
165 | ".*\\.(groovy|java)$"))) |
166 | (zero? (system* "jar" "-cf" "build/jar/groovy.jar" |
167 | "-C" "target/classes" ".")))))))) |
168 | (inputs |
169 | `(("java-apache-ivy-bootstrap" ,java-apache-ivy-bootstrap) |
170 | ,@(package-inputs groovy-java-bootstrap))) |
171 | (native-inputs |
172 | `(("groovy-java-bootstrap" ,groovy-java-bootstrap) |
173 | ,@(package-native-inputs groovy-java-bootstrap))))) |
174 | |
175 | ;; Common test classes |
176 | (define-public groovy-tests-bootstrap |
177 | (package |
178 | (inherit groovy-bootstrap) |
179 | (name "groovy-tests-bootstrap") |
180 | (arguments |
181 | `(#:jar-name "groovy-tests-bootstrap.jar" |
182 | #:jdk ,icedtea-8 |
183 | #:tests? #f; no tests |
184 | #:phases |
185 | (modify-phases %standard-phases |
186 | (replace 'build |
187 | (lambda _ |
188 | (mkdir-p "build/classes") |
189 | (mkdir-p "build/jar") |
190 | (and |
191 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
192 | "org.codehaus.groovy.tools.FileSystemCompiler" |
193 | "-d" "build/classes" |
194 | "-j"; joint compilation |
195 | (append |
196 | (find-files "src/test" "TestSupport.java") |
197 | (find-files "src/test" "HeadlessTestSupport.java") |
198 | (find-files "src/test" "XmlAssert.java")))) |
199 | (zero? (system* "jar" "-cf" "build/jar/groovy-tests-bootstrap.jar" |
200 | "-C" "build/classes" ".")))))))) |
201 | (inputs |
202 | `(("groovy-test" ,groovy-test) |
203 | ,@(package-inputs groovy-bootstrap))) |
204 | (native-inputs |
205 | `(("groovy-bootstrap" ,groovy-bootstrap) |
206 | ,@(package-native-inputs groovy-java-bootstrap))))) |
207 | |
208 | ; for groovy-3.0.0 |
209 | ;(define-public groovy-parser-antlr4 |
210 | ; (package |
211 | ; (inherit groovy-java-bootstrap) |
212 | ; (name "groovy-parser-antlr4") |
213 | ; (arguments |
214 | ; `(#:jar-name "groovy-parser-antlr4.jar" |
215 | ; #:jdk ,icedtea-8 |
216 | ; #:test-dir "subprojects/parser-antlr4/src/test" |
217 | ; #:source-dir "subprojects/parser-antlr4/src/main/java" |
218 | ; #:phases |
219 | ; (modify-phases %standard-phases |
220 | ; (add-before 'build 'generate-parser |
221 | ; (lambda _ |
222 | ; (with-directory-excursion "src/antlr" |
223 | ; (zero? (system* "antlr4" "-visitor" "-no-listener" "-package" |
224 | ; "org.apache.groovy.parser.antlr4" |
225 | ; "-o" "../../subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4" |
226 | ; "GroovyLexer.g4")) |
227 | ; (zero? (system* "antlr4" "-visitor" "-no-listener" "-package" |
228 | ; "org.apache.groovy.parser.antlr4" |
229 | ; "-o" "../../subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4" |
230 | ; "GroovyParser.g4")))))))) |
231 | ; ;"-lib" "src/antlr" "-Xlog"))))))) |
232 | ; (inputs |
233 | ; `(("groovy-java-bootstrap" ,groovy-java-bootstrap) |
234 | ; ("java-antlr4" ,java-antlr4) |
235 | ; ("java-antlr4-runtime" ,java-antlr4-runtime) |
236 | ; ,@(package-inputs groovy-java-bootstrap))))) |
237 | |
238 | (define-public groovy-test |
239 | (package |
240 | (inherit groovy-bootstrap) |
241 | (name "groovy-test") |
242 | (arguments |
243 | `(#:jar-name "groovy-test.jar" |
244 | #:jdk ,icedtea-8 |
245 | #:test-dir "subprojects/groovy-test/src/test" |
246 | #:phases |
247 | (modify-phases %standard-phases |
248 | (replace 'build |
249 | (lambda _ |
250 | (mkdir-p "build/classes") |
251 | (mkdir-p "build/jar") |
252 | (and |
253 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
254 | "org.codehaus.groovy.tools.FileSystemCompiler" |
255 | "-d" "build/classes" |
256 | "-j"; joint compilation |
257 | (find-files "subprojects/groovy-test/src/main" |
258 | ".*\\.(groovy|java)$"))) |
259 | (zero? (system* "jar" "-cf" "build/jar/groovy-test.jar" |
260 | "-C" "build/classes" "."))))) |
261 | (replace 'check |
262 | (lambda _ |
263 | (mkdir-p "build/test-classes") |
264 | (substitute* "build.xml" |
265 | (("depends=\"compile-tests\"") "depends=\"\"") |
266 | (("}/java") "}/groovy")) |
267 | (zero? (apply system* "java" "-cp" |
268 | (string-append (getenv "CLASSPATH") ":build/classes") |
269 | "org.codehaus.groovy.tools.FileSystemCompiler" |
270 | "-d" "build/test-classes" |
271 | "-j" |
272 | (append |
273 | (find-files "subprojects/groovy-test/src/test" |
274 | ".*\\.(groovy|java)$")))) |
275 | (zero? (system* "ant" "check"))))))) |
276 | (native-inputs |
277 | `(("groovy-bootstrap" ,groovy-bootstrap) |
278 | ,@(package-native-inputs groovy-java-bootstrap))))) |
279 | |
280 | (define-public groovy-xml |
281 | (package |
282 | (inherit groovy-bootstrap) |
283 | (name "groovy-xml") |
284 | (arguments |
285 | `(#:jar-name "groovy-xml.jar" |
286 | #:jdk ,icedtea-8 |
287 | #:test-dir "src/test" |
288 | #:phases |
289 | (modify-phases %standard-phases |
290 | (add-before 'configure 'chdir |
291 | (lambda _ |
292 | (chdir "subprojects/groovy-xml"))) |
293 | (replace 'build |
294 | (lambda _ |
295 | (mkdir-p "build/classes") |
296 | (mkdir-p "build/jar") |
297 | (and |
298 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
299 | "org.codehaus.groovy.tools.FileSystemCompiler" |
300 | "-d" "build/classes" |
301 | "-j"; joint compilation |
302 | (find-files "src/main" |
303 | ".*\\.(groovy|java)$"))) |
304 | (zero? (system* "jar" "-cf" "build/jar/groovy-xml.jar" |
305 | "-C" "build/classes" "."))))) |
306 | (replace 'check |
307 | (lambda _ |
308 | (mkdir-p "build/test-classes") |
309 | (substitute* "build.xml" |
310 | (("depends=\"compile-tests\"") "depends=\"\"") |
311 | (("}/java") "}/groovy")) |
312 | (and |
313 | (zero? (apply system* "java" "-cp" |
314 | (string-append (getenv "CLASSPATH") ":build/classes") |
315 | "org.codehaus.groovy.tools.FileSystemCompiler" |
316 | "-d" "build/test-classes" |
317 | "-j" |
318 | (append |
319 | (find-files "src/test" |
320 | ".*\\.(groovy|java)$")))) |
321 | (zero? (system* "ant" "check")))))))) |
322 | (native-inputs |
323 | `(("groovy-bootstrap" ,groovy-bootstrap) |
324 | ("groovy-test" ,groovy-test) |
325 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
326 | ,@(package-native-inputs groovy-java-bootstrap))))) |
327 | |
328 | (define-public groovy-templates |
329 | (package |
330 | (inherit groovy-bootstrap) |
331 | (name "groovy-templates") |
332 | (arguments |
333 | `(#:jar-name "groovy-templates.jar" |
334 | #:jdk ,icedtea-8 |
335 | #:test-dir "subprojects/groovy-templates/src/test" |
336 | #:tests? #f;Requires spock-framework which is a circular dependency |
337 | #:phases |
338 | (modify-phases %standard-phases |
339 | (replace 'build |
340 | (lambda _ |
341 | (mkdir-p "build/classes") |
342 | (mkdir-p "build/jar") |
343 | (and |
344 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
345 | "org.codehaus.groovy.tools.FileSystemCompiler" |
346 | "-d" "build/classes" |
347 | "-j"; joint compilation |
348 | (find-files "subprojects/groovy-templates/src/main" |
349 | ".*\\.(groovy|java)$"))) |
350 | (zero? (system* "jar" "-cf" "build/jar/groovy-templates.jar" |
351 | "-C" "build/classes" ".")))))))) |
352 | (inputs |
353 | `(("groovy-xml" ,groovy-xml) |
354 | ,@(package-inputs groovy-bootstrap))) |
355 | (native-inputs |
356 | `(("groovy-bootstrap" ,groovy-bootstrap) |
357 | ("groovy-test" ,groovy-test) |
358 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
359 | ,@(package-native-inputs groovy-java-bootstrap))))) |
360 | |
361 | (define-public groovy-groovydoc |
362 | (package |
363 | (inherit groovy-bootstrap) |
364 | (name "groovy-groovydoc") |
365 | (arguments |
366 | `(#:jar-name "groovy-groovydoc.jar" |
367 | #:jdk ,icedtea-8 |
368 | #:test-dir "subprojects/groovy-groovydoc/src/test" |
369 | #:tests? #f; Requires groovy-ant which is a circular dependency |
370 | #:phases |
371 | (modify-phases %standard-phases |
372 | (add-before 'build 'copy-resources |
373 | (lambda _ |
374 | (copy-recursively "subprojects/groovy-groovydoc/src/main/resources" |
375 | "build/classes"))) |
376 | (replace 'build |
377 | (lambda _ |
378 | (mkdir-p "build/classes") |
379 | (mkdir-p "build/jar") |
380 | (and |
381 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
382 | "org.codehaus.groovy.tools.FileSystemCompiler" |
383 | "-d" "build/classes" |
384 | "-j"; joint compilation |
385 | (find-files "subprojects/groovy-groovydoc/src/main" |
386 | ".*\\.(groovy|java)$"))) |
387 | (zero? (system* "jar" "-cf" "build/jar/groovy-groovydoc.jar" |
388 | "-C" "build/classes" ".")))))))) |
389 | (inputs |
390 | `(("groovy-templates" ,groovy-templates) |
391 | ,@(package-inputs groovy-bootstrap))) |
392 | (native-inputs |
393 | `(("groovy-bootstrap" ,groovy-bootstrap) |
394 | ("groovy-test" ,groovy-test) |
395 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
396 | ,@(package-native-inputs groovy-java-bootstrap))))) |
397 | |
398 | (define-public groovy-ant |
399 | (package |
400 | (inherit groovy-bootstrap) |
401 | (name "groovy-ant") |
402 | (arguments |
403 | `(#:jar-name "groovy-ant.jar" |
404 | #:jdk ,icedtea-8 |
405 | #:test-dir "src/test" |
406 | ;; FIXME: Excluding all tests because they fail |
407 | #:test-exclude (list |
408 | "**/GroovyTest.java" |
409 | "**/GroovycTest.java") |
410 | #:phases |
411 | (modify-phases %standard-phases |
412 | (add-before 'configure 'chdir |
413 | (lambda _ |
414 | (chdir "subprojects/groovy-ant"))) |
415 | (add-before 'build 'copy-resources |
416 | (lambda _ |
417 | (copy-recursively "src/main/resources" "build/classes"))) |
418 | (replace 'build |
419 | (lambda _ |
420 | (mkdir-p "build/classes") |
421 | (mkdir-p "build/jar") |
422 | (and |
423 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
424 | "org.codehaus.groovy.tools.FileSystemCompiler" |
425 | "-d" "build/classes" |
426 | "-j"; joint compilation |
427 | (find-files "src/main" |
428 | ".*\\.(groovy|java)$"))) |
429 | (zero? (system* "jar" "-cf" "build/jar/groovy-ant.jar" |
430 | "-C" "build/classes" "."))))) |
431 | (replace 'check |
432 | (lambda _ |
433 | (mkdir-p "build/test-classes") |
434 | (substitute* "build.xml" |
435 | (("depends=\"compile-tests\"") "depends=\"\"") |
436 | (("}/java") "}/groovy")) |
437 | (and |
438 | (zero? (apply system* "java" "-cp" |
439 | (string-append (getenv "CLASSPATH") ":build/classes") |
440 | "org.codehaus.groovy.tools.FileSystemCompiler" |
441 | "-d" "build/test-classes" |
442 | "-j" |
443 | (find-files "src/test" |
444 | ".*\\.(groovy|java)$"))) |
445 | (zero? (system* "ant" "check")))))))) |
446 | (inputs |
447 | `(("groovy-groovydoc" ,groovy-groovydoc) |
448 | ,@(package-inputs groovy-bootstrap))) |
449 | (native-inputs |
450 | `(("groovy-bootstrap" ,groovy-bootstrap) |
451 | ("groovy-xml" ,groovy-xml) |
452 | ("groovy-test" ,groovy-test) |
453 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
454 | ,@(package-native-inputs groovy-java-bootstrap))))) |
455 | |
456 | (define-public groovy-bsf |
457 | (package |
458 | (inherit groovy-bootstrap) |
459 | (name "groovy-bsf") |
460 | (arguments |
461 | `(#:jar-name "groovy-bsf.jar" |
462 | #:jdk ,icedtea-8 |
463 | #:test-dir "src/test" |
464 | #:test-exclude (list |
465 | ;; exception from Groovy: org.codehaus.groovy.runtime.InvokerInvocationException: |
466 | ;; groovy.lang.MissingMethodException: No signature of method: |
467 | ;; java.util.ArrayList.each() is applicable for argument types: |
468 | ;; (groovy.script.MapFromList$_doit_closure1) values: |
469 | ;; [groovy.script.MapFromList$_doit_closure1@17e554d5] |
470 | "**/BSFTest.java") |
471 | #:phases |
472 | (modify-phases %standard-phases |
473 | (add-before 'configure 'chdir |
474 | (lambda _ |
475 | (chdir "subprojects/groovy-bsf"))) |
476 | (replace 'build |
477 | (lambda _ |
478 | (mkdir-p "build/classes") |
479 | (mkdir-p "build/jar") |
480 | (and |
481 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
482 | "org.codehaus.groovy.tools.FileSystemCompiler" |
483 | "-d" "build/classes" |
484 | "-j"; joint compilation |
485 | (find-files "src/main" |
486 | ".*\\.(groovy|java)$"))) |
487 | (zero? (system* "jar" "-cf" "build/jar/groovy-bsf.jar" |
488 | "-C" "build/classes" "."))))) |
489 | (replace 'check |
490 | (lambda _ |
491 | (mkdir-p "build/test-classes") |
492 | (substitute* "build.xml" |
493 | (("depends=\"compile-tests\"") "depends=\"\"")) |
494 | (and |
495 | (zero? (apply system* "java" "-cp" |
496 | (string-append (getenv "CLASSPATH") ":build/classes") |
497 | "org.codehaus.groovy.tools.FileSystemCompiler" |
498 | "-d" "build/test-classes" |
499 | "-j" |
500 | (find-files "src/test" |
501 | ".*\\.(groovy|java)$"))) |
502 | (zero? (system* "ant" "check")))))))) |
503 | (inputs |
504 | `(("java-commons-bsf" ,java-commons-bsf) |
505 | ,@(package-inputs groovy-bootstrap))) |
506 | (native-inputs |
507 | `(("groovy-bootstrap" ,groovy-bootstrap) |
508 | ("groovy-test" ,groovy-test) |
509 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
510 | ("java-commons-logging-minimal" ,java-commons-logging-minimal) |
511 | ,@(package-native-inputs groovy-java-bootstrap))))) |
512 | |
513 | (define-public groovy-swing |
514 | (package |
515 | (inherit groovy-bootstrap) |
516 | (name "groovy-swing") |
517 | (arguments |
518 | `(#:jar-name "groovy-swing.jar" |
519 | #:jdk ,icedtea-8 |
520 | ;; FIXME: tests are not run |
521 | #:test-dir "src/test" |
522 | #:phases |
523 | (modify-phases %standard-phases |
524 | (add-before 'configure 'chdir |
525 | (lambda _ |
526 | (chdir "subprojects/groovy-swing"))) |
527 | (replace 'build |
528 | (lambda _ |
529 | (mkdir-p "build/classes") |
530 | (mkdir-p "build/jar") |
531 | (and |
532 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
533 | "org.codehaus.groovy.tools.FileSystemCompiler" |
534 | "-d" "build/classes" |
535 | "-j"; joint compilation |
536 | (find-files "src/main" |
537 | ".*\\.(groovy|java)$"))) |
538 | (zero? (system* "jar" "-cf" "build/jar/groovy-swing.jar" |
539 | "-C" "build/classes" "."))))) |
540 | (replace 'check |
541 | (lambda _ |
542 | (mkdir-p "build/test-classes") |
543 | (substitute* "src/test/groovy/groovy/util/GroovySwingTestCase.groovy" |
544 | (("HeadlessTestSupport.headless") "isHeadless()")) |
545 | (substitute* "build.xml" |
546 | (("depends=\"compile-tests\"") "depends=\"\"") |
547 | (("}/java") "}/groovy")) |
548 | (and |
549 | (zero? (apply system* "java" "-cp" |
550 | (string-append (getenv "CLASSPATH") ":build/classes") |
551 | "org.codehaus.groovy.tools.FileSystemCompiler" |
552 | "-d" "build/test-classes" |
553 | "-j" |
554 | (find-files "src/test" |
555 | ".*\\.(groovy|java)$"))) |
556 | (zero? (system* "ant" "check")))))))) |
557 | (native-inputs |
558 | `(("groovy-bootstrap" ,groovy-bootstrap) |
559 | ("groovy-test" ,groovy-test) |
560 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
561 | ("java-commons-logging-minimal" ,java-commons-logging-minimal) |
562 | ,@(package-native-inputs groovy-java-bootstrap))))) |
563 | |
564 | (define-public groovy-console |
565 | (package |
566 | (inherit groovy-bootstrap) |
567 | (name "groovy-console") |
568 | (arguments |
569 | `(#:jar-name "groovy-console.jar" |
570 | #:jdk ,icedtea-8 |
571 | ;; FIXME: tests are not run |
572 | #:test-dir "src/test" |
573 | #:phases |
574 | (modify-phases %standard-phases |
575 | (add-before 'configure 'chdir |
576 | (lambda _ |
577 | (chdir "subprojects/groovy-console"))) |
578 | (add-before 'build 'copy-resources |
579 | (lambda _ |
580 | (copy-recursively "src/main/resources" "build/classes"))) |
581 | (replace 'build |
582 | (lambda _ |
583 | (mkdir-p "build/classes") |
584 | (mkdir-p "build/jar") |
585 | (and |
586 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
587 | "org.codehaus.groovy.tools.FileSystemCompiler" |
588 | "-d" "build/classes" |
589 | "-j"; joint compilation |
590 | (find-files "src/main" |
591 | ".*\\.(groovy|java)$"))) |
592 | (zero? (system* "jar" "-cf" "build/jar/groovy-console.jar" |
593 | "-C" "build/classes" "."))))) |
594 | (replace 'check |
595 | (lambda _ |
596 | (mkdir-p "build/test-classes") |
597 | (substitute* "build.xml" |
598 | (("depends=\"compile-tests\"") "depends=\"\"") |
599 | (("}/java") "}/groovy")) |
600 | (substitute* |
601 | "../groovy-swing/src/test/groovy/groovy/util/GroovySwingTestCase.groovy" |
602 | (("HeadlessTestSupport.headless") "isHeadless()")) |
603 | (and |
604 | (zero? (apply system* "java" "-cp" |
605 | (string-append (getenv "CLASSPATH") ":build/classes") |
606 | "org.codehaus.groovy.tools.FileSystemCompiler" |
607 | "-d" "build/test-classes" |
608 | "-j" |
609 | (append |
610 | (find-files "../groovy-swing/src/test" |
611 | ".*\\.(groovy|java)$") |
612 | (find-files "src/test" |
613 | ".*\\.(groovy|java)$")))) |
614 | (zero? (system* "ant" "check")))))))) |
615 | (inputs |
616 | `(("groovy-swing" ,groovy-swing) |
617 | ("groovy-templates" ,groovy-templates) |
618 | ,@(package-inputs groovy-bootstrap))) |
619 | (native-inputs |
620 | `(("groovy-bootstrap" ,groovy-bootstrap) |
621 | ("groovy-test" ,groovy-test) |
622 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
623 | ("java-commons-logging-minimal" ,java-commons-logging-minimal) |
624 | ,@(package-native-inputs groovy-java-bootstrap))))) |
625 | |
626 | (define-public groovy-docgenerator |
627 | (package |
628 | (inherit groovy-bootstrap) |
629 | (name "groovy-docgenerator") |
630 | (arguments |
631 | `(#:jar-name "groovy-docgenerator.jar" |
632 | #:jdk ,icedtea-8 |
633 | #:tests? #f; No tests |
634 | #:phases |
635 | (modify-phases %standard-phases |
636 | (add-before 'configure 'chdir |
637 | (lambda _ |
638 | (chdir "subprojects/groovy-docgenerator"))) |
639 | (add-before 'build 'copy-resources |
640 | (lambda _ |
641 | (copy-recursively "src/main/resources" "build/classes"))) |
642 | (replace 'build |
643 | (lambda _ |
644 | (mkdir-p "build/classes") |
645 | (mkdir-p "build/jar") |
646 | (and |
647 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
648 | "org.codehaus.groovy.tools.FileSystemCompiler" |
649 | "-d" "build/classes" |
650 | "-j"; joint compilation |
651 | (find-files "src/main" |
652 | ".*\\.(groovy|java)$"))) |
653 | (zero? (system* "jar" "-cf" "build/jar/groovy-docgenerator.jar" |
654 | "-C" "build/classes" ".")))))))) |
655 | (inputs |
656 | `(("groovy-templates" ,groovy-templates) |
657 | ("groovy-swing" ,groovy-swing) |
658 | ("java-qdox-1.12" ,java-qdox-1.12) |
659 | ,@(package-inputs groovy-bootstrap))) |
660 | (native-inputs |
661 | `(("groovy-bootstrap" ,groovy-bootstrap) |
662 | ("groovy-test" ,groovy-test) |
663 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
664 | ,@(package-native-inputs groovy-java-bootstrap))))) |
665 | |
666 | (define-public groovy-groovysh |
667 | (package |
668 | (inherit groovy-bootstrap) |
669 | (name "groovy-groovysh") |
670 | (arguments |
671 | `(#:jar-name "groovy-groovysh.jar" |
672 | #:test-dir "src/test" |
673 | #:jdk ,icedtea-8 |
674 | #:phases |
675 | (modify-phases %standard-phases |
676 | (add-before 'configure 'chdir |
677 | (lambda _ |
678 | (chdir "subprojects/groovy-groovysh"))) |
679 | (add-before 'build 'copy-resources |
680 | (lambda _ |
681 | (copy-recursively "src/main/resources" "build/classes"))) |
682 | (replace 'build |
683 | (lambda _ |
684 | (mkdir-p "build/classes") |
685 | (mkdir-p "build/jar") |
686 | (and |
687 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
688 | "org.codehaus.groovy.tools.FileSystemCompiler" |
689 | "-d" "build/classes" |
690 | "-j"; joint compilation |
691 | (find-files "src/main" |
692 | ".*\\.(groovy|java)$"))) |
693 | (zero? (system* "jar" "-cf" "build/jar/groovy-groovysh.jar" |
694 | "-C" "build/classes" "."))))) |
695 | (replace 'check |
696 | (lambda _ |
697 | (mkdir-p "build/test-classes") |
698 | (substitute* "build.xml" |
699 | (("depends=\"compile-tests\"") "depends=\"\"") |
700 | (("}/java") "}/groovy")) |
701 | (and |
702 | (zero? (apply system* "java" "-cp" |
703 | (string-append (getenv "CLASSPATH") ":build/classes") |
704 | "org.codehaus.groovy.tools.FileSystemCompiler" |
705 | "-d" "build/test-classes" |
706 | "-j" |
707 | (append |
708 | (find-files "src/test" |
709 | ".*\\.(groovy|java)$")))) |
710 | (zero? (system* "ant" "check")))))))) |
711 | (inputs |
712 | `(("groovy-xml" ,groovy-xml) |
713 | ("groovy-console" ,groovy-console) |
714 | ,@(package-inputs groovy-bootstrap))) |
715 | (native-inputs |
716 | `(("groovy-bootstrap" ,groovy-bootstrap) |
717 | ("groovy-test" ,groovy-test) |
718 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
719 | ,@(package-native-inputs groovy-java-bootstrap))))) |
720 | |
721 | (define-public groovy-jmx |
722 | (package |
723 | (inherit groovy-bootstrap) |
724 | (name "groovy-jmx") |
725 | (arguments |
726 | `(#:jar-name "groovy-jmx.jar" |
727 | #:test-dir "src/test" |
728 | #:jdk ,icedtea-8 |
729 | #:phases |
730 | (modify-phases %standard-phases |
731 | (add-before 'configure 'chdir |
732 | (lambda _ |
733 | (chdir "subprojects/groovy-jmx"))) |
734 | (replace 'build |
735 | (lambda _ |
736 | (mkdir-p "build/classes") |
737 | (mkdir-p "build/jar") |
738 | (and |
739 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
740 | "org.codehaus.groovy.tools.FileSystemCompiler" |
741 | "-d" "build/classes" |
742 | "-j"; joint compilation |
743 | (find-files "src/main" |
744 | ".*\\.(groovy|java)$"))) |
745 | (zero? (system* "jar" "-cf" "build/jar/groovy-jmx.jar" |
746 | "-C" "build/classes" "."))))) |
747 | (replace 'check |
748 | (lambda _ |
749 | (mkdir-p "build/test-classes") |
750 | (substitute* "build.xml" |
751 | (("depends=\"compile-tests\"") "depends=\"\"") |
752 | (("}/java") "}/groovy")) |
753 | (and |
754 | (zero? (apply system* "java" "-cp" |
755 | (string-append (getenv "CLASSPATH") ":build/classes") |
756 | "org.codehaus.groovy.tools.FileSystemCompiler" |
757 | "-d" "build/test-classes" |
758 | "-j" |
759 | (append |
760 | (find-files "src/test" |
761 | ".*\\.(groovy|java)$")))) |
762 | (zero? (system* "ant" "check")))))))) |
763 | (native-inputs |
764 | `(("groovy-bootstrap" ,groovy-bootstrap) |
765 | ("groovy-test" ,groovy-test) |
766 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
767 | ,@(package-native-inputs groovy-java-bootstrap))))) |
768 | |
769 | (define-public groovy-json |
770 | (package |
771 | (inherit groovy-bootstrap) |
772 | (name "groovy-json") |
773 | (arguments |
774 | `(#:jar-name "groovy-json.jar" |
775 | #:test-dir "src/test" |
776 | #:jdk ,icedtea-8 |
777 | #:phases |
778 | (modify-phases %standard-phases |
779 | (add-before 'configure 'chdir |
780 | (lambda _ |
781 | (chdir "subprojects/groovy-json"))) |
782 | (replace 'build |
783 | (lambda _ |
784 | (mkdir-p "build/classes") |
785 | (mkdir-p "build/jar") |
786 | (and |
787 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
788 | "org.codehaus.groovy.tools.FileSystemCompiler" |
789 | "-d" "build/classes" |
790 | "-j"; joint compilation |
791 | (find-files "src/main" |
792 | ".*\\.(groovy|java)$"))) |
793 | (zero? (system* "jar" "-cf" "build/jar/groovy-json.jar" |
794 | "-C" "build/classes" "."))))) |
795 | (replace 'check |
796 | (lambda _ |
797 | (mkdir-p "build/test-classes") |
798 | (substitute* "build.xml" |
799 | (("depends=\"compile-tests\"") "depends=\"\"") |
800 | (("}/java") "}/groovy")) |
801 | (and |
802 | (zero? (apply system* "java" "-cp" |
803 | (string-append (getenv "CLASSPATH") ":build/classes") |
804 | "org.codehaus.groovy.tools.FileSystemCompiler" |
805 | "-d" "build/test-classes" |
806 | "-j" |
807 | (append |
808 | (find-files "src/test" |
809 | ".*\\.(groovy|java)$")))) |
810 | (zero? (system* "ant" "check")))))))) |
811 | (native-inputs |
812 | `(("groovy-bootstrap" ,groovy-bootstrap) |
813 | ("groovy-test" ,groovy-test) |
814 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
815 | ,@(package-native-inputs groovy-java-bootstrap))))) |
816 | |
817 | (define-public groovy-jsr223 |
818 | (package |
819 | (inherit groovy-bootstrap) |
820 | (name "groovy-jsr223") |
821 | (arguments |
822 | `(#:jar-name "groovy-jsr223.jar" |
823 | #:test-dir "src/test" |
824 | #:jdk ,icedtea-8 |
825 | #:phases |
826 | (modify-phases %standard-phases |
827 | (add-before 'configure 'chdir |
828 | (lambda _ |
829 | (chdir "subprojects/groovy-jsr223"))) |
830 | (add-before 'build 'copy-resources |
831 | (lambda _ |
832 | (copy-recursively "src/main/resources" "build/classes"))) |
833 | (replace 'build |
834 | (lambda _ |
835 | (mkdir-p "build/classes") |
836 | (mkdir-p "build/jar") |
837 | (and |
838 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
839 | "org.codehaus.groovy.tools.FileSystemCompiler" |
840 | "-d" "build/classes" |
841 | "-j"; joint compilation |
842 | (find-files "src/main" |
843 | ".*\\.(groovy|java)$"))) |
844 | (zero? (system* "jar" "-cf" "build/jar/groovy-jsr223.jar" |
845 | "-C" "build/classes" "."))))) |
846 | (replace 'check |
847 | (lambda _ |
848 | (mkdir-p "build/test-classes") |
849 | (substitute* "build.xml" |
850 | (("depends=\"compile-tests\"") "depends=\"\"") |
851 | (("}/java") "}/groovy")) |
852 | (and |
853 | (zero? (apply system* "java" "-cp" |
854 | (string-append (getenv "CLASSPATH") ":build/classes") |
855 | "org.codehaus.groovy.tools.FileSystemCompiler" |
856 | "-d" "build/test-classes" |
857 | "-j" |
858 | (append |
859 | (find-files "src/test" |
860 | ".*\\.(groovy|java)$")))) |
861 | (zero? (system* "ant" "check")))))))) |
862 | (native-inputs |
863 | `(("groovy-bootstrap" ,groovy-bootstrap) |
864 | ("groovy-test" ,groovy-test) |
865 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
866 | ,@(package-native-inputs groovy-java-bootstrap))))) |
867 | |
868 | (define-public groovy-nio |
869 | (package |
870 | (inherit groovy-bootstrap) |
871 | (name "groovy-nio") |
872 | (arguments |
873 | `(#:jar-name "groovy-nio.jar" |
874 | #:test-dir "src/test" |
875 | #:jdk ,icedtea-8 |
876 | #:tests? #f; Requires spock-framework |
877 | #:phases |
878 | (modify-phases %standard-phases |
879 | (add-before 'configure 'chdir |
880 | (lambda _ |
881 | (chdir "subprojects/groovy-nio"))) |
882 | (replace 'build |
883 | (lambda _ |
884 | (mkdir-p "build/classes") |
885 | (mkdir-p "build/jar") |
886 | (and |
887 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
888 | "org.codehaus.groovy.tools.FileSystemCompiler" |
889 | "-d" "build/classes" |
890 | "-j"; joint compilation |
891 | (find-files "src/main" |
892 | ".*\\.(groovy|java)$"))) |
893 | (zero? (system* "jar" "-cf" "build/jar/groovy-nio.jar" |
894 | "-C" "build/classes" ".")))))))) |
895 | (native-inputs |
896 | `(("groovy-bootstrap" ,groovy-bootstrap) |
897 | ("groovy-test" ,groovy-test) |
898 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
899 | ,@(package-native-inputs groovy-java-bootstrap))))) |
900 | |
901 | (define-public groovy-servlet |
902 | (package |
903 | (inherit groovy-bootstrap) |
904 | (name "groovy-servlet") |
905 | (arguments |
906 | `(#:jar-name "groovy-servlet.jar" |
907 | #:test-dir "src/test" |
908 | #:jdk ,icedtea-8 |
909 | #:phases |
910 | (modify-phases %standard-phases |
911 | (add-before 'configure 'chdir |
912 | (lambda _ |
913 | (chdir "subprojects/groovy-servlet"))) |
914 | (replace 'build |
915 | (lambda _ |
916 | (mkdir-p "build/classes") |
917 | (mkdir-p "build/jar") |
918 | (and |
919 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
920 | "org.codehaus.groovy.tools.FileSystemCompiler" |
921 | "-d" "build/classes" |
922 | "-j"; joint compilation |
923 | (find-files "src/main" |
924 | ".*\\.(groovy|java)$"))) |
925 | (zero? (system* "jar" "-cf" "build/jar/groovy-servlet.jar" |
926 | "-C" "build/classes" "."))))) |
927 | (replace 'check |
928 | (lambda _ |
929 | (mkdir-p "build/test-classes") |
930 | (substitute* "build.xml" |
931 | (("depends=\"compile-tests\"") "depends=\"\"") |
932 | (("}/java") "}/groovy")) |
933 | (and |
934 | (zero? (apply system* "java" "-cp" |
935 | (string-append (getenv "CLASSPATH") ":build/classes") |
936 | "org.codehaus.groovy.tools.FileSystemCompiler" |
937 | "-d" "build/test-classes" |
938 | "-j" |
939 | (append |
940 | (find-files "src/test" |
941 | ".*\\.(groovy|java)$")))) |
942 | (zero? (system* "ant" "check")))))))) |
943 | (inputs |
944 | `(("groovy-templates" ,groovy-templates) |
945 | ("groovy-xml" ,groovy-xml) |
946 | ,@(package-inputs groovy-bootstrap))) |
947 | (native-inputs |
948 | `(("groovy-bootstrap" ,groovy-bootstrap) |
949 | ("groovy-json" ,groovy-json) |
950 | ("groovy-test" ,groovy-test) |
951 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
952 | ,@(package-native-inputs groovy-java-bootstrap))))) |
953 | |
954 | (define-public groovy-sql |
955 | (package |
956 | (inherit groovy-bootstrap) |
957 | (name "groovy-sql") |
958 | (arguments |
959 | `(#:jar-name "groovy-sql.jar" |
960 | #:test-dir "src/test" |
961 | #:tests? #f;TODO: Requires hsqldb |
962 | #:jdk ,icedtea-8 |
963 | #:phases |
964 | (modify-phases %standard-phases |
965 | (add-before 'configure 'chdir |
966 | (lambda _ |
967 | (chdir "subprojects/groovy-sql"))) |
968 | (replace 'build |
969 | (lambda _ |
970 | (mkdir-p "build/classes") |
971 | (mkdir-p "build/jar") |
972 | (and |
973 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
974 | "org.codehaus.groovy.tools.FileSystemCompiler" |
975 | "-d" "build/classes" |
976 | "-j"; joint compilation |
977 | (find-files "src/main" |
978 | ".*\\.(groovy|java)$"))) |
979 | (zero? (system* "jar" "-cf" "build/jar/groovy-sql.jar" |
980 | "-C" "build/classes" ".")))))))) |
981 | (native-inputs |
982 | `(("groovy-bootstrap" ,groovy-bootstrap) |
983 | ("groovy-test" ,groovy-test) |
984 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
985 | ,@(package-native-inputs groovy-java-bootstrap))))) |
986 | |
987 | (define-public groovy-testng |
988 | (package |
989 | (inherit groovy-bootstrap) |
990 | (name "groovy-testng") |
991 | (arguments |
992 | `(#:jar-name "groovy-testng.jar" |
993 | #:tests? #f; No tests |
994 | #:jdk ,icedtea-8 |
995 | #:phases |
996 | (modify-phases %standard-phases |
997 | (add-before 'configure 'chdir |
998 | (lambda _ |
999 | (chdir "subprojects/groovy-testng"))) |
1000 | (add-before 'build 'copy-resources |
1001 | (lambda _ |
1002 | (copy-recursively "src/main/resources" "build/classes"))) |
1003 | (replace 'build |
1004 | (lambda _ |
1005 | (mkdir-p "build/classes") |
1006 | (mkdir-p "build/jar") |
1007 | (and |
1008 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
1009 | "org.codehaus.groovy.tools.FileSystemCompiler" |
1010 | "-d" "build/classes" |
1011 | "-j"; joint compilation |
1012 | (find-files "src/main" |
1013 | ".*\\.(groovy|java)$"))) |
1014 | (zero? (system* "jar" "-cf" "build/jar/groovy-testng.jar" |
1015 | "-C" "build/classes" ".")))))))) |
1016 | (native-inputs |
1017 | `(("groovy-bootstrap" ,groovy-bootstrap) |
1018 | ("groovy-test" ,groovy-test) |
1019 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
1020 | ,@(package-native-inputs groovy-java-bootstrap))))) |
1021 | |
1022 | (define-public groovy-macro |
1023 | (package |
1024 | (inherit groovy-bootstrap) |
1025 | (name "groovy-macro") |
1026 | (arguments |
1027 | `(#:jar-name "groovy-macro.jar" |
1028 | #:test-dir "src/test" |
1029 | #:jdk ,icedtea-8 |
1030 | #:phases |
1031 | (modify-phases %standard-phases |
1032 | (add-before 'configure 'chdir |
1033 | (lambda _ |
1034 | (chdir "subprojects/groovy-macro"))) |
1035 | (replace 'build |
1036 | (lambda _ |
1037 | (mkdir-p "build/classes") |
1038 | (mkdir-p "build/jar") |
1039 | (and |
1040 | (zero? (apply system* "java" "-cp" (getenv "CLASSPATH") |
1041 | "org.codehaus.groovy.tools.FileSystemCompiler" |
1042 | "-d" "build/classes" |
1043 | "-j"; joint compilation |
1044 | (find-files "src/main" |
1045 | ".*\\.(groovy|java)$"))) |
1046 | (zero? (system* "jar" "-cf" "build/jar/groovy-macro.jar" |
1047 | "-C" "build/classes" "."))))) |
1048 | (replace 'check |
1049 | (lambda _ |
1050 | (mkdir-p "build/test-classes") |
1051 | (substitute* "build.xml" |
1052 | (("depends=\"compile-tests\"") "depends=\"\"") |
1053 | (("}/java") "}/groovy")) |
1054 | (and |
1055 | (zero? (apply system* "java" "-cp" |
1056 | (string-append (getenv "CLASSPATH") ":build/classes") |
1057 | "org.codehaus.groovy.tools.FileSystemCompiler" |
1058 | "-d" "build/test-classes" |
1059 | "-j" |
1060 | (append |
1061 | (find-files "src/test" |
1062 | ".*\\.(groovy|java)$")))) |
1063 | (zero? (system* "ant" "check")))))))) |
1064 | (inputs |
1065 | `(("groovy-templates" ,groovy-templates) |
1066 | ("groovy-xml" ,groovy-xml) |
1067 | ,@(package-inputs groovy-bootstrap))) |
1068 | (native-inputs |
1069 | `(("groovy-bootstrap" ,groovy-bootstrap) |
1070 | ("groovy-json" ,groovy-json) |
1071 | ("groovy-test" ,groovy-test) |
1072 | ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) |
1073 | ,@(package-native-inputs groovy-java-bootstrap))))) |
1074 | |
1075 | (define-public groovy |
1076 | (package |
1077 | (inherit groovy-bootstrap) |
1078 | (name "groovy") |
1079 | (arguments |
1080 | `(#:tests? #f; No tests |
1081 | #:jdk ,icedtea-8 |
1082 | #:phases |
1083 | (modify-phases %standard-phases |
1084 | (delete 'configure) |
1085 | (delete 'build) |
1086 | (replace 'install |
1087 | (lambda* (#:key outputs inputs #:allow-other-keys) |
1088 | (let* ((out (assoc-ref outputs "out")) |
1089 | (out-bin (string-append out "/bin"))) |
1090 | (with-directory-excursion "src/bin" |
1091 | (substitute* "startGroovy" |
1092 | (("\"\\\\\"") "\"") |
1093 | (("\\\\\"\"") "\"") |
1094 | (("\\\\\\$") "$") |
1095 | (("STARTER_CLASSPATH=.*") |
1096 | (string-append |
1097 | "STARTER_CLASSPATH=" |
1098 | (string-join |
1099 | (apply append |
1100 | (map (lambda (input) |
1101 | (find-files (assoc-ref inputs input) ".*.jar")) |
1102 | '("groovy-bootstrap" "groovy-ant" "groovy-bsf" |
1103 | "groovy-console" "groovy-docgenerator" |
1104 | "groovy-groovydoc" "groovy-groovysh" |
1105 | "groovy-jmx" "groovy-json" "groovy-jsr223" |
1106 | "groovy-nio" "groovy-servlet" "groovy-sql" |
1107 | "groovy-swing" "groovy-templates" "groovy-testng" |
1108 | "java-commons-cli" "java-asm" |
1109 | "java-classpathx-servletapi" "java-xstream" |
1110 | "java-jansi" "java-jline-2" "antlr2"))) |
1111 | ":"))) |
1112 | (("MAX_FD=\"maximum\"") |
1113 | (string-append |
1114 | "MAX_FD=\"maximum\"\nJAVACMD=" |
1115 | (assoc-ref inputs "jdk") "/bin/java"))) |
1116 | (for-each |
1117 | (lambda (tool) |
1118 | (install-file tool out-bin) |
1119 | (chmod (string-append out-bin "/" tool) #o755)) |
1120 | '("grape" "groovy" "groovyc" "groovyConsole" "groovydoc" |
1121 | "groovysh" "java2groovy" "startGroovy"))) |
1122 | (install-file "src/conf/groovy-starter.conf" |
1123 | (string-append out "/conf")))))))) |
1124 | (inputs |
1125 | `(("groovy-bootstrap" ,groovy-bootstrap) |
1126 | ("groovy-ant" ,groovy-ant) |
1127 | ("groovy-bsf" ,groovy-bsf) |
1128 | ("groovy-console" ,groovy-console) |
1129 | ("groovy-docgenerator" ,groovy-docgenerator) |
1130 | ("groovy-groovydoc" ,groovy-groovydoc) |
1131 | ("groovy-groovysh" ,groovy-groovysh) |
1132 | ("groovy-jmx" ,groovy-jmx) |
1133 | ("groovy-json" ,groovy-json) |
1134 | ("groovy-jsr223" ,groovy-jsr223) |
1135 | ("groovy-nio" ,groovy-nio) |
1136 | ("groovy-servlet" ,groovy-servlet) |
1137 | ("groovy-sql" ,groovy-sql) |
1138 | ("groovy-swing" ,groovy-swing) |
1139 | ("groovy-templates" ,groovy-templates) |
1140 | ("groovy-testng" ,groovy-testng) |
1141 | ("java-commons-cli" ,java-commons-cli) |
1142 | ("java-asm" ,java-asm) |
1143 | ("java-classpathx-servletapi" ,java-classpathx-servletapi) |
1144 | ("java-xstream" ,java-xstream) |
1145 | ("java-jansi" ,java-jansi) |
1146 | ("java-jline-2" ,java-jline-2) |
1147 | ("antlr2" ,antlr2))) |
1148 | (synopsis "Programming language for the JVM") |
1149 | (description "Apache Groovy is a powerful, optionally typed and dynamic |
1150 | language, with static-typing and static compilation capabilities, for the Java |
1151 | platform. It integrates smoothly with any Java program, and immediately |
1152 | delivers to your application powerful features, including scripting |
1153 | capabilities, Domain-Specific Language authoring, runtime and compile-time |
1154 | meta-programming and functional programming."))) |
1155 |