2011-05-28 43 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