;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Julien Lepiller ;;; Copyright © 2019 Tobias Geerinck-Rice ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages groovy) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system ant) #:use-module (gnu packages) #:use-module (gnu packages java) #:use-module (gnu packages java-xml) #:use-module (gnu packages xml)) (define java-groovy-bootstrap (package (name "java-groovy-bootstrap") (version "3.0.5") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/apache/groovy") (commit (string-append "GROOVY_" (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version))))) (file-name (git-file-name name version)) (sha256 (base32 "00556qxjmcn3a3xhfy6n0zw3d69mnw72vzm2rb6n4ihzkk7579nm")) (patches (search-patches "groovy-add-exceptionutilsgenerator.patch")))) (build-system ant-build-system) (arguments `(#:j
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([GNU Guix],
  [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
  [bug-guix@gnu.org], [guix],
  [https://www.gnu.org/software/guix/])
AC_CONFIG_AUX_DIR([build-aux])

AM_INIT_AUTOMAKE([1.14 gnu tar-ustar silent-rules subdir-objects \
 color-tests parallel-tests -Woverride -Wno-portability])

# Enable silent rules by default.
AM_SILENT_RULES([yes])

AC_CONFIG_SRCDIR([guix.scm])
AC_CONFIG_MACRO_DIR([m4])

dnl For the C++ code.  This must be used early.
AC_USE_SYSTEM_EXTENSIONS

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.1])

GUIX_SYSTEM_TYPE
GUIX_ASSERT_SUPPORTED_SYSTEM
GUIX_CHANNEL_METADATA

AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = "xyes"])

AC_ARG_WITH(store-dir,
  AS_HELP_STRING([--with-store-dir=PATH],
    [file name of the store (defaults to /gnu/store)]),
  [storedir="$withval"],
  [storedir="/gnu/store"])
AC_SUBST(storedir)

AC_ARG_WITH([bash-completion-dir],
  AS_HELP_STRING([--with-bash-completion-dir=DIR],
    [name of the Bash completion directory]),
  [bashcompletiondir="$withval"],
  [bashcompletiondir='${sysconfdir}/bash_completion.d'])
AC_SUBST([bashcompletiondir])

AC_ARG_WITH([zsh-completion-dir],
  AS_HELP_STRING([--with-zsh-completion-dir=DIR],
    [name of the Zsh completion directory]),
  [zshcompletiondir="$withval"],
  [zshcompletiondir='${datadir}/zsh/site-functions'])
AC_SUBST([zshcompletiondir])

AC_ARG_WITH([fish-completion-dir],
  AS_HELP_STRING([--with-fish-completion-dir=DIR],
    [name of the Fish completion directory]),
  [fishcompletiondir="$withval"],
  [fishcompletiondir='${datadir}/fish/vendor_completions.d'])
AC_SUBST([fishcompletiondir])

AC_ARG_WITH([selinux-policy-dir],
  AS_HELP_STRING([--with-selinux-policy-dir=DIR],
    [name of the SELinux policy directory]),
  [selinux_policydir="$withval"],
  [selinux_policydir='${datadir}/selinux/'])
AC_SUBST([selinux_policydir])

dnl Better be verbose.
AC_MSG_CHECKING([for the store directory])
AC_MSG_RESULT([$storedir])

AC_ARG_ENABLE([daemon],
  [AS_HELP_STRING([--disable-daemon], [do not build the Nix daemon (C++)])],
  [guix_build_daemon="$enableval"],
  [guix_build_daemon="yes"])

dnl Prepare a version of $localstatedir & co. that does not contain references
dnl to shell variables.  Also set some sane default directory variables for
dnl use with the Guix.  This also causes localstatedir to be /var and
dnl sysconfdir to be /etc.
test "$prefix" = NONE && prefix=
guix_localstatedir="`eval echo $localstatedir | sed -e "s|NONE|$guix_prefix|g"`"
guix_sysconfdir="`eval echo $sysconfdir | sed -e "s|NONE|$guix_prefix|g"`"
guix_sbindir="`eval echo $sbindir | sed -e "s|NONE|$guix_prefix|g"`"
AC_SUBST([guix_localstatedir])
AC_SUBST([guix_sysconfdir])
AC_SUBST([guix_sbindir])

GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])

dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
dnl Make sure they are available.
m4_pattern_forbid([PKG_CHECK_MODULES])
m4_pattern_forbid([GUILE_MODULE_AVAILABLE])
m4_pattern_forbid([^GUILE_P])
m4_pattern_allow([^GUILE_PKG_ERRORS])
m4_pattern_forbid([^GUIX_])

dnl Search for 'guile' and 'guild'.  This macro defines
dnl 'GUILE_EFFECTIVE_VERSION'.
GUILE_PKG([3.0])
GUILE_PROGS
if test "x$GUILD" = "x"; then
   AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
fi

dnl (guix ui), notably, requires 'default-optimization-level' added in 3.0.3.
PKG_CHECK_MODULES([GUILE], [guile-3.0 >= 3.0.3])

dnl Get CFLAGS and LDFLAGS for libguile.
GUILE_FLAGS

dnl Installation directories for .scm and .go files.
guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION"
guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache"
AC_SUBST([guilemoduledir])
AC_SUBST([guileobjectdir])

dnl The GnuTLS bindings are necessary for substitutes over HTTPS and for 'guix
dnl pull', among other things.
GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)])
if test "x$have_gnutls" != "xyes"; then
  AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.])
fi

dnl Check for Guile-Git.
GUILE_MODULE_AVAILABLE([have_guile_git], [(git)])
if test "x$have_guile_git" != "xyes"; then
  AC_MSG_ERROR([Guile-Git is missing; please install it.])
fi

dnl Check for Guile-JSON.
GUIX_CHECK_GUILE_JSON
if test "x$guix_cv_have_recent_guile_json" != "xyes"; then
  AC_MSG_ERROR([Guile-JSON is missing; please install it.])
fi

dnl Guile-Sqlite3 is used by the (guix store ...) modules.
GUIX_CHECK_GUILE_SQLITE3
if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes"; then
  AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
fi

GUIX_CHECK_GUILE_GCRYPT
if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then
  AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.])
fi

GUIX_CHECK_GUILE_GIT
if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
  AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
fi

dnl Check for the optional Guile-Lib.
GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
AM_COND_IF(HAVE_GUILE_LIB,,
  [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
Some features such as the Go importer will not be usable.])])

dnl Check for Guile-zlib.
GUIX_CHECK_GUILE_ZLIB
if test "x$guix_cv_have_recent_guile_zlib" != "xyes"; then
  AC_MSG_ERROR([A recent Guile-zlib could not be found; please install it.])
fi

dnl Check for Guile-lzlib.
GUILE_MODULE_AVAILABLE([have_guile_lzlib], [(lzlib)])
if test "x$have_guile_lzlib" != "xyes"; then
  AC_MSG_ERROR([Guile-lzlib is missing; please install it.])
fi

dnl Check for Guile-Avahi.
GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)])
AM_CONDITIONAL([HAVE_GUILE_AVAHI],
  [test "x$have_guile_avahi" = "xyes"])

dnl Guile-newt is used by the graphical installer.
GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)])

AC_ARG_ENABLE([installer],
    AS_HELP_STRING([--enable-installer], [Build the graphical installer sources.]))

AS_IF([test "x$enable_installer" = "xyes"], [
if test "x$have_guile_newt" != "xyes"; then
  AC_MSG_ERROR([Guile-newt could not be found; please install it.])
fi
])

AM_CONDITIONAL([ENABLE_INSTALLER],
  [test "x$enable_installer" = "xyes"])

dnl Make sure we have a full-fledged Guile.
GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])

AC_PROG_SED

dnl Decompressors, for use by the substituter and other modules.
AC_PATH_PROG([GZIP], [gzip])
AC_PATH_PROG([BZIP2], [bzip2])
AC_PATH_PROG([XZ], [xz])
AC_SUBST([GZIP])
AC_SUBST([BZIP2])
AC_SUBST([XZ])

dnl Git is now required for the "builtin:git-download" derivation builder.
AC_PATH_PROG([GIT], [git])
if test "x$GIT" = "x"; then
  AC_MSG_ERROR([Git is missing; please install it.])
fi
AC_SUBST([GIT])

LIBGCRYPT_LIBDIR="no"
LIBGCRYPT_PREFIX="no"

AC_ARG_WITH([libgcrypt-prefix],
  [AS_HELP_STRING([--with-libgcrypt-prefix=DIR], [search for GNU libgcrypt in DIR])],
  [case "$withval" in
    yes|no)
      ;;
    *)
      LIBGCRYPT_PREFIX="$withval"
      LIBGCRYPT_LIBDIR="$withval/lib"
      ;;
   esac])

