From b917daaf60fbc27f03822ee5e79eae5b34b806fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Lang?= Date: Mon, 7 May 2018 00:42:05 -0300 Subject: [PATCH] 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: https://github.com/junegunn/fzf/commit/02ceae15a235de6b5cd2aca9de070fb3fff78e5b 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. --- pkgs/tools/misc/fzf/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/fzf/default.nix b/pkgs/tools/misc/fzf/default.nix index 1eb4393c978..d9da04c1fa1 100644 --- a/pkgs/tools/misc/fzf/default.nix +++ b/pkgs/tools/misc/fzf/default.nix @@ -23,8 +23,13 @@ buildGoPackage rec { goDeps = ./deps.nix; patchPhase = '' - sed -i -e "s|expand(':h:h').'/bin/fzf'|'$bin/bin/fzf'|" plugin/fzf.vim - sed -i -e "s|expand(':h:h').'/bin/fzf-tmux'|'$bin/bin/fzf-tmux'|" plugin/fzf.vim + sed -i -e "s|expand(':h:h')|'$bin'|" 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 = ''