Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed to the Apache Software Foundation (ASF) under one |
| 6 | # or more contributor license agreements. See the NOTICE file |
| 7 | # distributed with this work for additional information |
| 8 | # regarding copyright ownership. The ASF licenses this file |
| 9 | # to you under the Apache License, Version 2.0 (the |
| 10 | # "License"); you may not use this file except in compliance |
| 11 | # with the License. You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, |
| 16 | # software distributed under the License is distributed on an |
| 17 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 18 | # KIND, either express or implied. See the License for the |
| 19 | # specific language governing permissions and limitations |
| 20 | # under the License. |
| 21 | # |
| 22 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 23 | $build_and_test = <<SCRIPT |
| 24 | echo "Provisioning system to compile and test Apache Thrift." |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 25 | |
| 26 | # Create swap space |
| 27 | sudo fallocate -l 2G /swapfile |
| 28 | sudo chmod 600 /swapfile |
| 29 | sudo mkswap /swapfile |
| 30 | sudo swapon /swapfile |
| 31 | sudo swapon -s |
| 32 | |
| 33 | # Update the system |
| 34 | sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq -y |
| 35 | sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -qq -y |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 36 | |
| 37 | # Install Dependencies |
| 38 | # --- |
| 39 | # General dependencies |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 40 | sudo apt-get install -qq automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git debhelper |
| 41 | |
| 42 | # C++ dependencies |
| 43 | sudo apt-get install -qq libboost-dev libboost-test-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev libevent-dev |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 44 | |
| 45 | # Java dependencies |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 46 | sudo apt-get install -qq ant openjdk-7-jdk maven |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 47 | |
| 48 | # Python dependencies |
Nobuaki Sukegawa | a185d7e | 2015-11-06 21:24:24 +0900 | [diff] [blame] | 49 | sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools python-support python-six python3-six |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 50 | |
| 51 | # Ruby dependencies |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 52 | sudo apt-get install -qq ruby ruby-dev |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 53 | sudo gem install bundler rake |
| 54 | |
| 55 | # Perl dependencies |
Roger Meier | aae8acb | 2014-01-15 13:55:09 +0100 | [diff] [blame] | 56 | sudo apt-get install -qq libbit-vector-perl libclass-accessor-class-perl |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 57 | |
| 58 | # Php dependencies |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 59 | sudo apt-get install -qq php5 php5-dev php5-cli php-pear re2c |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 60 | |
| 61 | # GlibC dependencies |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 62 | sudo apt-get install -qq libglib2.0-dev |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 63 | |
| 64 | # Erlang dependencies |
alisdair sullivan | a559f8d | 2014-11-17 20:28:35 -0800 | [diff] [blame] | 65 | sudo apt-get install -qq erlang-base erlang-eunit erlang-dev erlang-tools |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 66 | |
| 67 | # GO dependencies |
| 68 | echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections |
| 69 | sudo apt-get -y install -qq golang golang-go |
| 70 | |
| 71 | # Haskell dependencies |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 72 | sudo apt-get install -qq ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev |
jfarrell | 30a472e | 2014-07-10 18:42:30 -0400 | [diff] [blame] | 73 | sudo cabal update |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 74 | |
| 75 | # Lua dependencies |
| 76 | sudo apt-get install -qq lua5.2 lua5.2-dev |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 77 | |
| 78 | # Node.js dependencies |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 79 | sudo apt-get install -qq nodejs nodejs-dev nodejs-legacy npm |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 80 | |
| 81 | # CSharp |
jfarrell | b5fd816 | 2014-10-29 23:19:23 -0400 | [diff] [blame] | 82 | sudo apt-get install -qq mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil |
Roger Meier | 8720260 | 2014-08-15 22:16:02 +0200 | [diff] [blame] | 83 | sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime nsis |
jfarrell | 9753cde | 2013-06-21 14:53:39 -0500 | [diff] [blame] | 84 | |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 85 | # D dependencies |
| 86 | sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list |
| 87 | sudo apt-get update && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && sudo apt-get update |
| 88 | sudo apt-get install -qq xdg-utils dmd-bin |
| 89 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 90 | # Customize the system |
| 91 | # --- |
| 92 | # Default java to latest 1.7 version |
| 93 | update-java-alternatives -s java-1.7.0-openjdk-amd64 |
| 94 | |
jfarrell | 9753cde | 2013-06-21 14:53:39 -0500 | [diff] [blame] | 95 | # PHPUnit package broken in ubuntu. see https://bugs.launchpad.net/ubuntu/+source/phpunit/+bug/701544 |
| 96 | sudo apt-get upgrade pear |
| 97 | sudo pear channel-discover pear.phpunit.de |
| 98 | sudo pear channel-discover pear.symfony.com |
| 99 | sudo pear channel-discover components.ez.no |
| 100 | sudo pear update-channels |
| 101 | sudo pear upgrade-all |
| 102 | sudo pear install --alldeps phpunit/PHPUnit |
| 103 | |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 104 | date > /etc/vagrant.provisioned |
| 105 | |
| 106 | # Start the source build |
| 107 | # --- |
| 108 | echo "Starting Apache Thrift build..." |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 109 | cd /thrift |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 110 | sh bootstrap.sh |
Jens Geyer | 6d15c30 | 2014-10-02 10:03:09 +0200 | [diff] [blame] | 111 | sh configure |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 112 | make |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 113 | make check |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 114 | echo "Finished building Apache Thrift." |
| 115 | |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 116 | SCRIPT |
| 117 | |
| 118 | Vagrant.configure("2") do |config| |
jfarrell | 3e41ece | 2014-07-09 23:35:54 -0400 | [diff] [blame] | 119 | # Ubuntu 14.04 LTS (Trusty Tahr) |
| 120 | config.vm.box = "trusty64" |
| 121 | config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 122 | |
Carl Yeksigian | 1ed7991 | 2013-06-03 18:29:31 -0400 | [diff] [blame] | 123 | config.vm.synced_folder "../", "/thrift" |
| 124 | |
jfarrell | b6f23e8 | 2013-06-21 13:36:18 -0500 | [diff] [blame] | 125 | config.vm.provider :virtualbox do |vbox| |
| 126 | vbox.customize ["modifyvm", :id, "--memory", "1024"] |
| 127 | vbox.customize ["modifyvm", :id, "--cpus", "2"] |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 128 | vbox.customize ["modifyvm", :id, "--rtcuseutc", "on"] |
jfarrell | b6f23e8 | 2013-06-21 13:36:18 -0500 | [diff] [blame] | 129 | end |
| 130 | |
jfarrell | 2c7eb9e | 2014-10-08 23:15:20 -0400 | [diff] [blame] | 131 | # Run the build script to configure the system |
jfarrell | 9dbea36 | 2013-08-17 18:35:13 -0400 | [diff] [blame] | 132 | config.vm.provision :shell, :inline => $build_and_test |
Roger Meier | 14ff9c8 | 2013-05-30 14:11:45 +0200 | [diff] [blame] | 133 | end |