AC_ARG_WITH([libgcrypt-libdir],
  [AS_HELP_STRING([--with-libgcrypt-libdir=DIR],
     [search for GNU libgcrypt's shared library in DIR])],
  [case "$withval" in
    yes|no)
      LIBGCRYPT_LIBDIR="no"
      ;;
    *)
      LIBGCRYPT_LIBDIR="$withval"
      ;;
   esac])

dnl If none of the --with-libgcrypt-* options was used, try to determine the
dnl the library directory.
case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
  xnono)
    GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
    ;;
esac

AC_SUBST([LIBGCRYPT_PREFIX])
AC_SUBST([LIBGCRYPT_LIBDIR])

dnl Check for Guile-SSH, for the (guix ssh) module.
GUIX_CHECK_GUILE_SSH
AM_CONDITIONAL([HAVE_GUILE_SSH],
  [test "x$guix_cv_have_recent_guile_ssh" = "xyes"])

AC_CACHE_SAVE

m4_include([config-daemon.ac])

dnl `dot' (from the Graphviz package) is only needed for maintainers.
dnl See `Building from Git' in the manual for more info.
AM_MISSING_PROG([DOT], [dot])

dnl Manual pages.
AM_MISSING_PROG([HELP2MAN], [help2man])

dnl Documentation translation.
AM_MISSING_PROG([PO4A], [po4a])

AC_MSG_CHECKING([if building from git])
if test -e .git; then
   in_git_p=yes
else
   in_git_p=no
fi
AC_MSG_RESULT([$in_git_p])
AM_CONDITIONAL([in_git_p],
  [test "x$in_git_p" = "xyes"])

case "$storedir" in
  /gnu/store)
    ;;
  *)
    AC_MSG_WARN([Using a store directory other than '/gnu/store' will prevent you])
    AC_MSG_WARN([from downloading substitutes from gnu.org.])
    ;;
esac

AC_CONFIG_FILES([Makefile
                 po/guix/Makefile.in
                 po/packages/Makefile.in
                 etc/guix-daemon.cil
                 guix/config.scm])

AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  [chmod +x pre-inst-env])

