# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant configuration that creates Travis-CI compatible build environment
# for rsocket.

# Get the APT dependencies from the Travis config.
require 'yaml'
yml = YAML.load_file(File.dirname(__dir__) + '/.travis.yml')
apt = yml['addons']['apt']
packages = apt['packages'] + ['git', 'cmake3']

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"

  config.vm.provider "virtualbox" do |vb|
    # Need more than 2048 MiB to compile folly.
    vb.memory = "4096"
  end

  config.vm.provision "shell", inline: <<-SHELL
    apt-add-repository -y "apt['sources'].join(' ')"
    apt-get update
    apt-get -y install #{packages.join(' ')}
  SHELL
end
