使用Python3(通过Homebrew安装)支持编译vim?

nee*_*zer 11 python vim osx-snow-leopard python-3.x

我通过自制软件安装了python3: brew install python3 --framework

我已经下载了vim源码(7.3) /usr/src

我跑:

./configure --prefix=/usr/local --enable-rubyinterp --enable-python3interp --disable-gpm --enable-gui=no --enable-multibyte
Run Code Online (Sandbox Code Playgroud)

而在我src/auto/config.log看来:

configure:5442: checking --enable-python3interp argument   
configure:5451: result: yes  
configure:5456: checking for python3  
configure:5489: result: no
Run Code Online (Sandbox Code Playgroud)

我搜索了一些,发现了这个,所以我尝试为python3.2创建符号链接,然后像这样运行configure:

./configure --prefix=/usr/local --enable-rubyinterp --enable-python3interp --disable-gpm --enable-gui=no --enable-multibyte --with-python3-config-dir=/usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config-3.2m
Run Code Online (Sandbox Code Playgroud)

我的日志显示相同的错误.使用Python3支持编译vim需要做什么?

不,我不想使用MacVim.


? ls -al /System/Library/Frameworks/Python.framework/Versions 
total 16
drwxr-xr-x   7 root  wheel  238 May 28 15:33 .
drwxr-xr-x   7 root  wheel  238 Sep 21  2010 ..
drwxr-xr-x   8 root  wheel  272 Sep 17  2010 2.3
drwxr-xr-x  12 root  wheel  408 Dec  1 12:49 2.5
drwxr-xr-x  12 root  wheel  408 Dec  1 12:49 2.6
lrwxr-xr-x   1 root  wheel   70 May 28 15:33 Current -> /usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2
lrwxr-xr-x   1 root  wheel    3 Sep 17  2010 old-Current -> 2.6

? which python3.2
/usr/local/bin/python3.2
Run Code Online (Sandbox Code Playgroud)

更新:我已经通过Homebrew使用Python 2.7.1 开始了这篇文章,但仍然对Python 3没有兴趣......

小智 6

配置脚本存在问题.从python 3.2开始,config和include目录包含了abiflag(参见PEP 3149).

下一个问题是configure脚本解析python配置,并且链接器的标志对于框架构建是不正确的,因此configure脚本中的测试程序无法构建.

我已经发送了一个补丁到vim并且它被包含了(mercurial repo有它).

`./configure --enable-python3interp vi_cv_path_python3=/usr/local/bin/python3.2`
Run Code Online (Sandbox Code Playgroud)

应该管用.

Vim补丁:https: //github.com/codedreality/vim/tree/fix-python3x-support

MacVim补丁:https: //github.com/codedreality/macvim/tree/fix-python3x-support