2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, which, makeWrapper, jdk }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# at runtime, need jdk
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "groovy";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "4.0.21";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-06-26 10:26:21 +00:00
|
|
|
url = "mirror://apache/groovy/${version}/distribution/apache-groovy-binary-${version}.zip";
|
2024-06-05 15:53:02 +00:00
|
|
|
sha256 = "sha256-Xvh49w24tkLSBOmkEMUZwRMaPnqd20tpENIUkJyy6Yo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
mkdir -p $out/share/doc/groovy
|
|
|
|
rm bin/*.bat
|
2024-06-05 15:53:02 +00:00
|
|
|
mv {bin,conf,grooid,lib} $out
|
2020-04-24 23:36:52 +00:00
|
|
|
mv {licenses,LICENSE,NOTICE} $out/share/doc/groovy
|
|
|
|
|
|
|
|
sed -i 's#which#${which}/bin/which#g' $out/bin/startGroovy
|
|
|
|
|
|
|
|
for p in grape java2groovy groovy{,doc,c,sh,Console}; do
|
|
|
|
wrapProgram $out/bin/$p \
|
|
|
|
--set JAVA_HOME "${jdk}" \
|
|
|
|
--prefix PATH ":" "${jdk}/bin"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An agile dynamic language for the Java Platform";
|
|
|
|
homepage = "http://groovy-lang.org/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|