Vagrantfile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/bionic64"
  11. #
  12. # mass-define "generic" Ubuntu boxes
  13. #
  14. %w{7.5}.each { |version|
  15. config.vm.define "v8-#{version}" do |i|
  16. i.vm.synced_folder ".", "/data/v8js"
  17. i.vm.provision "shell", inline: <<-SHELL
  18. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  19. gpg --armor --export 7F438280EF8D349F | apt-key add -
  20. apt-get update
  21. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
  22. add-apt-repository ppa:ondrej/php
  23. add-apt-repository ppa:stesie/libv8
  24. apt-get update
  25. apt-get install -y php7.1-dev libv8-#{version}-dbg libv8-#{version}-dev
  26. SHELL
  27. end
  28. }
  29. %w{}.each { |version|
  30. config.vm.define "v8-#{version}" do |i|
  31. i.vm.synced_folder ".", "/data/v8js"
  32. i.vm.provision "shell", inline: <<-SHELL
  33. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  34. gpg --armor --export 7F438280EF8D349F | apt-key add -
  35. apt-get update
  36. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov build-essential python libglib2.0-dev
  37. add-apt-repository ppa:ondrej/php
  38. apt-get update
  39. apt-get install -y php7.1-dev
  40. mkdir -p /data
  41. cd /data
  42. # Install depot_tools first (needed for source checkout)
  43. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  44. export PATH=`pwd`/depot_tools:"$PATH"
  45. # Download v8
  46. fetch v8
  47. cd v8
  48. # checkout version
  49. git checkout #{version}
  50. gclient sync
  51. # Setup GN
  52. tools/dev/v8gen.py -vv x64.release -- is_component_build=true
  53. # Build
  54. ninja -C out.gn/x64.release/
  55. # Install to /opt/libv8-#{version}/
  56. sudo mkdir -p /opt/libv8-#{version}/{lib,include}
  57. sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin out.gn/x64.release/icudtl.dat /opt/libv8-#{version}/lib/
  58. sudo cp -R include/* /opt/libv8-#{version}/include/
  59. SHELL
  60. end
  61. }
  62. config.vm.define "php-7.4" do |i|
  63. i.vm.synced_folder ".", "/data/v8js"
  64. i.vm.provision "shell", inline: <<-SHELL
  65. gpg --keyserver keys.gnupg.net --recv 7F438280EF8D349F
  66. gpg --armor --export 7F438280EF8D349F | apt-key add -
  67. apt-get update
  68. apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
  69. add-apt-repository ppa:stesie/libv8
  70. apt-get update
  71. apt-get install -y libv8-7.5-dbg libv8-7.5-dev
  72. test -x /tmp/php-src || git clone https://github.com/php/php-src.git /tmp/php-src -b PHP-7.4 --depth 1
  73. cd /tmp/php-src
  74. apt-get install -y build-essential bison re2c libreadline-dev
  75. ./buildconf
  76. ./configure --disable-all --with-readline
  77. make -j4
  78. make install
  79. SHELL
  80. end
  81. config.vm.provision "shell", privileged: false, inline: <<-SHELL
  82. sudo mkdir -p /data/build && sudo chown $USER:$USER /data/build
  83. SHELL
  84. end