shoestrap/recipes/default/build-vim

40 lines
907 B
Plaintext
Raw Permalink Normal View History

2013-08-08 03:23:13 +00:00
#!/bin/bash
vim_dir="$WORKSPACE/vim"
2013-08-08 03:23:13 +00:00
# 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
2019-11-02 00:42:14 +00:00
log "Cloning vim"
git clone https://github.com/vim/vim.git "$vim_dir"
2019-11-02 00:42:14 +00:00
else
(cd "$vim_dir" && git fetch)
2013-08-08 03:23:13 +00:00
fi
2019-11-02 00:42:14 +00:00
function conf_build_and_install() {
# Get latest tagged source code
latest_tag=$(git describe --tags)
git checkout "$latest_tag"
2019-11-02 00:42:14 +00:00
# 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=$(command -v vim)
sudo ln -s "$vim_path" "${vim_path:0:(-1)}"
2019-11-02 00:42:14 +00:00
}
(cd "$vim_dir" && conf_build_and_install)