fzf: fix vim plugin patch phase

During patch phase, the path to the fzf binary is overwritten in the vim
plugin source. The sed expression doing this wasn't working because the fzf
code changed in this commit:
02ceae15a2
making the patch useless.

I fixed it and added a check to verify that the plugin was effecively
patched to prevent this to happen in the future.
This commit is contained in:
Matías Lang 2018-05-07 00:42:05 -03:00
parent 2b499afa63
commit b917daaf60

View File

@ -23,8 +23,13 @@ buildGoPackage rec {
goDeps = ./deps.nix; goDeps = ./deps.nix;
patchPhase = '' patchPhase = ''
sed -i -e "s|expand('<sfile>:h:h').'/bin/fzf'|'$bin/bin/fzf'|" plugin/fzf.vim sed -i -e "s|expand('<sfile>:h:h')|'$bin'|" plugin/fzf.vim
sed -i -e "s|expand('<sfile>:h:h').'/bin/fzf-tmux'|'$bin/bin/fzf-tmux'|" plugin/fzf.vim
# Original and output files can't be the same
if cmp -s $src/plugin/fzf.vim plugin/fzf.vim; then
echo "Vim plugin patch not applied properly. Aborting" && \
exit 1
fi
''; '';
preInstall = '' preInstall = ''