Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, unzip, which, makeWrapper, jdk }:
2
3# at runtime, need jdk
4
5stdenv.mkDerivation rec {
6 pname = "groovy";
7 version = "3.0.11";
8
9 src = fetchurl {
10 url = "mirror://apache/groovy/${version}/distribution/apache-groovy-binary-${version}.zip";
11 sha256 = "85abb44e81f94d794230cf5c2c7f1003e598a5f8a6ae04322f28c6f9efe395f6";
12 };
13
14 nativeBuildInputs = [ makeWrapper unzip ];
15
16 installPhase = ''
17 mkdir -p $out
18 mkdir -p $out/share/doc/groovy
19 rm bin/*.bat
20 mv {bin,conf,grooid,indy,lib} $out
21 mv {licenses,LICENSE,NOTICE} $out/share/doc/groovy
22
23 sed -i 's#which#${which}/bin/which#g' $out/bin/startGroovy
24
25 for p in grape java2groovy groovy{,doc,c,sh,Console}; do
26 wrapProgram $out/bin/$p \
27 --set JAVA_HOME "${jdk}" \
28 --prefix PATH ":" "${jdk}/bin"
29 done
30 '';
31
32 meta = with 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}