From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDXTu-0002c5-Dz for guix-patches@gnu.org; Tue, 01 May 2018 11:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDXTp-0000RZ-QD for guix-patches@gnu.org; Tue, 01 May 2018 11:46:18 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:38013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fDXTp-0000RS-NT for guix-patches@gnu.org; Tue, 01 May 2018 11:46:13 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fDXTp-00063y-GJ for guix-patches@gnu.org; Tue, 01 May 2018 11:46:13 -0400 Subject: [bug#31333] [PATCH 22/22] gnu: Add groovy. Resent-Message-ID: From: Julien Lepiller Date: Tue, 1 May 2018 17:44:49 +0200 Message-Id: <20180501154449.3531-22-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): New variable. --- gnu/packages/groovy.scm | 93 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/gnu/packages/groovy.scm b/gnu/packages/groovy.scm index 89a1e7e8d..981f42b6a 100644 --- a/gnu/packages/groovy.scm +++ b/gnu/packages/groovy.scm @@ -1090,3 +1090,96 @@ tests in Groovy."))) (synopsis "Groovy macro processor") (description "This package contains a high-level library to create macro and modify groovy's @dfn{Abstract Syntax Tree} (AST)."))) + +(define-public groovy + (package + (inherit groovy-bootstrap) + (name "groovy") + (arguments + `(#:tests? #f; No tests + #:jdk ,icedtea-8 + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (out-bin (string-append out "/bin")) + (out-lib (string-append out "/lib"))) + (with-directory-excursion "src/bin" + (substitute* "startGroovy" + (("\"\\\\\"") "\"") + (("\\\\\"\"") "\"") + (("\\\\\\$") "$") + (("@GROOVYJAR@") "groovy.jar") + (("MAX_FD=\"maximum\"") + (string-append + "MAX_FD=\"maximum\"\nJAVAHOME=" + (assoc-ref inputs "jdk")))) + ;; Groovy uses class loading. It's not enough to put the class + ;; in the loader's classpath, as it causes breakages: + ;; the compiler would give this error: + ;; "Prohibited package name: java.lang" + ;; So we symlink dependencies in this package's output. The + ;; starter class (in groovy-bootstrap) is where the class loader + ;; will look for dependencies, so we put it there too. + (mkdir-p out-lib) + (for-each + (lambda (input) + (for-each + (lambda (jar) + (symlink jar (string-append out-lib "/" (basename jar)))) + (find-files (assoc-ref inputs input) ".*.jar"))) + '("groovy-bootstrap" "groovy-ant" "groovy-bsf" + "groovy-console" "groovy-docgenerator" + "groovy-groovydoc" "groovy-groovysh" + "groovy-jmx" "groovy-json" "groovy-jsr223" + "groovy-nio" "groovy-servlet" "groovy-sql" + "groovy-swing" "groovy-templates" "groovy-testng" + "java-commons-cli" "java-asm" + "java-classpathx-servletapi" "java-xstream" + "java-jansi" "java-jline-2")) + ;; antlr.jar is present twice in antlr2. Symlink doesn't like + ;; it, so we symlink it here. + (symlink (string-append (assoc-ref inputs "antlr2") "/lib/antlr.jar") + (string-append out-lib "/antlr.jar")) + (for-each + (lambda (tool) + (install-file tool out-bin) + (chmod (string-append out-bin "/" tool) #o755)) + '("grape" "groovy" "groovyc" "groovyConsole" "groovydoc" + "groovysh" "java2groovy" "startGroovy"))) + (install-file "src/conf/groovy-starter.conf" + (string-append out "/conf")))))))) + (inputs + `(("groovy-bootstrap" ,groovy-bootstrap) + ("groovy-ant" ,groovy-ant) + ("groovy-bsf" ,groovy-bsf) + ("groovy-console" ,groovy-console) + ("groovy-docgenerator" ,groovy-docgenerator) + ("groovy-groovydoc" ,groovy-groovydoc) + ("groovy-groovysh" ,groovy-groovysh) + ("groovy-jmx" ,groovy-jmx) + ("groovy-json" ,groovy-json) + ("groovy-jsr223" ,groovy-jsr223) + ("groovy-nio" ,groovy-nio) + ("groovy-servlet" ,groovy-servlet) + ("groovy-sql" ,groovy-sql) + ("groovy-swing" ,groovy-swing) + ("groovy-templates" ,groovy-templates) + ("groovy-testng" ,groovy-testng) + ("java-commons-cli" ,java-commons-cli) + ("java-asm" ,java-asm) + ("java-classpathx-servletapi" ,java-classpathx-servletapi) + ("java-xstream" ,java-xstream) + ("java-jansi" ,java-jansi) + ("java-jline-2" ,java-jline-2) + ("antlr2" ,antlr2))) + (synopsis "Programming language for the JVM") + (description "Apache Groovy is a powerful, optionally typed and dynamic +language, with static-typing and static compilation capabilities, for the Java +platform. It integrates smoothly with any Java program, and immediately +delivers to your application powerful features, including scripting +capabilities, Domain-Specific Language authoring, runtime and compile-time +meta-programming and functional programming."))) -- 2.17.0