From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDXTj-0002Sm-EA for guix-patches@gnu.org; Tue, 01 May 2018 11:46:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDXTe-0000E9-M1 for guix-patches@gnu.org; Tue, 01 May 2018 11:46:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDXTe-0000Dt-ID for guix-patches@gnu.org; Tue, 01 May 2018 11:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fDXTe-00061R-CK for guix-patches@gnu.org; Tue, 01 May 2018 11:46:02 -0400 Subject: [bug#31333] [PATCH 02/22] gnu: Add groovy-bootstrap. Resent-Message-ID: From: Julien Lepiller Date: Tue, 1 May 2018 17:44:29 +0200 Message-Id: <20180501154449.3531-2-julien@lepiller.eu> In-Reply-To: <20180501154449.3531-1-julien@lepiller.eu> References: <20180501174136.1c411b1a@lepiller.eu> <20180501154449.3531-1-julien@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31333@debbugs.gnu.org * 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)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