public
Created

Shell script to build the latest Vim directly from the Mercurial repository

  • Download Gist
build-vim.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#!/bin/bash -e
 
# To build a debug version of Vim, edit src/Makefile:
# 1. Use the gcc -g command line argument to compile with debugging symbols
# 2. Set STRIP to /bin/true so that debugging symbols are not stripped
 
# By default this script performs a full rebuild.
# If you pass any argument it will not do so.
RECONFIG=true
if [ $# -gt 0 ]; then
RECONFIG=false
fi
 
standout () { tput bold; echo; echo "$@"; echo; tput sgr0; }
 
BUILD_DIR=Sources
cd ~/Development/Vim
 
# Prepare environment.
export CONF_OPT_COMPBY='--with-compiledby=peter@peterodding.com'
export CONF_OPT_CSCOPE='--enable-cscope'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_GUI='--enable-gnome-check'
export CONF_OPT_LUA='--enable-luainterp'
export CONF_OPT_LUA_PREFIX='--with-lua-prefix=/usr'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_PYTHON='--enable-pythoninterp'
 
if [ ! -d $BUILD_DIR ]; then
standout "Installing dependencies"
sudo apt-get build-dep vim-gnome
sudo apt-get install autoconf lua5.1 liblua5.1-0-dev
standout "Cloning repository"
hg clone https://vim.googlecode.com/hg/ $BUILD_DIR
cd $BUILD_DIR
else
cd $BUILD_DIR
standout "Pulling updates"; hg pull
standout "Applying updates"; hg update -C
fi
 
if [ $RECONFIG -eq true ]; then
standout "Rebuilding ./configure script"
make -C src autoconf
fi
 
standout "Building binaries"
make
 
standout "Installing files"
sudo make install
 
# vim: ts=2 sw=2 et

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.