使用Python3(通过自制程序安装)支持编译vim?

2024-05-29 01:50:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经通过自制程序安装了python3:brew install python3 --framework

我在/usr/src中下载了vim源代码(7.3)

我跑:

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

更新:我已经让它通过自制的Python2.7.1在lathis post上运行,但是仍然没有Python3的乐趣。。。


Tags: noconfigenableconfigureusrlocalframeworkroot
3条回答

当您测试它是否有效时,请确保使用由构建创建的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/

配置脚本有问题。自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`

应该有用。

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

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

我把麦维姆标题栏的颜色改成黑色。我的麦维姆标题栏的颜色改成了ayu深色。 更改macvimMMWindow.m第93行,附加以下代码:

[self setTitleVisibility:NSWindowTitleHidden];
[self setTitlebarAppearsTransparent:YES];
self.backgroundColor = NSColor.blackColor;

用以下命令编译源代码:

./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --enable-terminal --enable-python3interp --with-properly-linked-python2-python3 --enable-python3interp=yes --enable-cscope 

enter image description here

相关问题 更多 >

    热门问题