2011-05-28 94 views
11

我已经python3通过自制软件安装:brew install python3 --framework用Python3编译vim(通过Homebrew安装)支持?

我有VIM源(7.3)在/usr/src

下载我运行:

./configure --prefix=/usr/local --enable-rubyinterp --enable-python3interp --disable-gpm --enable-gui=no --enable-multibyte 

在我src/auto/config.log我看到:

configure:5442: checking --enable-python3interp argument 
configure:5451: result: yes 
configure:5456: checking for python3 
configure:5489: result: no 

我搜索了一些,发现this,所以我试着让对于python3.2Ë符号连接,然后运行配置是这样的:

./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 

我的日志显示相同的错误。我需要做什么才能使用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 

更新:我已经得到它通过家酿工作一拉this post与Python 2.7.1,但与Python 3仍然没有喜悦...

回答

6

没有与配置脚本的一个问题。从Python 3.2开始,config和include目录包含abiflag(请参阅PEP 3149)。

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

我已经给vim发送了一个补丁,它包含了(mercurial repo有)。

`./configure --enable-python3interp vi_cv_path_python3=/usr/local/bin/python3.2` 

应该工作。

Vim的修补程序: https://github.com/codedreality/vim/tree/fix-python3x-support

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

+0

是的!它终于有效。谢谢你的补丁! – neezer 2011-06-20 15:23:48

+0

Vim Patch的链接已损坏。有什么建议么? – 2014-03-11 16:28:41

+0

路径链接对我来说也是破碎的。请提出一些建议,因为这仍然是坏的 – vitiral 2014-11-24 15:17:20

2

当你测试一下看看它是否有效,确保你使用由build创建的Vim二进制文件 - 而不是mvim脚本。 mvim(即使您在源代码树上调用该版本)将首先在/ Applications/for MacVim.app中查找。

也许这会给你一些快乐:

./configure \ 
    --enable-python3interp=dynamic \ 
    --with-python3-config-dir=/usr/local/Cellar/python3/3.2/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config/ 
+0

没有喜悦。我在我的日志中得到了同样的错误:'检查--enable-python3interp参数...动态/检查python3 ...否'。另外,我知道我正在检查正确的二进制文件:(在vim src目录中)➜./src/vim --version'。 – neezer 2011-06-07 19:47:28

+0

尝试使用autoconf变量强制执行python版本查找。 ./configure --enable-python3interp = dynamic --with-python3-config-dir = blah/blah vi_cv_path_python3 =/usr/local/bin/python3.2 – synthesizerpatel 2011-06-07 21:28:31

+0

不,这也行不通。它似乎在配置输出(https://gist.github.com/1014434)中找到它,但变量未在'/ src/auto/config.mk'中定义(https://gist.github .com/1014435),编译后的二进制文件仍然会读取“-python3”。任何其他想法? – neezer 2011-06-08 13:39:24