Vagrantfile 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby ts=2 sts=2 sw=2 et :
  3. # All Vagrant configuration is done below. The "2" in Vagrant.configure
  4. # configures the configuration version (we support older styles for
  5. # backwards compatibility). Please don't change it unless you know what
  6. # you're doing.
  7. Vagrant.configure("2") do |config|
  8. # Every Vagrant development environment requires a box. You can search for
  9. # boxes at https://atlas.hashicorp.com/search.
  10. config.vm.box = "ubuntu/xenial64"
  11. config.vm.provider "lxc" do |lxc, override|
  12. lxc.backingstore = "none"
  13. override.vm.box = "zaikin/xenial64-lxc"
  14. end
  15. #
  16. # mass-define "generic" Ubuntu boxes
  17. #
  18. %w{6.3 6.4 6.5}.each { |version|
  19. config.vm.define "v8-#{version}" do |i|
  20. i.vm.synced_folder ".", "/data/v8js"
  21. i.vm.provision "shell", inline: <<-SHELL
  22. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  23. gpg --armor --export 7F438280EF8D349F | apt-key add -
  24. apt-get update
  25. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
  26. add-apt-repository ppa:ondrej/php
  27. add-apt-repository ppa:pinepain/libv8-#{version}
  28. apt-get update
  29. apt-get install -y php7.1-dev libv8-#{version}-dbg libv8-#{version}-dev
  30. SHELL
  31. end
  32. }
  33. %w{}.each { |version|
  34. config.vm.define "v8-#{version}" do |i|
  35. i.vm.synced_folder ".", "/data/v8js"
  36. i.vm.provision "shell", inline: <<-SHELL
  37. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  38. gpg --armor --export 7F438280EF8D349F | apt-key add -
  39. apt-get update
  40. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov build-essential python libglib2.0-dev
  41. add-apt-repository ppa:ondrej/php
  42. apt-get update
  43. apt-get install -y php7.1-dev
  44. mkdir -p /data
  45. cd /data
  46. # Install depot_tools first (needed for source checkout)
  47. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  48. export PATH=`pwd`/depot_tools:"$PATH"
  49. # Download v8
  50. fetch v8
  51. cd v8
  52. # checkout version
  53. git checkout #{version}
  54. gclient sync
  55. # Setup GN
  56. tools/dev/v8gen.py -vv x64.release -- is_component_build=true
  57. # Build
  58. ninja -C out.gn/x64.release/
  59. # Install to /opt/libv8-#{version}/
  60. sudo mkdir -p /opt/libv8-#{version}/{lib,include}
  61. sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin out.gn/x64.release/icudtl.dat /opt/libv8-#{version}/lib/
  62. sudo cp -R include/* /opt/libv8-#{version}/include/
  63. SHELL
  64. end
  65. }
  66. #
  67. # Fedora-based box with GCC7, V8 5.2 + PHP 7.1 installed
  68. # (primarily to reproduce #294)
  69. #
  70. config.vm.define "fedora-26-gcc7" do |i|
  71. i.vm.box = "vbenes/fedora-rawhide-server"
  72. i.ssh.insert_key = false
  73. # unfortunately vboxsf isn't currently available (due to an issue with the base image)
  74. # therefore fall back to nfs
  75. i.vm.synced_folder ".", "/data/v8js", type: "nfs"
  76. i.vm.network "private_network", ip: "192.168.50.2"
  77. i.vm.provision "shell", inline: <<-SHELL
  78. dnf -y update
  79. dnf -y install gcc-c++ gdb tmux git tig curl vim
  80. dnf -y install v8-devel php-devel
  81. SHELL
  82. end
  83. #
  84. # FreeBSD 11.0 box
  85. # (compiles V8 5.1.281.47 with Gyp; using port from https://raw.githubusercontent.com/Kronuz/Xapiand/master/contrib/freebsd/v8.shar)
  86. #
  87. config.vm.define "freebsd-11" do |i|
  88. i.vm.box = "freebsd/FreeBSD-11.0-RELEASE-p1"
  89. i.ssh.shell = "/bin/sh"
  90. # vboxsf doesn't work on FreeBSD (yet), use nfs
  91. i.vm.synced_folder ".", "/data/v8js", type: "nfs"
  92. i.vm.network "private_network", type: "dhcp"
  93. i.vm.provision "shell", inline: <<-SHELL
  94. pkg install -y git python bash gmake icu gdb tmux git tig curl vim autoconf php70
  95. portsnap auto --interactive
  96. mkdir -p /data && cd /data
  97. [ -x v8 ] || curl https://raw.githubusercontent.com/Kronuz/Xapiand/master/contrib/freebsd/v8.shar | sh
  98. cd /data/v8
  99. make install
  100. SHELL
  101. end
  102. #
  103. # Fedora 25 box with 32-bit
  104. #
  105. config.vm.define "fedora25-32" do |i|
  106. i.vm.box = "wholebits/fedora25-32"
  107. i.vm.synced_folder ".", "/data/v8js"
  108. i.vm.provision "shell", inline: <<-SHELL
  109. dnf -y update
  110. dnf -y install gcc-c++ gdb tmux git tig curl vim
  111. dnf -y install v8-devel php-devel
  112. SHELL
  113. end
  114. config.vm.define "macos-sierra" do |i|
  115. i.vm.box = "gobadiah/macos-sierra"
  116. i.vm.synced_folder ".", "/data/v8js", type: "nfs", mount_options:["resvport"]
  117. i.vm.network "private_network", ip: "192.168.50.3"
  118. i.vm.provider "virtualbox" do |vb|
  119. vb.memory = "3000"
  120. vb.customize ["modifyvm", :id, "--cpuidset", "1","000106e5","00100800","0098e3fd","bfebfbff"]
  121. vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct", "iMac11,3"]
  122. vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion", "1.0"]
  123. vb.customize ["setextradata", :id, "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct", "Iloveapple"]
  124. vb.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/DeviceKey", "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"]
  125. vb.customize ["setextradata", :id, "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC", 1]
  126. end
  127. i.vm.provision "shell", privileged: false, inline: <<-SHELL
  128. # install homebrew
  129. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  130. brew install autoconf
  131. brew install homebrew/php/php71
  132. brew install v8
  133. SHELL
  134. end
  135. config.vm.provision "shell", privileged: false, inline: <<-SHELL
  136. sudo mkdir -p /data/build && sudo chown $USER:$USER /data/build
  137. SHELL
  138. end