summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-05-31 00:53:47 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-22 17:53:53 -0400
commit8b22e497f2bbffca98dc73502b1873595fb36ea9 (patch)
tree1168d84e2da965758388d71a822f20872bcb74a6 /pkgs
parent167b80ba76ae767b1d37458afb113683921d8c74 (diff)
downloadnixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar.gz
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar.bz2
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar.lz
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar.xz
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.tar.zst
nixlib-8b22e497f2bbffca98dc73502b1873595fb36ea9.zip
vim: Modernize derivation, hopefully fixing cross
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/editors/vim/default.nix36
1 files changed, 18 insertions, 18 deletions
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index 98e9a47a7604..b8fee7bd1e24 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -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