diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix new file mode 100644 index 00000000000..25a8e5fe9fa --- /dev/null +++ b/pkgs/applications/editors/vim/macvim.nix @@ -0,0 +1,92 @@ +{ stdenv, stdenvAdapters, gccApple, fetchFromGitHub, ncurses, gettext, + pkgconfig, cscope, python, ruby, tcl, perl, luajit +}: + +let inherit (stdenvAdapters.overrideGCC stdenv gccApple) mkDerivation; +in mkDerivation rec { + name = "macvim-${version}"; + + version = "7.4-73"; + + src = fetchFromGitHub { + owner = "b4winckler"; + repo = "macvim"; + rev = "snapshot-73"; + sha256 = "0zv82y2wz8b482khkgbl08cnxq3pv5bm37c71wgfa0fzy3h12gcj"; + }; + + enableParallelBuilding = true; + + buildInputs = [ + gettext ncurses pkgconfig luajit ruby tcl perl python + ]; + + patches = [ ./macvim.patch ]; + + postPatch = '' + substituteInPlace src/MacVim/mvim --replace "# VIM_APP_DIR=/Applications" "VIM_APP_DIR=$out" + + # 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" + "--with-luajit" + "--with-lua-prefix=${luajit}" + "--with-ruby-command=${ruby}/bin/ruby" + "--with-tclsh=${tcl}/bin/tclsh" + "--with-tlib=ncurses" + "--with-compiledby=Nix" + ]; + + preConfigure = '' + DEV_DIR=$(/usr/bin/xcode-select -print-path)/Platforms/MacOSX.platform/Developer + configureFlagsArray+=( + "--with-developer-dir=$DEV_DIR" + ) + ''; + + postInstall = '' + cp -r src/MacVim/build/Release/MacVim.app $out + + 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 + exe="$out/MacVim.app/Contents/MacOS/Vim" + 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; + }; +} diff --git a/pkgs/applications/editors/vim/macvim.patch b/pkgs/applications/editors/vim/macvim.patch new file mode 100644 index 00000000000..c721bbe149a --- /dev/null +++ b/pkgs/applications/editors/vim/macvim.patch @@ -0,0 +1,159 @@ +diff --git a/src/vimtutor b/src/vimtutor +index 70d9ec7..b565a1a 100755 +--- a/src/vimtutor ++++ b/src/vimtutor +@@ -16,7 +16,7 @@ seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi" + if test "$1" = "-g"; then + # Try to use the GUI version of Vim if possible, it will fall back + # on Vim if Gvim is not installed. +- seq="gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq" ++ seq="mvim gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq" + shift + fi + + +diff --git a/src/auto/configure b/src/auto/configure +index bc9f074..9b9125e 100755 +--- a/src/auto/configure ++++ b/src/auto/configure +@@ -2252,7 +2252,7 @@ rm -f conftest.val + as_fn_set_status $ac_retval + + } # ac_fn_c_compute_int +-cat >auto/config.log <<_ACEOF ++cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +@@ -2262,7 +2262,7 @@ generated by GNU Autoconf 2.69. Invocation command line was + $ $0 $@ + + _ACEOF +-exec 5>>auto/config.log ++exec 5>>config.log + { + cat <<_ASUNAME + ## --------- ## +@@ -5377,10 +5377,7 @@ $as_echo "no" >&6; } + fi + + if test "X$vi_cv_path_mzscheme_pfx" != "X"; then +- if test "x$MACOSX" = "xyes"; then +- MZSCHEME_LIBS="-framework Racket" +- MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" +- elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then ++ if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then + MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" + MZSCHEME_CFLAGS="-DMZ_PRECISE_GC" + elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then +@@ -5716,23 +5713,6 @@ $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&6; } + fi + + if test "x$MACOSX" = "xyes"; then +- dir=/System/Library/Perl +- darwindir=$dir/darwin +- if test -d $darwindir; then +- PERL=/usr/bin/perl +- else +- dir=/System/Library/Perl/5.8.1 +- darwindir=$dir/darwin-thread-multi-2level +- if test -d $darwindir; then +- PERL=/usr/bin/perl +- fi +- fi +- if test -n "$PERL"; then +- PERL_DIR="$dir" +- PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE" +- PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a" +- PERL_LIBS="-L$darwindir/CORE -lperl" +- fi + PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + fi +@@ -5926,10 +5906,6 @@ __: + eof + eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" + rm -f -- "${tmp_mkf}" +- if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \ +- "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then +- vi_cv_path_python_plibs="-framework Python" +- else + if test "${vi_cv_var_python_version}" = "1.4"; then + vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a" + else +@@ -5937,7 +5913,6 @@ eof + fi + vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" + vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` +- fi + + fi + +@@ -6004,13 +5979,6 @@ rm -f core conftest.err conftest.$ac_objext \ + $as_echo "no" >&6; } + fi + +- if test -n "$MACSDK"; then +- PYTHON_CFLAGS= +- PYTHON_LIBS=-framework Python +- PYTHON_CONFDIR= +- PYTHON_GETPATH_CFLAGS= +- fi +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python are sane" >&5 + $as_echo_n "checking if compile and link flags for Python are sane... " >&6; } + cflags_save=$CFLAGS +@@ -6853,11 +6821,7 @@ $as_echo "$tclver - OK" >&6; }; + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5 + $as_echo_n "checking for location of Tcl include... " >&6; } +- if test "x$MACOSX" != "xyes"; then + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver" +- else +- tclinc="/System/Library/Frameworks/Tcl.framework/Headers" +- fi + TCL_INC= + for try in $tclinc; do + if test -f "$try/tcl.h"; then +@@ -6875,12 +6839,8 @@ $as_echo "" >&6; } + if test -z "$SKIP_TCL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of tclConfig.sh script" >&5 + $as_echo_n "checking for location of tclConfig.sh script... " >&6; } +- if test "x$MACOSX" != "xyes"; then + tclcnf=`echo $tclinc | sed s/include/lib/g` + tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`" +- else +- tclcnf="/System/Library/Frameworks/Tcl.framework" +- fi + for try in $tclcnf; do + if test -f $try/tclConfig.sh; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/tclConfig.sh" >&5 +@@ -7050,10 +7010,6 @@ $as_echo "$rubyhdrdir" >&6; } + if test -f "$rubylibdir/$librubya"; then + librubyarg="$librubyarg" + RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" +- elif test -d "/System/Library/Frameworks/Ruby.framework"; then +- RUBY_LIBS="-framework Ruby" +- RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion" +- librubyarg= + fi + + if test "X$librubyarg" != "X"; then +@@ -14061,7 +14017,7 @@ fi + + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +-exec 5>>auto/config.log ++exec 5>>config.log + { + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +@@ -14653,7 +14609,7 @@ if test "$no_create" != yes; then + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false +- exec 5>>auto/config.log ++ exec 5>>config.log + # 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/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ede5259f1ba..ad3eefec859 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9586,6 +9586,8 @@ let vim = callPackage ../applications/editors/vim { }; + macvim = callPackage ../applications/editors/vim/macvim.nix { }; + vimWrapper = wrapVim vim; vimHugeX = vim_configurable;