Skip to content

Instantly share code, notes, and snippets.

@twolfson
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/8728105 to your computer and use it in GitHub Desktop.
Save twolfson/8728105 to your computer and use it in GitHub Desktop.
Attempt at Vagrantfile for limetext
.vagrant/
code
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Update apt-get once
$update_apt_get = <<SCRIPT
if ! test -f .updated_apt_get; then
sudo apt-get update
touch .updated_apt_get
fi
SCRIPT
config.vm.provision "shell", inline: $update_apt_get
# Install dependencies
$install_git = <<SCRIPT
if ! which git &> /dev/null; then
# mercurial is for one of the dependencies inside of make
# build-essential contains `g++` which is for `cmake`
sudo apt-get install cmake make mercurial git build-essential -y
fi
SCRIPT
config.vm.provision "shell", inline: $install_git
# Download go
$download_go = <<SCRIPT
if ! test -d /vagrant/code/go &> /dev/null; then
cd /tmp
wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
tar xvf go1.1.2.linux-amd64.tar.gz
mkdir /vagrant/code
mv go /vagrant/code/go
chown -R vagrant:vagrant /vagrant/code
fi
SCRIPT
config.vm.provision "shell", inline: $download_go
# Clone and make the repo
$build_lime = <<SCRIPT
if ! test -d /vagrant/code/go/src/lime/build; then
export GOPATH=/vagrant/code/go
mkdir -p $GOPATH/src
cd $GOPATH/src
git clone --recursive https://github.com/limetext/lime.git lime
cd $GOPATH/src/lime/build
cmake ..
make
make termbox
chown -R vagrant:vagrant /vagrant/code
fi
SCRIPT
config.vm.provision "shell", inline: $build_lime
# Notify the user how to run `lime`
$notify_user = <<SCRIPT
echo "\\`lime\\` successfully constructed!"
echo "To run \\`lime\\`, run the following:"
echo "vagrant ssh"
echo "cd /vagrant/code/go/src/lime/frontend/termbox"
echo "./termbox"
SCRIPT
config.vm.provision "shell", inline: $notify_user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment