GNU bug report logs - #31333
[PATCH] Add groovy

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Tue, 1 May 2018 15:42:02 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Julien Lepiller <julien <at> lepiller.eu>
To: 31333 <at> debbugs.gnu.org
Subject: [bug#31333] [PATCH 02/22] gnu: Add groovy-bootstrap.
Date: Tue,  1 May 2018 17:44:29 +0200
* gnu/packages/groovy.scm (groovy-bootstrap): New variable.
---
 gnu/packages/groovy.scm | 75 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/gnu/packages/groovy.scm b/gnu/packages/groovy.scm
index ee2894e30..016d7e66b 100644
--- a/gnu/packages/groovy.scm
+++ b/gnu/packages/groovy.scm
@@ -93,3 +93,78 @@
 groovy submodules.")
     (license (list license:gpl2
                    license:cddl1.1))))
+
+(define groovy-bootstrap
+  (package
+    (inherit groovy-java-bootstrap)
+    (name "groovy-bootstrap")
+    (arguments
+     `(#:jar-name "groovy.jar"
+       #:jdk ,icedtea-8
+       ;Requires groovy-xml and logback-classic which are circular dependencies
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-java8
+           ;; Fix "Reference to plus is ambiguous"
+           (lambda _
+             (substitute* "src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java"
+               (("toList\\(left\\)")
+                "(List<T>)toList(left)"))))
+         (add-before 'build 'generate-parser
+           (lambda _
+             (with-directory-excursion "src/main/org/codehaus/groovy/antlr/java"
+               (zero? (system* "antlr" "java.g")))
+             (with-directory-excursion "src/main/org/codehaus/groovy/antlr"
+               (mkdir "parser")
+               (with-directory-excursion "parser"
+                 (zero? (system* "antlr" "../groovy.g"))))))
+         (add-before 'build 'generate-exception-utils
+           (lambda _
+             (system* "javac" "-cp" (getenv "CLASSPATH")
+                      "config/ant/src/org/codehaus/groovy/ExceptionUtilsGenerator.java")
+             (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
+                                                         ":config/ant/src")
+                             "org.codehaus.groovy.ExceptionUtilsGenerator"
+                             "target/classes/org/codehaus/groovy/runtime/ExceptionUtils.class"))))
+         (add-before 'build 'generate-dgminfo
+           (lambda _
+             (mkdir-p "target/classes/org/codehaus/groovy/runtime")
+             (mkdir-p "target/classes/META-INF")
+             (system* "javac" "-cp" (getenv "CLASSPATH")
+                      "src/main/org/codehaus/groovy/tools/DgmConverter.java")
+             (zero? (system* "java" "-cp" (string-append (getenv "CLASSPATH")
+                                                         ":src/main")
+                             "org.codehaus.groovy.tools.DgmConverter"))))
+         (add-before 'build 'copy-resources
+           (lambda _
+             (with-directory-excursion "src/main"
+               (for-each (lambda (file)
+                           (mkdir-p (string-append "../../target/classes/"
+                                                   (dirname file)))
+                           (copy-file file
+                                      (string-append "../../target/classes/"
+                                                     file)))
+                  (find-files "." ".*.(txt|properties|xml|html)")))))
+         (replace 'build
+           (lambda _
+             (mkdir-p "build/jar")
+             (and
+               (zero? (apply system* "java" "-cp" (getenv "CLASSPATH")
+                               "org.codehaus.groovy.tools.FileSystemCompiler"
+                               "-d" "target/classes"
+                               "-j"; joint compilation
+                               (find-files "src/main"
+                                           ".*\\.(groovy|java)$")))
+               (zero? (system* "jar" "-cf" "build/jar/groovy.jar"
+                               "-C" "target/classes" "."))))))))
+    (inputs
+     `(("java-apache-ivy" ,java-apache-ivy)
+       ,@(package-inputs groovy-java-bootstrap)))
+    (native-inputs
+     `(("groovy-java-bootstrap" ,groovy-java-bootstrap)
+       ,@(package-native-inputs groovy-java-bootstrap)))
+    (synopsis "Groovy compiler")
+    (description "This package contains the first version of the Groovy compiler.
+Although already usable, it doesn't contain the groovy library yet.  This package
+is used to build the groovy submodules written in groovy.")))
-- 
2.17.0





This bug report was last modified 7 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.