shoestrap/recipes/default/build-vim
2019-11-01 17:42:14 -07:00

40 lines
893 B
Bash

#!/bin/bash
local vim_dir="$WORKSPACE/vim"
# Get the build dependencies
if [ "$PACKAGE_MANAGER" == 'apt-get' ]; then
sudo apt-get build-dep vim vim-gtk
fi
# TODO: Add pacman support
# Build latest vim
if [ ! -d $vim_dir ]; then
log "Cloning vim"
git clone https://github.com/vim/vim.git $vim_dir
else
(cd $vim_dir && git fetch)
fi
function conf_build_and_install() {
# Get latest tagged source code
latest_tag=`git describe --tags`
git checkout $latest_tag
# Configure vim with ruby, python and GTK
./configure --with-features=huge \
--enable-pythoninterp \
--enable-rubyinterp \
--enable-gui=gtk2
# Compile
make
# Install newly compiled vim
sudo make install
# Link vi to vim out of convenience
vim_path=$(which vim)
sudo ln -s $vim_path ${vim_path:0:(-1)}
}
(cd $vim_dir && conf_build_and_install)