2014-09-16 20:36:52 +02:00
|
|
|
{ stdenv, fetchurl, unzip
|
2015-01-02 00:39:06 +01:00
|
|
|
# If jdk is null, require JAVA_HOME in runtime environment, else store
|
|
|
|
# JAVA_HOME=${jdk.home} into grails.
|
|
|
|
, jdk ? null
|
2014-09-16 20:36:52 +02:00
|
|
|
, coreutils, ncurses, gnused, gnugrep # for purity
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2016-04-13 14:53:51 +02:00
|
|
|
binpath = stdenv.lib.makeBinPath
|
2015-01-02 00:39:06 +01:00
|
|
|
([ coreutils ncurses gnused gnugrep ] ++ stdenv.lib.optional (jdk != null) jdk);
|
2014-09-16 20:36:52 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "grails";
|
2019-10-22 00:16:29 +02:00
|
|
|
version = "4.0.1";
|
2014-09-16 20:36:52 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-08-25 08:25:02 +02:00
|
|
|
url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip";
|
2019-10-22 00:16:29 +02:00
|
|
|
sha256 = "0igkzxqfm6lvp4s8w6kavdvjriq59q42jmj9ynbc669dvy6y6725";
|
2014-09-16 20:36:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ unzip ];
|
|
|
|
|
2016-05-04 12:08:35 +02:00
|
|
|
dontBuild = true;
|
2014-09-16 20:36:52 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -vr . "$out"
|
|
|
|
# Remove (for now) uneeded Windows .bat files
|
|
|
|
rm -f "$out"/bin/*.bat
|
|
|
|
# Improve purity
|
|
|
|
sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails
|
2015-01-02 00:39:06 +01:00
|
|
|
'' + stdenv.lib.optionalString (jdk != null) ''
|
2014-09-16 20:36:52 +02:00
|
|
|
# Inject JDK path into grails
|
2015-01-02 00:39:06 +01:00
|
|
|
sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails
|
2014-09-16 20:36:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Full stack, web application framework for the JVM";
|
|
|
|
longDescription = ''
|
|
|
|
Grails is an Open Source, full stack, web application framework for the
|
|
|
|
JVM. It takes advantage of the Groovy programming language and convention
|
|
|
|
over configuration to provide a productive and stream-lined development
|
|
|
|
experience.
|
|
|
|
'';
|
2017-08-02 23:50:51 +02:00
|
|
|
homepage = https://grails.org/;
|
2014-09-16 20:36:52 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|