tig: fix tig-completion's dependency on __git_complete

tig recently updated it's bash-completion making it depend on __git-complete from git.
Becase __git-complete is not automatically sourced tig bash completion fails.
Also this PR makes tig completion load on-demand.
This commit is contained in:
vasile luta 2020-04-14 09:51:32 +03:00 committed by Bjørn Forsman
parent 55e327244a
commit f57da8ef0a

View File

@ -31,10 +31,13 @@ stdenv.mkDerivation rec {
make install
make install-doc
substituteInPlace contrib/tig-completion.zsh \
--replace 'e=$(dirname ''${funcsourcetrace[1]%:*})/tig-completion.bash' "e=$out/etc/bash_completion.d/tig-completion.bash"
# fixes tig-completion __git-complete dependency
sed -i '1s;^;source ${git}/share/bash-completion/completions/git\n;' contrib/tig-completion.bash
install -D contrib/tig-completion.bash $out/etc/bash_completion.d/tig-completion.bash
substituteInPlace contrib/tig-completion.zsh \
--replace 'e=$(dirname ''${funcsourcetrace[1]%:*})/tig-completion.bash' "e=$out/share/bash-completion/completions/tig"
install -D contrib/tig-completion.bash $out/share/bash-completion/completions/tig
install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig
cp contrib/vim.tigrc $out/etc/