如何在Ubuntu 編譯 Vim
2011/07/19
下載 Source Code
Vim 是用 Mercuial 來做版本控制,所以要安裝 Mercuial 才能進行下載 Source Code.# sudo apt-get install mercuial # hg clone https://vim.googlecode.com/hg/ vim73
Compile Source Code
建立Compile Souce Code 的 Shell script.# cd vim73 # touch compile-custom # chmod +x compile-custom # vi compile-custom將以下內容貼入檔案
#!/bin/bash export CONF_OPT_OUTPUT='--enable-fontset' export CONF_OPT_INPUT='--enable-xim' export CONF_OPT_GUI='--enable-gui=gtk2' export CONF_OPT_PYTHON='--enable-pythoninterp' export CONF_OPT_RUBY='--enable-rubyinterp' export CONF_OPT_PERL='--enable-perlinterp' export CONF_OPT_MULTIBYTE='--enable-multibyte' export CONF_OPT_FEAT='--with-features=huge' export CONF_OPT_COMPBY='--with-compiledby=Damon Huang' # Prepare environment # X11 apt-get install libx11-dev xorg-dev # GTK2 apt-get install libgtk2.0-0 libgtk2.0-dev # Python apt-get install python python-dev # Ruby apt-get install ruby ruby-dev # curses apt-get install libncurses5-dev cd src make distclean ./configure $CONF_OPT_FEAT $CONF_OPT_GUI $CONF_OPT_INPUT $CONF_OPT_OUTPUT $CONF_OPT_MULTIBYTE $C make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/vim73 MAKE="make -e" make install update-alternatives --install /usr/bin/editor editor /usr/bin/vim 50 update-alternatives --install /usr/bin/vi vi /usr/bin/vim 50
執行Script
# ./configure-custom
更新方式(好像也可以用上Patch方式來更新,但似乎也是要重新編譯)
# cd vim73 # hg pull warning: vim.googlecode.com certificate with fingerprint ed:19:7c:b9:a3:48:27:93:72:74:43:db:26:40:af:e0:7a:90:1c:97 not verified (check hostfingerprints or web.cacerts config setting) pulling from https://vim.googlecode.com/hg/ searching for changes adding changesets adding manifests adding file changes added 30 changesets with 55 changes to 23 files (run 'hg update' to get a working copy) # hg update 23 files updated, 0 files merged, 0 files removed, 0 files unresolved # ./configure-custom
標籤:
Vim