File: Vagrantfile

package info (click to toggle)
ruby-gnome2 3.1.0-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,072 kB
  • ctags: 17,433
  • sloc: ansic: 93,621; ruby: 62,273; xml: 335; sh: 246; makefile: 25
file content (39 lines) | stat: -rw-r--r-- 1,149 bytes parent folder | download
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
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  targets = [
    "win32",
    "win64",
  ]

  targets.each do |target|
    config.vm.define(target) do |node|
      node.vm.box = "bento/ubuntu-16.04"

      node.vm.synced_folder("../", "/ruby-gnome2")
      node.vm.synced_folder("../../pkg-config", "/pkg-config")
      node.vm.synced_folder("../../rcairo", "/rcairo")

      node.vm.provision(:shell,
                        :privileged => false,
                        :path => "build-#{target}.sh")
      config.vm.provider("virtualbox") do |virtual_box|
        system_n_cpus = 1
        if File.exist?("/proc/cpuinfo")
          system_n_cpus = File.readlines("/proc/cpuinfo").grep(/^processor/).size
        end
        if system_n_cpus > 1
          vm_n_cpus = system_n_cpus / 2
        else
          vm_n_cpus = 1
        end
        virtual_box.cpus = (ENV["N_CPUS"] || vm_n_cpus).to_i
        virtual_box.memory = (ENV["VM_MEMORY"] || 1024).to_i
      end
    end
  end
end