summary refs log tree commit diff
path: root/pkgs/tools/misc/fzf
diff options
context:
space:
mode:
authorMatías Lang <yo@matiaslang.me>2018-05-07 00:42:05 -0300
committerMatías Lang <yo@matiaslang.me>2018-05-07 00:50:44 -0300
commitb917daaf60fbc27f03822ee5e79eae5b34b806fd (patch)
tree088d2f4311b3b63f6968cfc1ab5c0f08e9dc0acf /pkgs/tools/misc/fzf
parent2b499afa63f01473a19c7166c1f3750fa45a1bab (diff)
downloadnixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar.gz
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar.bz2
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar.lz
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar.xz
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.tar.zst
nixpkgs-b917daaf60fbc27f03822ee5e79eae5b34b806fd.zip
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.
Diffstat (limited to 'pkgs/tools/misc/fzf')
-rw-r--r--pkgs/tools/misc/fzf/default.nix9
1 files 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('<sfile>:h:h').'/bin/fzf'|'$bin/bin/fzf'|" plugin/fzf.vim
-    sed -i -e "s|expand('<sfile>:h:h').'/bin/fzf-tmux'|'$bin/bin/fzf-tmux'|" plugin/fzf.vim
+    sed -i -e "s|expand('<sfile>: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 = ''