Skip to content

Instantly share code, notes, and snippets.

@jonschoning
Last active October 3, 2017 16:00
Show Gist options
  • Save jonschoning/6202771 to your computer and use it in GitHub Desktop.
Save jonschoning/6202771 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "[ build and install vim from source ]"
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
# cd ~/fs/dev
# sudo apt-get build-dep vim
# sudo apt-get install mercurial checkinstall
# hg clone https://vim.googlecode.com/hg/ vim
echo "changing to src dir..."
cd ~/fs/dev/vim
if [ $? -ne 0 ]; then echo "cd to src dir failed"; exit 0; fi
echo "running configure..."
./configure \
--enable-perlinterp=dynamic \
--enable-pythoninterp \
--enable-rubyinterp \
--enable-luainterp=dynamic \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--enable-multibyte \
--enable-fontset \
--with-features=huge \
--with-x \
--with-ruby-command=/usr/bin/ruby \
--with-compiledby="Jon Schoning <[email protected]>" \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
# --with-python3-config-dir=/usr/lib/python3.3/config-3.3m-x86_64-linux-gnu
if [ $? -ne 0 ]; then echo "configure failed"; exit 0; fi
echo "running make"
make -j 9
if [ $? -ne 0 ]; then echo "make failed"; exit 0; fi
echo "removing installdir..."
rm -Rf /tmp/installdir
if [ $? -ne 0 ]; then echo "remove temp dir failed"; exit 0; fi
echo "installing to installdir..."
make install DESTDIR=/tmp/installdir
if [ $? -ne 0 ]; then echo "make install to temp dir failed"; exit 0; fi
echo "changing to installdir..."
cd /tmp/installdir
if [ $? -ne 0 ]; then echo "cd to temp dir failed"; exit 0; fi
echo "building deb package with FPM..."
fpm -s dir -t deb -n vim74 -v 7.4 .
if [ $? -ne 0 ]; then echo "make deb package with fpm failed"; exit 0; fi
echo "installing package..."
sudo dpkg --force-overwrite -i vim74_7.4_amd64.deb
if [ $? -ne 0 ]; then echo "dpkg install failed"; exit 0; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment