2015-11-15 06:50:31 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ncurses, gettext
|
|
|
|
, pkgconfig, cscope, python, ruby, tcl, perl, luajit
|
2016-05-07 02:50:52 +02:00
|
|
|
, darwin
|
2014-06-06 23:45:22 +02:00
|
|
|
}:
|
|
|
|
|
2014-10-18 07:15:45 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2014-06-06 23:45:22 +02:00
|
|
|
name = "macvim-${version}";
|
|
|
|
|
2015-11-15 06:50:31 +01:00
|
|
|
version = "7.4.909";
|
2014-06-06 23:45:22 +02:00
|
|
|
|
2015-11-15 06:50:31 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "macvim-dev";
|
|
|
|
repo = "macvim";
|
|
|
|
rev = "75aa7774645adb586ab9010803773bd80e659254";
|
|
|
|
sha256 = "0k04jimbms6zffh8i8fjm2y51q01m5kga2n4djipd3pxij1qy89y";
|
2014-06-06 23:45:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-09-14 21:24:37 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2014-06-06 23:45:22 +02:00
|
|
|
buildInputs = [
|
2017-09-14 21:24:37 +02:00
|
|
|
gettext ncurses luajit ruby tcl perl python
|
2014-06-06 23:45:22 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./macvim.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-06-07 22:18:27 +02:00
|
|
|
substituteInPlace src/MacVim/mvim --replace "# VIM_APP_DIR=/Applications" "VIM_APP_DIR=$out/Applications"
|
2014-06-06 23:45:22 +02:00
|
|
|
|
|
|
|
# Don't create custom icons.
|
|
|
|
substituteInPlace src/MacVim/icons/Makefile --replace '$(MAKE) -C makeicns' ""
|
|
|
|
substituteInPlace src/MacVim/icons/make_icons.py --replace "dont_create = False" "dont_create = True"
|
|
|
|
|
|
|
|
# Full path to xcodebuild
|
|
|
|
substituteInPlace src/Makefile --replace "xcodebuild" "/usr/bin/xcodebuild"
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
#"--enable-cscope" # TODO: cscope doesn't build on Darwin yet
|
|
|
|
"--enable-fail-if-missing"
|
|
|
|
"--with-features=huge"
|
|
|
|
"--enable-gui=macvim"
|
|
|
|
"--enable-multibyte"
|
|
|
|
"--enable-nls"
|
|
|
|
"--enable-luainterp=dynamic"
|
|
|
|
"--enable-pythoninterp=dynamic"
|
|
|
|
"--enable-perlinterp=dynamic"
|
|
|
|
"--enable-rubyinterp=dynamic"
|
|
|
|
"--enable-tclinterp=yes"
|
2014-10-18 07:15:45 +02:00
|
|
|
"--without-local-dir"
|
2014-06-06 23:45:22 +02:00
|
|
|
"--with-luajit"
|
|
|
|
"--with-lua-prefix=${luajit}"
|
|
|
|
"--with-ruby-command=${ruby}/bin/ruby"
|
|
|
|
"--with-tclsh=${tcl}/bin/tclsh"
|
|
|
|
"--with-tlib=ncurses"
|
|
|
|
"--with-compiledby=Nix"
|
|
|
|
];
|
|
|
|
|
2014-10-18 07:15:45 +02:00
|
|
|
makeFlags = ''PREFIX=$(out) CPPFLAGS="-Wno-error"'';
|
|
|
|
|
2015-11-15 06:50:31 +01:00
|
|
|
# This is unfortunate, but we need to use the same compiler as XCode,
|
|
|
|
# but XCode doesn't provide a way to configure the compiler.
|
|
|
|
#
|
|
|
|
# If you're willing to modify the system files, you can do this:
|
|
|
|
# http://hamelot.co.uk/programming/add-gcc-compiler-to-xcode-6/
|
|
|
|
#
|
|
|
|
# But we don't have that option.
|
2014-06-06 23:45:22 +02:00
|
|
|
preConfigure = ''
|
2015-11-15 06:50:31 +01:00
|
|
|
CC=/usr/bin/clang
|
|
|
|
|
2014-06-06 23:45:22 +02:00
|
|
|
DEV_DIR=$(/usr/bin/xcode-select -print-path)/Platforms/MacOSX.platform/Developer
|
|
|
|
configureFlagsArray+=(
|
|
|
|
"--with-developer-dir=$DEV_DIR"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2016-05-07 02:50:52 +02:00
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace src/auto/config.mk --replace "PERL_CFLAGS =" "PERL_CFLAGS = -I${darwin.libutil}/include"
|
|
|
|
'';
|
|
|
|
|
2014-06-06 23:45:22 +02:00
|
|
|
postInstall = ''
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p $out/Applications
|
2014-06-07 22:18:27 +02:00
|
|
|
cp -r src/MacVim/build/Release/MacVim.app $out/Applications
|
2016-03-10 17:38:13 +01:00
|
|
|
rm -rf $out/MacVim.app
|
2014-06-06 23:45:22 +02:00
|
|
|
|
|
|
|
rm $out/bin/{Vimdiff,Vimtutor,Vim,ex,rVim,rview,view}
|
|
|
|
|
|
|
|
cp src/MacVim/mvim $out/bin
|
|
|
|
cp src/vimtutor $out/bin
|
|
|
|
|
|
|
|
for prog in "vimdiff" "vi" "vim" "ex" "rvim" "rview" "view"; do
|
|
|
|
ln -s $out/bin/mvim $out/bin/$prog
|
|
|
|
done
|
|
|
|
|
|
|
|
# Fix rpaths
|
2014-06-07 22:18:27 +02:00
|
|
|
exe="$out/Applications/MacVim.app/Contents/MacOS/Vim"
|
2014-06-06 23:45:22 +02:00
|
|
|
libperl=$(dirname $(find ${perl} -name "libperl.dylib"))
|
|
|
|
install_name_tool -add_rpath ${luajit}/lib $exe
|
|
|
|
install_name_tool -add_rpath ${tcl}/lib $exe
|
|
|
|
install_name_tool -add_rpath ${python}/lib $exe
|
|
|
|
install_name_tool -add_rpath $libperl $exe
|
|
|
|
install_name_tool -add_rpath ${ruby}/lib $exe
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-02-14 10:53:54 +01:00
|
|
|
broken = true; # needs ruby 2.2
|
2017-08-07 00:05:18 +02:00
|
|
|
description = "Vim - the text editor - for macOS";
|
2014-06-06 23:45:22 +02:00
|
|
|
homepage = https://github.com/b4winckler/macvim;
|
2015-05-28 19:20:29 +02:00
|
|
|
license = licenses.vim;
|
2014-06-06 23:45:22 +02:00
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|