vim: fix shebangs when cross-compiling

vim does its own shebang patching, which ends up pulling in build platform
tools. This commit patches the build system to use HOST_PATH instead.

I also enabled strictDeps and added additional dependencies needed to make
patchShebangs work on some of the other scripts.

This commit brings the cross-compiled package in line with the native one, but
even the native build has some unpatched shebang references to python, perl and
csh. Additionally, efm_perl.pl has a broken shebang (#! -w) because vim's
build system can't handle not finding perl.
main
Ben Wolsieffer 2 years ago
parent d64abb978c
commit cac4d6469f
  1. 13
      pkgs/applications/editors/vim/default.nix

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, callPackage, ncurses, gettext, pkg-config
{ lib, stdenv, fetchurl, callPackage, ncurses, bash, gawk, gettext, pkg-config
# default vimrc
, vimrc ? fetchurl {
name = "default-vimrc";
@ -18,9 +18,11 @@ stdenv.mkDerivation {
inherit (common) version src postPatch hardeningDisable enableParallelBuilding meta;
nativeBuildInputs = [ gettext pkg-config ];
buildInputs = [ ncurses ]
buildInputs = [ ncurses bash gawk ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
strictDeps = true;
configureFlags = [
"--enable-multibyte"
"--enable-nls"
@ -36,6 +38,13 @@ stdenv.mkDerivation {
"vim_cv_memmove_handles_overlap=yes"
];
# which.sh is used to for vim's own shebang patching, so make it find
# binaries for the host platform.
preConfigure = ''
export HOST_PATH
substituteInPlace src/which.sh --replace '$PATH' '$HOST_PATH'
'';
postInstall = ''
ln -s $out/bin/vim $out/bin/vi
mkdir -p $out/share/vim

Loading…
Cancel
Save