vim: Modernize derivation, hopefully fixing cross

This commit is contained in:
John Ericson 2017-05-31 00:53:47 -04:00 committed by John Ericson
parent 167b80ba76
commit 8b22e497f2

View file

@ -6,7 +6,9 @@
sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c";
}
# apple frameworks
, Carbon, Cocoa }:
, Carbon, Cocoa
, buildPlatform, hostPlatform
}:
let
common = callPackage ./common.nix {};
@ -17,12 +19,26 @@ stdenv.mkDerivation rec {
inherit (common) version src postPatch hardeningDisable enableParallelBuilding meta;
buildInputs = [ ncurses pkgconfig ]
++ stdenv.lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
++ stdenv.lib.optionals hostPlatform.isDarwin [ Carbon Cocoa ];
nativeBuildInputs = [ gettext ];
configureFlags = [
"--enable-multibyte"
"--enable-nls"
] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
"vim_cv_toupper_broken=no"
"--with-tlib=ncurses"
"vim_cv_terminfo=yes"
"vim_cv_tty_group=tty"
"vim_cv_tty_mode=0660"
"vim_cv_getcwd_broken=no"
"vim_cv_stat_ignores_slash=yes"
"ac_cv_sizeof_int=4"
"vim_cv_memmove_handles_overlap=yes"
"vim_cv_memmove_handles_overlap=yes"
# TODO(@Ericson2314): wont' be needed soon.
"STRIP=${hostPlatform.config}-strip"
];
postInstall = ''
@ -31,22 +47,6 @@ stdenv.mkDerivation rec {
cp "${vimrc}" $out/share/vim/vimrc
'';
crossAttrs = {
configureFlags = [
"vim_cv_toupper_broken=no"
"--with-tlib=ncurses"
"vim_cv_terminfo=yes"
"vim_cv_tty_group=tty"
"vim_cv_tty_mode=0660"
"vim_cv_getcwd_broken=no"
"vim_cv_stat_ignores_slash=yes"
"ac_cv_sizeof_int=4"
"vim_cv_memmove_handles_overlap=yes"
"vim_cv_memmove_handles_overlap=yes"
"STRIP=${stdenv.cross.config}-strip"
];
};
__impureHostDeps = [ "/dev/ptmx" ];
# To fix the trouble in vim73, that it cannot cross-build with this patch