Merge pull request #178353 from lopsided98/vim-cross-shebang

vim: fix shebangs when cross-compiling
main
Bernardo Meurer 2 years ago committed by GitHub
commit a36554623e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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