gradle-completion: modernize, add update script (#354145)
This commit is contained in:
commit
db2a0eaf13
@ -1,16 +1,26 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
fetchFromGitHub,
|
||||||
|
installShellFiles,
|
||||||
|
gitUpdater,
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||||
pname = "gradle-completion";
|
pname = "gradle-completion";
|
||||||
version = "1.4.1";
|
version = "1.4.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "gradle";
|
owner = "gradle";
|
||||||
repo = "gradle-completion";
|
repo = "gradle-completion";
|
||||||
rev = "v${version}";
|
rev = "v${finalAttrs.version}";
|
||||||
sha256 = "15b0692i3h8h7b95465b2aw9qf5qjmjag5n62347l8yl7zbhv3l2";
|
sha256 = "15b0692i3h8h7b95465b2aw9qf5qjmjag5n62347l8yl7zbhv3l2";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
installShellFiles
|
||||||
|
];
|
||||||
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
# we just move two files into $out,
|
# we just move two files into $out,
|
||||||
@ -18,20 +28,25 @@ stdenv.mkDerivation rec {
|
|||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out
|
installShellCompletion --name gradle \
|
||||||
install -Dm0644 ./_gradle $out/share/zsh/site-functions/_gradle
|
--bash gradle-completion.bash \
|
||||||
install -Dm0644 ./gradle-completion.bash $out/share/bash-completion/completions/gradle
|
--zsh _gradle
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
passthru.updateScript = gitUpdater {
|
||||||
|
rev-prefix = "v";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
description = "Gradle tab completion for bash and zsh";
|
description = "Gradle tab completion for bash and zsh";
|
||||||
homepage = "https://github.com/gradle/gradle-completion";
|
homepage = "https://github.com/gradle/gradle-completion";
|
||||||
license = licenses.mit;
|
license = lib.licenses.mit;
|
||||||
maintainers = [ ] ++ teams.java.members;
|
maintainers = [ ] ++ lib.teams.java.members;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user