Skip to content

Instantly share code, notes, and snippets.

@klen
Last active September 3, 2021 05:31
Show Gist options
  • Save klen/3d327e5f84e36dc04bd7 to your computer and use it in GitHub Desktop.
Save klen/3d327e5f84e36dc04bd7 to your computer and use it in GitHub Desktop.
OSX vim +python +python3 (pyenv)
#! /bin/sh
# This is just a stub for the Unix configure script, to provide support for
# doing "./configure" in the top Vim directory.
PY_CONFIG=`pyenv prefix 2.7.11/lib/python2.7/config`
PY3_PREFIX=`pyenv prefix 3.4.4`
PY3_CONFIG=`$PY3_PREFIX/bin/python-config --configdir`
cd src && exec ./configure \
--with-features=huge \
--enable-multibyte \
--enable-pythoninterp=dynamic \
--enable-python3interp=dynamic \
--with-python-config-dir=$PY_CONFIG \
--with-python3-config-dir=$PY3_CONFIG \
--enable-cscope \
--prefix=/usr/local $@
# cd src && exec ./configure "$@"
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -fk 2.7.11
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -fk 3.4.4
$ mkdir -p ~/lib
$ cd ~/lib
$ ln -s ../.pyenv/versions/2.7.11/lib/libpython2.7.dylib
$ ln -s ../.pyenv/versions/3.4.4/lib/libpython3.4m.dylib
@cryptoeraser
Copy link

Great resource, thank you very much! Question about the .dylib bit.

How does Python(s) and Vim know where to find the .dylib files. In your case, ~/lib is not a standard LD path?

~/lib/libpython2.7.dylib -> ../.pyenv/versions/2.7.11/lib/libpython2.7.dylib
~/lib/libpython3.4m.dylib -> ../.pyenv/versions/3.4.4/lib/libpython3.4m.dylib

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment