From bad51b0b024cc3fc0b90d02e2ab8ada044a57818 Mon Sep 17 00:00:00 2001 From: Charles Strahan Date: Sat, 18 Oct 2014 01:15:45 -0400 Subject: [PATCH] Fix MacVim by using clang. --- pkgs/applications/editors/vim/macvim.nix | 12 ++++---- pkgs/applications/editors/vim/macvim.patch | 33 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix index feafa7b99777..8fc3a4108d2d 100644 --- a/pkgs/applications/editors/vim/macvim.nix +++ b/pkgs/applications/editors/vim/macvim.nix @@ -1,17 +1,16 @@ -{ stdenv, stdenvAdapters, gccApple, fetchFromGitHub, ncurses, gettext, +{ stdenv, fetchFromGitHub, ncurses, gettext, pkgconfig, cscope, python, ruby, tcl, perl, luajit }: -let inherit (stdenvAdapters.overrideGCC stdenv gccApple) mkDerivation; -in mkDerivation rec { +stdenv.mkDerivation rec { name = "macvim-${version}"; - version = "7.4.355"; + version = "7.4.479"; src = fetchFromGitHub { owner = "genoma"; repo = "macvim"; - rev = "c18a61f9723565664ffc2eda9179e96c95860e25"; + rev = "f9c084b97fa9d5cad2448dfd3eff3d9b7f0fac59"; sha256 = "190bngg8m4bwqcia7w24gn7mmqkhk0mavxy81ziwysam1f652ymf"; }; @@ -46,6 +45,7 @@ in mkDerivation rec { "--enable-perlinterp=dynamic" "--enable-rubyinterp=dynamic" "--enable-tclinterp=yes" + "--without-local-dir" "--with-luajit" "--with-lua-prefix=${luajit}" "--with-ruby-command=${ruby}/bin/ruby" @@ -54,6 +54,8 @@ in mkDerivation rec { "--with-compiledby=Nix" ]; + makeFlags = ''PREFIX=$(out) CPPFLAGS="-Wno-error"''; + preConfigure = '' DEV_DIR=$(/usr/bin/xcode-select -print-path)/Platforms/MacOSX.platform/Developer configureFlagsArray+=( diff --git a/pkgs/applications/editors/vim/macvim.patch b/pkgs/applications/editors/vim/macvim.patch index a789b9952d2b..a42ebd4cc03c 100644 --- a/pkgs/applications/editors/vim/macvim.patch +++ b/pkgs/applications/editors/vim/macvim.patch @@ -187,3 +187,36 @@ index bc9f074..9b9125e 100755 # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 + +diff --git a/src/Makefile b/src/Makefile +index 1c4d104..fff2015 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -1298,7 +1298,7 @@ MACVIMGUI_SRC = gui.c gui_beval.c MacVim/gui_macvim.m MacVim/MMBackend.m \ + MacVim/MacVim.m + MACVIMGUI_OBJ = objects/gui.o objects/gui_beval.o objects/pty.o \ + objects/gui_macvim.o objects/MMBackend.o objects/MacVim.o +-MACVIMGUI_DEFS = -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe ++MACVIMGUI_DEFS = -DMACOS_X_UNIX -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe + MACVIMGUI_IPATH = + MACVIMGUI_LIBS_DIR = + MACVIMGUI_LIBS1 = -framework Cocoa -framework Carbon + +diff --git a/src/if_python.c b/src/if_python.c +index b356bf7..b7bfa78 100644 +--- a/src/if_python.c ++++ b/src/if_python.c +@@ -55,11 +55,7 @@ + + #define PY_SSIZE_T_CLEAN + +-#ifdef FEAT_GUI_MACVIM +-# include +-#else +-# include +-#endif ++#include + + #if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000 + # undef PY_SSIZE_T_CLEAN + MACVIMGUI_LIBS1 = -framework Cocoa -framework Carbon diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 47c1a48bb14b..152b5f1b37aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10504,7 +10504,7 @@ let vim = callPackage ../applications/editors/vim { }; - macvim = callPackage ../applications/editors/vim/macvim.nix { }; + macvim = callPackage ../applications/editors/vim/macvim.nix { stdenv = clangStdenv; }; vimHugeX = vim_configurable;