nixpkgs/pkgs/by-name/zs/zsh-forgit/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-06 12:23:50 +00:00
{ stdenvNoCC
2023-01-06 13:19:34 +00:00
, lib
, bash
, coreutils
, findutils
, fetchFromGitHub
, fzf
2024-09-06 12:23:50 +00:00
, gawk
2023-01-06 13:19:34 +00:00
, git
, gnugrep
, gnused
, makeWrapper
}:
2022-11-24 21:33:57 +00:00
2024-09-06 12:23:50 +00:00
stdenvNoCC.mkDerivation (finalAttrs: {
2022-11-24 21:33:57 +00:00
pname = "zsh-forgit";
2024-11-04 01:12:18 +00:00
version = "24.11.0";
2022-11-24 21:33:57 +00:00
src = fetchFromGitHub {
owner = "wfxr";
repo = "forgit";
2024-09-06 12:23:50 +00:00
rev = "refs/tags/${finalAttrs.version}";
2024-11-04 01:12:18 +00:00
hash = "sha256-8BMFL3WktkkB8m6asbNeb9swnLWi3jHo012fBXGa8ls=";
2022-11-24 21:33:57 +00:00
};
strictDeps = true;
postPatch = ''
substituteInPlace forgit.plugin.zsh \
2024-09-06 12:23:50 +00:00
--replace-fail "\$FORGIT_INSTALL_DIR/bin/git-forgit" "$out/bin/git-forgit"
2022-11-24 21:33:57 +00:00
'';
dontBuild = true;
2022-12-08 13:32:03 +00:00
nativeBuildInputs = [ makeWrapper ];
2022-11-24 21:33:57 +00:00
installPhase = ''
2022-12-08 13:32:03 +00:00
runHook preInstall
install -D bin/git-forgit $out/bin/git-forgit
2023-07-06 09:55:53 +00:00
install -D completions/_git-forgit $out/share/zsh/site-functions/_git-forgit
2024-09-06 12:23:50 +00:00
install -D forgit.plugin.zsh $out/share/zsh/${finalAttrs.pname}/forgit.plugin.zsh
2022-12-08 13:32:03 +00:00
wrapProgram $out/bin/git-forgit \
2024-09-06 12:23:50 +00:00
--prefix PATH : ${lib.makeBinPath [ bash coreutils findutils fzf gawk git gnugrep gnused ]}
2022-12-08 13:32:03 +00:00
runHook postInstall
2022-11-24 21:33:57 +00:00
'';
meta = with lib; {
homepage = "https://github.com/wfxr/forgit";
description = "Utility tool powered by fzf for using git interactively";
mainProgram = "git-forgit";
2022-11-24 21:33:57 +00:00
license = licenses.mit;
maintainers = with maintainers; [ deejayem ];
platforms = platforms.all;
};
2024-09-06 12:23:50 +00:00
})