Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / web / grails / default.nix
blob2a888b8056d0aff24239e99e54ed223bbe4262f4
1 { lib, stdenv, fetchurl, unzip
2 # If jdk is null, require JAVA_HOME in runtime environment, else store
3 # JAVA_HOME=${jdk.home} into grails.
4 , jdk ? null
5 , coreutils, ncurses, gnused, gnugrep  # for purity
6 }:
8 let
9   binpath = lib.makeBinPath
10     ([ coreutils ncurses gnused gnugrep ] ++ lib.optional (jdk != null) jdk);
12 stdenv.mkDerivation rec {
13   pname = "grails";
14   version = "4.1.0.M1";
16   src = fetchurl {
17     url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip";
18     sha256 = "0l99x3g485qjpdd7ga553xpi1s6rq21p8v16qjzqwdhyld961qsr";
19   };
21   nativeBuildInputs = [ unzip ];
23   dontBuild = true;
25   installPhase = ''
26     mkdir -p "$out"
27     cp -vr . "$out"
28     # Remove (for now) uneeded Windows .bat files
29     rm -f "$out"/bin/*.bat
30     # Improve purity
31     sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails
32   '' + lib.optionalString (jdk != null) ''
33     # Inject JDK path into grails
34     sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails
35   '';
37   preferLocalBuild = true;
39   meta = with lib; {
40     description = "Full stack, web application framework for the JVM";
41     longDescription = ''
42       Grails is an Open Source, full stack, web application framework for the
43       JVM. It takes advantage of the Groovy programming language and convention
44       over configuration to provide a productive and stream-lined development
45       experience.
46     '';
47     homepage = "https://grails.org/";
48     license = licenses.asl20;
49     platforms = platforms.linux;
50     maintainers = [ maintainers.bjornfor ];
51   };