2014-11-02 00:43:19 +00:00
|
|
|
{ stdenv, fetchurl, ncurses, gettext,
|
2014-06-06 22:45:22 +01:00
|
|
|
pkgconfig, cscope, python, ruby, tcl, perl, luajit
|
|
|
|
}:
|
|
|
|
|
2014-10-18 06:15:45 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2014-06-06 22:45:22 +01:00
|
|
|
name = "macvim-${version}";
|
|
|
|
|
2014-10-18 06:15:45 +01:00
|
|
|
version = "7.4.479";
|
2014-06-06 22:45:22 +01:00
|
|
|
|
2014-11-02 00:43:19 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/genoma/macvim/archive/g-snapshot-21.tar.gz";
|
2014-11-03 21:26:59 +00:00
|
|
|
sha256 = "1s86dpb8bcxh309gikiz8gm9ygv3d2jy6i4qlnxarbvcdk65fzv4";
|
2014-06-06 22:45:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gettext ncurses pkgconfig luajit ruby tcl perl python
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./macvim.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2014-06-07 21:18:27 +01:00
|
|
|
substituteInPlace src/MacVim/mvim --replace "# VIM_APP_DIR=/Applications" "VIM_APP_DIR=$out/Applications"
|
2014-06-06 22:45:22 +01: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 06:15:45 +01:00
|
|
|
"--without-local-dir"
|
2014-06-06 22:45:22 +01: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 06:15:45 +01:00
|
|
|
makeFlags = ''PREFIX=$(out) CPPFLAGS="-Wno-error"'';
|
|
|
|
|
2014-06-06 22:45:22 +01:00
|
|
|
preConfigure = ''
|
|
|
|
DEV_DIR=$(/usr/bin/xcode-select -print-path)/Platforms/MacOSX.platform/Developer
|
|
|
|
configureFlagsArray+=(
|
|
|
|
"--with-developer-dir=$DEV_DIR"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/Applications
|
2014-06-07 21:18:27 +01:00
|
|
|
cp -r src/MacVim/build/Release/MacVim.app $out/Applications
|
2014-06-06 22:45:22 +01: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 21:18:27 +01:00
|
|
|
exe="$out/Applications/MacVim.app/Contents/MacOS/Vim"
|
2014-06-06 22:45:22 +01: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; {
|
|
|
|
description = "Vim - the text editor - for Mac OS X";
|
|
|
|
homepage = https://github.com/b4winckler/macvim;
|
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|