1{ stdenv, fetchurl, unzip, which, makeWrapper, jdk }:
2
3# at runtime, need jdk
4
5stdenv.mkDerivation rec {
6 name = "groovy-${version}";
7 version = "2.4.6";
8
9 src = fetchurl {
10 url = "http://dl.bintray.com/groovy/maven/apache-groovy-binary-${version}.zip";
11 sha256 = "0s474wy7db7j1pans5ks986b52bdmn40l29zl6xl44y23fsvagwv";
12 };
13
14 buildInputs = [ unzip makeWrapper ];
15
16 installPhase = ''
17 mkdir -p $out
18 rm bin/*.bat
19 mv * $out
20
21 sed -i 's#which#${which}/bin/which#g' $out/bin/startGroovy
22
23 for p in grape java2groovy groovy{,doc,c,sh,Console}; do
24 wrapProgram $out/bin/$p \
25 --set JAVA_HOME "${jdk}" \
26 --prefix PATH ":" "${jdk}/bin"
27 done
28 '';
29
30 phases = "unpackPhase installPhase";
31
32 meta = with stdenv.lib; {
33 description = "An agile dynamic language for the Java Platform";
34 homepage = http://groovy-lang.org/;
35 license = licenses.asl20;
36 maintainers = with maintainers; [ pSub ];
37 platforms = with platforms; unix;
38 };
39}