Improve re-wrapping in case of GTK3
commit083220867c71443b0473374e8abe871cecb8b7d9
authorMichael Raskin <7c6f434c@mail.ru>
dateTue 28 Aug 2018, 13:30 (8 years ago)
parent9006cd3
pkgs/applications/editors/vim/configurable.nix+20−3
@@ -155,9 +155,26 @@ in stdenv.mkDerivation rec {
155155 '' + stdenv.lib.optionalString wrapPythonDrv ''
156156 wrapProgram "$out/bin/vim" --prefix PATH : "${python}/bin"
157157 '' + stdenv.lib.optionalString (guiSupport == "gtk3") ''
158− rm "$out/bin/gvim"
159− echo -e '#!${stdenv.shell}\n"'"$out/bin/vim"'" -g "$@"' > "$out/bin/gvim"
160− chmod a+x "$out/bin/gvim"
158+
159+ rewrap () {
160+ rm -f "$out/bin/$1"
161+ echo -e '#!${stdenv.shell}\n"'"$out/bin/vim"'" '"$2"' "$@"' > "$out/bin/$1"
162+ chmod a+x "$out/bin/$1"
163+ }
164+
165+ rewrap ex -e
166+ rewrap view -R
167+ rewrap gvim -g
168+ rewrap gex -eg
169+ rewrap gview -Rg
170+ rewrap rvim -Z
171+ rewrap rview -RZ
172+ rewrap rgvim -gZ
173+ rewrap rgview -RgZ
174+ rewrap evim -y
175+ rewrap eview -yR
176+ rewrap vimdiff -d
177+ rewrap gvimdiff -gd
161178 '';
162179
163180 preInstall = ''