From 4bf1a7d97545f957e18d2fb9f00ddcb7e545f792 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 23 Sep 2018 19:36:22 +0200 Subject: [PATCH] tig: fix zsh completion The ZSH completion script of `tig` basically imports the bash completion script and uses it as completion approach. Unfortunately the script takes several assumptions about the directory structure using `$funcsourcetrace`[1] that don't apply on NixOS. The easiest workaround is t opatch the completion script and import the bash completion script from `$out`. [1] http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#index-funcsourcetrace --- .../version-management/git-and-tools/tig/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/version-management/git-and-tools/tig/default.nix b/pkgs/applications/version-management/git-and-tools/tig/default.nix index 6d2753e45437..a407f6e7ab12 100644 --- a/pkgs/applications/version-management/git-and-tools/tig/default.nix +++ b/pkgs/applications/version-management/git-and-tools/tig/default.nix @@ -31,6 +31,10 @@ stdenv.mkDerivation rec { installPhase = '' 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" + install -D contrib/tig-completion.bash $out/etc/bash_completion.d/tig-completion.bash install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig cp contrib/vim.tigrc $out/etc/