Vagrantfile 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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/trusty64"
  11. config.vm.provider "lxc" do |lxc, override|
  12. override.vm.box = "fgrehm/trusty64-lxc"
  13. end
  14. #
  15. # mass-define "generic" Ubuntu boxes
  16. #
  17. %w{5.1 5.2 5.4 5.7 5.8 5.9}.each { |version|
  18. config.vm.define "v8-#{version}" do |i|
  19. i.vm.synced_folder ".", "/data/v8js"
  20. i.vm.provision "shell", inline: <<-SHELL
  21. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  22. gpg --armor --export 7F438280EF8D349F | apt-key add -
  23. apt-get update
  24. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
  25. add-apt-repository ppa:ondrej/php
  26. add-apt-repository ppa:pinepain/libv8-#{version}
  27. apt-get update
  28. apt-get install -y php7.1-dev libv8-#{version}-dbg libv8-#{version}-dev
  29. SHELL
  30. end
  31. }
  32. %w{5.9.35}.each { |version|
  33. config.vm.define "v8-#{version}" do |i|
  34. i.vm.synced_folder ".", "/data/v8js"
  35. i.vm.provision "shell", inline: <<-SHELL
  36. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  37. gpg --armor --export 7F438280EF8D349F | apt-key add -
  38. apt-get update
  39. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov build-essential python libglib2.0-dev
  40. add-apt-repository ppa:ondrej/php
  41. apt-get update
  42. apt-get install -y php7.1-dev
  43. mkdir -p /data
  44. cd /data
  45. # Install depot_tools first (needed for source checkout)
  46. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  47. export PATH=`pwd`/depot_tools:"$PATH"
  48. # Download v8
  49. fetch v8
  50. cd v8
  51. # checkout version
  52. git checkout #{version}
  53. gclient sync
  54. # Setup GN
  55. tools/dev/v8gen.py -vv x64.release -- is_component_build=true
  56. # Build
  57. ninja -C out.gn/x64.release/
  58. # Install to /opt/libv8-#{version}/
  59. sudo mkdir -p /opt/libv8-#{version}/{lib,include}
  60. sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin /opt/libv8-#{version}/lib/
  61. sudo cp -R include/* /opt/libv8-#{version}/include/
  62. SHELL
  63. end
  64. }
  65. #
  66. # Fedora-based box with GCC7, V8 5.2 + PHP 7.1 installed
  67. # (primarily to reproduce #294)
  68. #
  69. config.vm.define "fedora-26-gcc7" do |i|
  70. i.vm.box = "vbenes/fedora-rawhide-server"
  71. i.ssh.insert_key = false
  72. # unfortunately vboxsf isn't currently available (due to an issue with the base image)
  73. # therefore fall back to nfs
  74. i.vm.synced_folder ".", "/data/v8js", type: "nfs"
  75. i.vm.network "private_network", ip: "192.168.50.2"
  76. i.vm.provision "shell", inline: <<-SHELL
  77. dnf -y update
  78. dnf -y install gcc-c++ gdb tmux git tig curl vim
  79. dnf -y install v8-devel php-devel
  80. SHELL
  81. end
  82. #
  83. # FreeBSD 11.0 box
  84. # (compiles V8 5.1.281.47 with Gyp; using port from https://raw.githubusercontent.com/Kronuz/Xapiand/master/contrib/freebsd/v8.shar)
  85. #
  86. config.vm.define "freebsd-11" do |i|
  87. i.vm.box = "freebsd/FreeBSD-11.0-RELEASE-p1"
  88. i.ssh.shell = "/bin/sh"
  89. # vboxsf doesn't work on FreeBSD (yet), use nfs
  90. i.vm.synced_folder ".", "/data/v8js", type: "nfs"
  91. i.vm.network "private_network", type: "dhcp"
  92. i.vm.provision "shell", inline: <<-SHELL
  93. pkg install -y git python bash gmake icu gdb tmux git tig curl vim autoconf php70
  94. portsnap auto --interactive
  95. mkdir -p /data && cd /data
  96. [ -x v8 ] || curl https://raw.githubusercontent.com/Kronuz/Xapiand/master/contrib/freebsd/v8.shar | sh
  97. cd /data/v8
  98. make install
  99. SHELL
  100. end
  101. #
  102. # Fedora 25 box with 32-bit
  103. #
  104. config.vm.define "fedora25-32" do |i|
  105. i.vm.box = "wholebits/fedora25-32"
  106. i.vm.synced_folder ".", "/data/v8js"
  107. i.vm.provision "shell", inline: <<-SHELL
  108. dnf -y update
  109. dnf -y install gcc-c++ gdb tmux git tig curl vim
  110. dnf -y install v8-devel php-devel
  111. SHELL
  112. end
  113. #
  114. # ubuntu xenial(16.04) box with PHP 7.1.3, V8 5.2
  115. # (to reproduce issue #304)
  116. #
  117. config.vm.define "xenial-v8-5.2" do |i|
  118. i.vm.box = "ubuntu/xenial64"
  119. i.vm.synced_folder ".", "/data/v8js"
  120. i.vm.provision "shell", inline: <<-SHELL
  121. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  122. gpg --armor --export 7F438280EF8D349F | apt-key add -
  123. apt-get update
  124. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
  125. add-apt-repository ppa:ondrej/php
  126. add-apt-repository ppa:pinepain/libv8-5.2
  127. apt-get update
  128. apt-get install -y php7.1-dev libv8-5.2-dbg libv8-5.2-dev
  129. SHELL
  130. end
  131. config.vm.provision "shell", privileged: false, inline: <<-SHELL
  132. sudo mkdir -p /data/build && sudo chown $USER:$USER /data/build
  133. SHELL
  134. end