2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip
|
2020-04-24 23:36:52 +00:00
|
|
|
# If jdk is null, require JAVA_HOME in runtime environment, else store
|
|
|
|
# JAVA_HOME=${jdk.home} into grails.
|
|
|
|
, jdk ? null
|
|
|
|
, coreutils, ncurses, gnused, gnugrep # for purity
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
binpath = lib.makeBinPath
|
|
|
|
([ coreutils ncurses gnused gnugrep ] ++ lib.optional (jdk != null) jdk);
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "grails";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "5.2.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-jtv14Y6TfiIHwbqqaX36j2H/4+UCikbpFhYgNeAP3L4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
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-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString (jdk != null) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# Inject JDK path into grails
|
|
|
|
sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails
|
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23: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.
|
|
|
|
'';
|
|
|
|
homepage = "https://grails.org/";
|
|
|
|
license = licenses.asl20;
|
2022-08-12 12:06:08 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|