2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip
|
2015-01-01 23:39:06 +00:00
|
|
|
# If jdk is null, require JAVA_HOME in runtime environment, else store
|
|
|
|
# JAVA_HOME=${jdk.home} into grails.
|
|
|
|
, jdk ? null
|
2014-09-16 18:36:52 +00:00
|
|
|
, coreutils, ncurses, gnused, gnugrep # for purity
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-01-23 17:15:07 +00:00
|
|
|
binpath = lib.makeBinPath
|
|
|
|
([ coreutils ncurses gnused gnugrep ] ++ lib.optional (jdk != null) jdk);
|
2014-09-16 18:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "grails";
|
2020-05-24 20:50:37 +00:00
|
|
|
version = "4.1.0.M1";
|
2014-09-16 18:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-08-25 06:25:02 +00:00
|
|
|
url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip";
|
2020-05-24 20:50:37 +00:00
|
|
|
sha256 = "0l99x3g485qjpdd7ga553xpi1s6rq21p8v16qjzqwdhyld961qsr";
|
2014-09-16 18:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2014-09-16 18:36:52 +00:00
|
|
|
|
2016-05-04 10:08:35 +00:00
|
|
|
dontBuild = true;
|
2014-09-16 18:36:52 +00: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
|
2021-01-23 17:15:07 +00:00
|
|
|
'' + lib.optionalString (jdk != null) ''
|
2014-09-16 18:36:52 +00:00
|
|
|
# Inject JDK path into grails
|
2015-01-01 23:39:06 +00:00
|
|
|
sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails
|
2014-09-16 18:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-09-16 18:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-04-05 00:36:14 +00:00
|
|
|
homepage = "https://grails.org/";
|
2014-09-16 18:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|