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