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