AC_OUTPUT
env "CLASSPATH") ":build/classes") "-d" "build/test-classes" "-j" (append (find-files ,(string-append "subprojects/" name "/src/test/java") ".*\\.(groovy|java)$") (find-files ,(string-append "subprojects/" name "/src/test/groovy") ".*\\.(groovy|java)$"))) (invoke "ant" "check")) #t))))))) (define groovy-parser-antlr4 (let ((base (groovy-subproject "parser-antlr4"))) (package (inherit base) (name "groovy-parser-antlr4") (arguments `(#:tests? #f ,@(substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases (add-before 'build 'generate-parser (lambda _ (invoke "antlr4" "-lib" "src/antlr" "-package" "org.apache.groovy.parser.antlr4" "-visitor" "-no-listener" "src/antlr/GroovyLexer.g4") (invoke "antlr4" "-lib" "src/antlr" "-package" "org.apache.groovy.parser.antlr4" "-visitor" "-no-listener" "src/antlr/GroovyParser.g4") (for-each (lambda (file) (install-file file "subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4")) (find-files "src/antlr" ".*.java$")) #t))))))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ,@(package-native-inputs java-groovy-bootstrap))) (synopsis "Groovy antlr4 parser submodule") (description "This package contains the new parser Parrot for Groovy, which is based on Antlr4. The new parser can parse Groovy source code and construct the related AST, which is almost identical to the one generated by the old parser. Currently all features of Groovy are available.")))) (define groovy-test (let ((base (groovy-subproject "groovy-test"))) (package (inherit base) (arguments `(;#:tests? #f ,@(package-arguments base))) (synopsis "Groovy test submodule") (description "This package contains the test submodules used to test other groovy submodules.")))) (define groovy-xml (let ((base (groovy-subproject "groovy-xml"))) (package (inherit base) (native-inputs `(("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (inputs `(("groovy-parser-antlr4" ,groovy-parser-antlr4) ,@(package-inputs base))) (synopsis "Groovy XML") (description "This package contains XML-related utilities for groovy.")))) (define groovy-templates (let ((base (groovy-subproject "groovy-templates"))) (package (inherit base) (arguments `(#:tests? #f;Requires spock-framework which is a circular dependency ,@(substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases ;; These annotations are used for QA, but do not affect build output. ;; They require findbugs, which we don't have yet. (add-before 'build 'remove-annotation (lambda _ (substitute* '("subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java" "subprojects/groovy-templates/src/main/groovy/groovy/text/TemplateEngine.java") (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") "") (("@SuppressFBWarnings.*") "")) #t))))))) (inputs `(("groovy-xml" ,groovy-xml) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy template engine") (description "This package contains a template framework which is well-suited to applications where the text to be generated follows the form of a static template.")))) (define groovy-groovydoc (let ((base (groovy-subproject "groovy-groovydoc"))) (package (inherit base) (arguments `(#:tests? #f; Requires groovy-ant which is a circular dependency ,@(package-arguments base))) (inputs `(("groovy-templates" ,groovy-templates) ("groovy-parser-antlr4" ,groovy-parser-antlr4) ("java-javaparser" ,java-javaparser) ,@(package-inputs groovy-bootstrap))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs java-groovy-bootstrap))) (synopsis "Groovy documentation generation") (description "This package contains the groovy documentation generator, similar to javadoc.")))) (define groovy-ant (let ((base (groovy-subproject "groovy-ant"))) (package (inherit base) (arguments `(;#:tests? #f;Requires spock-framework which is a circular dependency #:ant ,ant/java8; ant is actually a dependency of this package, and we need 1.10 ,@(substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases ;; These annotations are used for QA, but do not affect build output. ;; They require findbugs, which we don't have yet. (add-before 'build 'remove-annotation (lambda _ (substitute* (find-files "subprojects/groovy-ant" ".*.java$") (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") "") (("@SuppressFBWarnings.*") "")) #t))))))) (inputs `(("groovy-groovydoc" ,groovy-groovydoc) ("java-asm-tree" ,java-asm-tree-8) ("java-asm-analysis" ,java-asm-analysis-8) ,@(package-inputs base))) (native-inputs `(("ant-junit" ,ant-junit) ("groovy-bootstrap" ,groovy-bootstrap) ("groovy-xml" ,groovy-xml) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy ant tasks") (description "This package contains groovy-related ant tasks definitions.")))) (define groovy-astbuilder (let ((base (groovy-subproject "groovy-astbuilder"))) (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases (delete 'copy-resources) (add-after 'build 'copy-resources (lambda _ (copy-recursively "subprojects/groovy-astbuilder/src/main/resources" "build/classes") (substitute* "build.xml" (("depends=\"compile,") "depends=\"")) (invoke "ant" "jar") #t)))))) (inputs `(("groovy-bootstrap" ,groovy-bootstrap) ,@(package-inputs base))) (native-inputs `(("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Transformation to capture ASTBuilder from code statements") (description "This package contains an AST transformation for use with ASTBuilder when building \"from string\" Groovy statements.")))) (define groovy-bsf (let ((base (groovy-subproject "groovy-bsf"))) (package (inherit base) (arguments `(#:test-exclude (list ;; exception from Groovy: org.codehaus.groovy.runtime.InvokerInvocationException: ;; groovy.lang.MissingMethodException: No signature of method: ;; java.util.ArrayList.each() is applicable for argument types: ;; (groovy.script.MapFromList$_doit_closure1) values: ;; [groovy.script.MapFromList$_doit_closure1@17e554d5] "**/BSFTest.java") ,@(package-arguments base))) (inputs `(("java-commons-bsf" ,java-commons-bsf) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ("java-commons-logging-minimal" ,java-commons-logging-minimal) ,@(package-native-inputs base))) (synopsis "Groovy BSF engine") (description "This package defines the BSF engine for using Groovy inside any @dfn{Bean Scripting Framework} (BSF) application.")))) (define groovy-cli-commons (let ((base (groovy-subproject "groovy-cli-commons"))) (package (inherit base) (inputs `(("groovy-bootstrap" ,groovy-bootstrap) ,@(package-inputs base))) (native-inputs `(("groovy-test" ,groovy-test) ,@(package-native-inputs base))) (synopsis "Groovy CLI common classes") (description "This package defines common classes for dealing with command-line arguments in Groovy.")))) (define groovy-cli-picocli (let ((base (groovy-subproject "groovy-cli-picocli"))) (package (inherit base) (inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("java-picocli" ,java-picocli) ,@(package-inputs base))) (native-inputs `(("groovy-test" ,groovy-test) ,@(package-native-inputs base))) (synopsis "Groovy CLI classes that use picocli") (description "This package defines classes for dealing with command-line arguments in Groovy using the picocli library.")))) (define groovy-swing (let ((base (groovy-subproject "groovy-swing"))) (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases (add-before 'check 'fix-test (lambda _ (substitute* "subprojects/groovy-swing/src/test/groovy/groovy/swing/GroovySwingTestCase.groovy" (("HeadlessTestSupport.headless") "isHeadless()")) #t)))))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ("java-commons-logging-minimal" ,java-commons-logging-minimal) ,@(package-native-inputs base))) (synopsis "Groovy graphical library") (description "This package contains the groovy bindings to Java Swing, a library used to build graphical interfaces.")))) (define groovy-console (let ((base (groovy-subproject "groovy-console"))) (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases (add-before 'check 'build-swing (lambda _ (substitute* "subprojects/groovy-swing/src/test/groovy/groovy/swing/GroovySwingTestCase.groovy" (("HeadlessTestSupport.headless") "isHeadless()")) (mkdir-p "build/test-classes") (apply invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") "org.codehaus.groovy.tools.FileSystemCompiler" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") "-d" "build/test-classes" "-j" (append (find-files "subprojects/groovy-swing/src/test/java" ".*\\.(groovy|java)$") (find-files "subprojects/groovy-swing/src/test/groovy" ".*\\.(groovy|java)$"))) #t)))))) (inputs `(("groovy-swing" ,groovy-swing) ("groovy-templates" ,groovy-templates) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ("java-commons-logging-minimal" ,java-commons-logging-minimal) ,@(package-native-inputs base))) (synopsis "Groovy graphical interface") (description "This package contains a graphical interface to run groovy.")))) (define groovy-datetime (let ((base (groovy-subproject "groovy-datetime"))) (package (inherit base) (native-inputs `(("groovy-test" ,groovy-test) ,@(package-native-inputs base))) (synopsis "Date/Time API for Groovy") (description "This package defines new Groovy methods which appear on normal JDK Date/Time API (@code{java.time}) classes inside the Groovy environment.")))) (define groovy-dateutil (let ((base (groovy-subproject "groovy-dateutil"))) (package (inherit base) (native-inputs `(("groovy-test" ,groovy-test) ,@(package-native-inputs base))) (synopsis "Date and Calendar API for Groovy") (description "This package defines new groovy methods which appear on normal JDK Date and Calendar classes inside the Groovy environment.")))) (define groovy-docgenerator (let ((base (groovy-subproject "groovy-docgenerator"))) (package (inherit base) (arguments `(#:tests? #f; No tests ,@(package-arguments base))) (inputs `(("groovy-templates" ,groovy-templates) ("groovy-swing" ,groovy-swing) ("java-qdox-1.12" ,java-qdox-1.12) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy documentation generation") (description "This package contains a command line tool to generate documentation for groovy applications.")))) (define groovy-groovysh (let ((base (groovy-subproject "groovy-groovysh"))) (package (inherit base) (inputs `(("groovy-xml" ,groovy-xml) ("groovy-console" ,groovy-console) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy REPL") (description "This package contains the Groovy REPL.")))) (define groovy-jmx (let ((base (groovy-subproject "groovy-jmx"))) (package (inherit base) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy JMX extension") (description "This package contains the JMX extension of Groovy, for management and monitoring of JVM-based solutions.")))) (define groovy-json (let ((base (groovy-subproject "groovy-json"))) (package (inherit base) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy JSON") (description "This package contains JSON-related utilities for groovy.")))) (define groovy-jsr223 (let ((base (groovy-subproject "groovy-jsr223"))) (package (inherit base) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy's own JSR223 implementation") (description "This package contains Groovy's own JSR223 implementation. This module is used for interaction between Groovy and Java code.")))) (define groovy-nio (let ((base (groovy-subproject "groovy-nio"))) (package (inherit base) (arguments `(#:tests? #f; Require spock-framework ,@(package-arguments base))) (synopsis "Groovy input-output library") (description "This package implements an input/output library that extends the functionality of the common library of Java.")))) (define groovy-servlet (let ((base (groovy-subproject "groovy-servlet"))) (package (inherit base) (inputs `(("groovy-templates" ,groovy-templates) ("groovy-xml" ,groovy-xml) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-json" ,groovy-json) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy's servlet implementation") (description "This package contains a library to create groovlets, Groovy's version of Java servlets.")))) (define groovy-sql (let ((base (groovy-subproject "groovy-sql"))) (package (inherit base) (arguments `(#:tests? #f;TODO: Requires hsqldb ,@(package-arguments base))) (synopsis "Groovy SQL library") (description "This package contains a facade over Java's normal JDBC APIs providing greatly simplified resource management and result set handling.")))) (define groovy-testng (let ((base (groovy-subproject "groovy-testng"))) (package (inherit base) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (synopsis "Groovy testing framework") (description "This package contains integration code for running TestNG tests in Groovy.")))) (define groovy-macro (let ((base (groovy-subproject "groovy-macro"))) (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) `(modify-phases ,phases (delete 'copy-resources) (add-after 'build 'copy-resources (lambda _ (copy-recursively "subprojects/groovy-macro/src/main/resources" "build/classes") (substitute* "build.xml" (("depends=\"compile,") "depends=\"")) (invoke "ant" "jar") #t)))))) (inputs `(("groovy-templates" ,groovy-templates) ("groovy-xml" ,groovy-xml) ,@(package-inputs base))) (native-inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-json" ,groovy-json) ("groovy-test" ,groovy-test) ("groovy-tests-bootstrap" ,groovy-tests-bootstrap) ,@(package-native-inputs base))) (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 groovy-yaml (let ((base (groovy-subproject "groovy-yaml"))) (package (inherit base) (inputs `(("groovy-json" ,groovy-json) ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations) ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core) ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind) ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml) ,@(package-inputs base))) (native-inputs `(("groovy-test" ,groovy-test) ,@(package-native-inputs base))) (synopsis "Groovy YAML") (description "This package contains YAML-related utilities for groovy.")))) (define-public groovy (package (inherit groovy-bootstrap) (name "groovy") (arguments `(#:tests? #f; No tests #:jdk ,openjdk9 #: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\"\nJAVA_HOME=" (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-astbuilder" "groovy-bsf" "groovy-cli-commons" "groovy-cli-picocli" "groovy-console" "groovy-datetime" "groovy-dateutil" "groovy-docgenerator" "groovy-groovydoc" "groovy-groovysh" "groovy-jmx" "groovy-json" "groovy-jsr223" "groovy-nio" "groovy-parser-antlr4" "groovy-servlet" "groovy-sql" "groovy-swing" "groovy-templates" "groovy-testng" "groovy-xml" "groovy-yaml" "java-commons-cli" "java-tunnelvisionlabs-antlr4-runtime" "java-asm" "java-asm-analysis" "java-asm-tree" "java-asm-util" "java-classpathx-servletapi" "java-xstream" "java-picocli" "java-jansi" "java-jline-2")) ;; antlr.jar is present twice in antlr2. Symlink doesn't like ;; it, so we symlink it here. (symlink (search-input-file inputs "/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")) #t)))))) (inputs `(("groovy-bootstrap" ,groovy-bootstrap) ("groovy-ant" ,groovy-ant) ("groovy-astbuilder" ,groovy-astbuilder) ("groovy-bsf" ,groovy-bsf) ("groovy-cli-commons" ,groovy-cli-commons) ("groovy-cli-picocli" ,groovy-cli-picocli) ("groovy-console" ,groovy-console) ("groovy-datetime" ,groovy-datetime) ("groovy-dateutil" ,groovy-dateutil) ("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-parser-antlr4" ,groovy-parser-antlr4) ("groovy-servlet" ,groovy-servlet) ("groovy-sql" ,groovy-sql) ("groovy-swing" ,groovy-swing) ("groovy-templates" ,groovy-templates) ("groovy-testng" ,groovy-testng) ("groovy-xml" ,groovy-xml) ("groovy-yaml" ,groovy-yaml) ("java-tunnelvisionlabs-antlr4-runtime" ,java-tunnelvisionlabs-antlr4-runtime) ("java-commons-cli" ,java-commons-cli) ("java-asm" ,java-asm-8) ("java-asm-analysis" ,java-asm-analysis-8) ("java-asm-tree" ,java-asm-tree-8) ("java-asm-util" ,java-asm-util-8) ("java-classpathx-servletapi" ,java-classpathx-servletapi) ("java-picocli" ,java-picocli) ("java-jansi" ,java-jansi) ("java-jline-2" ,java-jline-2) ("java-xstream" ,java-xstream) ("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.")))