mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
ugit: init at 5.8
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
This commit is contained in:
parent
dd89098d75
commit
9f1bc42ec8
77
pkgs/by-name/ug/ugit/package.nix
Normal file
77
pkgs/by-name/ug/ugit/package.nix
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchFromGitHub,
|
||||
git,
|
||||
fzf,
|
||||
bash,
|
||||
ncurses,
|
||||
curl,
|
||||
nix-update-script,
|
||||
testers,
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "ugit";
|
||||
version = "5.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Bhupesh-V";
|
||||
repo = "ugit";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-WnEyS2JKH6rrsYOeGEwughWq2LKrHPSjio3TOI0Xm4g=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
buildInputs = [
|
||||
fzf
|
||||
curl
|
||||
bash
|
||||
ncurses
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ git ];
|
||||
nativeInstallCheckInputs = [ ncurses ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace ugit \
|
||||
--replace-fail "fzf " "${lib.getExe fzf} " \
|
||||
--replace-fail "curl" "${lib.getExe curl}" \
|
||||
--replace-fail "tput " "${ncurses}/bin/tput "
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 ugit $out/bin/ugit
|
||||
ln -s $out/bin/ugit $out/bin/git-undo
|
||||
install -Dm644 ugit.plugin.zsh $out/share/zsh/ugit/ugit.zsh
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
PATH=$PATH:$out/bin ugit --help
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Tool that helps undoing the last git command with grace";
|
||||
homepage = "https://github.com/Bhupesh-V/ugit";
|
||||
downloadPage = "https://github.com/Bhupesh-V/ugit/releases";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "ugit";
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ d-brasher ];
|
||||
};
|
||||
})
|
Loading…
Reference in New Issue
Block a user