nixpkgs/pkgs/by-name/gr/groovy/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

85 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchurl,
unzip,
which,
makeWrapper,
installShellFiles,
jdk,
copyDesktopItems,
makeDesktopItem,
}:
# at runtime, need jdk
stdenv.mkDerivation rec {
pname = "groovy";
version = "4.0.23";
src = fetchurl {
url = "mirror://apache/groovy/${version}/distribution/apache-groovy-binary-${version}.zip";
sha256 = "sha256-cIndeh6ErcgU1hb17C99fawgRKCgRX8zQbO5LTAgQik=";
};
nativeBuildInputs = [
makeWrapper
unzip
installShellFiles
copyDesktopItems
];
desktopItems = [
(makeDesktopItem {
name = "groovy";
desktopName = "Groovy Console";
exec = "groovyConsole";
icon = "groovy";
comment = meta.description;
terminal = false;
startupNotify = false;
categories = [ "Development" ];
})
];
installPhase = ''
runHook preInstall
rm bin/*.bat
mkdir -p $out
mkdir -p $out/share/doc/groovy
#Install icons
mkdir -p $out/share/icons
mv bin/groovy.ico $out/share/icons/
#Install Completion
for p in grape groovy{,doc,c,sh,Console}; do
installShellCompletion --cmd $p --bash bin/''${p}_completion
done
rm bin/*_completion
mv {bin,conf,grooid,lib} $out
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
runHook postInstall
'';
meta = with lib; {
description = "Agile dynamic language for the Java Platform";
homepage = "http://groovy-lang.org/";
license = licenses.asl20;
maintainers = with maintainers; [ pSub ];
platforms = with platforms; unix;
};
}