Building MacVim with full Python EPD support

January 2, 2011

If you want to use the :python or :pyfile commands or the omnicompletion plugin of Vim on a Mac with EPD, you will most probably want to recompile it with the Python support linked on the EPD instllation in place of the Mac Python.

Here are the steps to follow (done on the latest stable 7.3 sources):

1. As EPD 6.x 64bit on MacOSX does not have the full ETS, you will have to compile it against the 32bit version. So, set the right flags to make it work :

export CFLAGS=-m32
export CPPFLAGS=-m32

Then configure it to use the EPD installation. If your PATH is update to point to EPD, it is straightforward :

./configure --enable-pythoninterp --with-macarchs=i386

The output should contains something like the following lines :

checking Python version... 2.6
checking Python is 1.4 or better... yep
checking Python's install prefix... /Library/Frameworks/Python.framework/Versions/6.3
checking Python's execution prefix... /Library/Frameworks/Python.framework/Versions/6.3
checking Python's configuration directory... /Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/config

Then calling make will result in an issue when generating the icons. It has to use the default Python installation to make them but the default Python installation works in 64bit mode. The EPD Python will miss some modules. To fix that, edit src/MacVim/icons/Makefile and prefix the python calls with the following :

arch -i386 /usr/bin/python $(OUTDIR)

This will ensure you use the default Mac installation in 32bit mode. Do the same for all the python calls in the Makefile.

After that, the app must build fine and you can benefit from the full EPD module list from within MacVim