File: Vagrantfile

package info (click to toggle)
spring 106.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 55,260 kB
  • sloc: cpp: 543,946; ansic: 44,800; python: 12,575; java: 12,201; awk: 5,889; sh: 1,796; asm: 1,546; xml: 655; perl: 405; php: 211; objc: 194; makefile: 76; sed: 2
file content (46 lines) | stat: -rw-r--r-- 1,562 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  config.vm.box = "ubuntu/xenial64"
  config.vm.network "public_network"
  config.vm.synced_folder ".", "/vagrant"

  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
    v.cpus = 2
#    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
  end

  config.vm.provision "shell", name: "install", inline: <<-SHELL
    apt-get update

    apt-get install -y build-essential cmake git gcc-5 g++-5
    apt-get install -y libglew-dev libsdl2-dev libdevil-dev libopenal-dev \
      libogg-dev libvorbis-dev libfreetype6-dev p7zip-full libboost-dev \
      libunwind8-dev libcurl4-openssl-dev
  SHELL

  $script = <<-SCRIPT
    if [ ! -d ~/spring ]; then
      cd ~ && git clone https://github.com/spring/spring.git spring

      mkdir spring/AI/Skirmish/CircuitAI
      cp -r /vagrant/src spring/AI/Skirmish/CircuitAI/src
      cp /vagrant/CMakeLists.txt spring/AI/Skirmish/CircuitAI/
      cp /vagrant/VERSION spring/AI/Skirmish/CircuitAI/

      cd spring && git checkout maintenance
      git submodule init && git submodule update
      cmake -DAI_TYPES=NATIVE .
      make CircuitAI -j2 > ~/CircuitAI.log 2>&1
      strip AI/Skirmish/CircuitAI/data/libSkirmishAI.so
      cp AI/Skirmish/CircuitAI/data/libSkirmishAI.so /vagrant/
    fi
  SCRIPT
  config.vm.provision "shell", name: "startup", inline: $script, privileged: false

end