From 083220867c71443b0473374e8abe871cecb8b7d9 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 28 Aug 2018 13:30:25 +0300 Subject: [PATCH] Improve re-wrapping in case of GTK3 --- .../applications/editors/vim/configurable.nix | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 3711b3cdcee..2f2c787ffac 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -155,9 +155,26 @@ in stdenv.mkDerivation rec { '' + stdenv.lib.optionalString wrapPythonDrv '' wrapProgram "$out/bin/vim" --prefix PATH : "${python}/bin" '' + stdenv.lib.optionalString (guiSupport == "gtk3") '' - rm "$out/bin/gvim" - echo -e '#!${stdenv.shell}\n"'"$out/bin/vim"'" -g "$@"' > "$out/bin/gvim" - chmod a+x "$out/bin/gvim" + + rewrap () { + rm -f "$out/bin/$1" + echo -e '#!${stdenv.shell}\n"'"$out/bin/vim"'" '"$2"' "$@"' > "$out/bin/$1" + chmod a+x "$out/bin/$1" + } + + rewrap ex -e + rewrap view -R + rewrap gvim -g + rewrap gex -eg + rewrap gview -Rg + rewrap rvim -Z + rewrap rview -RZ + rewrap rgvim -gZ + rewrap rgview -RgZ + rewrap evim -y + rewrap eview -yR + rewrap vimdiff -d + rewrap gvimdiff -gd ''; preInstall = ''