Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | VAGRANTFILE_API_VERSION = "2" |
| 5 | |
| 6 | $script = <<SCRIPT |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 7 | export DEBIAN_FRONTEND=noninteractive |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 8 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 9 | sudo apt-mark hold grub-pc |
| 10 | sudo apt -q -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update |
| 11 | sudo apt -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade |
| 12 | sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" build-essential git openjdk-8-jdk unzip ruby ruby-rugged |
| 13 | sudo apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" lib32stdc++6 lib32z1 lib32z1-dev |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 14 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 15 | mkdir android-sdk-linux |
| 16 | cd android-sdk-linux |
| 17 | wget -q https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip |
| 18 | unzip sdk-tools-linux-3859397.zip |
| 19 | rm sdk-tools-linux-3859397.zip |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 20 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 21 | export ANDROID_HOME=`pwd` |
| 22 | export PATH=${PATH}:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 23 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 24 | echo "y" | sdkmanager "platform-tools" |
Alexander Afanasyev | 14fd3e2 | 2018-07-04 14:20:53 -0400 | [diff] [blame] | 25 | sdkmanager "platforms;android-28" "ndk-bundle" |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 26 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 27 | cd ndk-bundle |
Alexander Afanasyev | 14fd3e2 | 2018-07-04 14:20:53 -0400 | [diff] [blame] | 28 | git clone https://github.com/named-data-mobile/android-crew-staging.git crew.dir |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 29 | |
Alexander Afanasyev | 14fd3e2 | 2018-07-04 14:20:53 -0400 | [diff] [blame] | 30 | CREW_OWNER=named-data-mobile crew.dir/crew install target/sqlite target/openssl target/boost |
| 31 | CREW_OWNER=named-data-mobile crew.dir/crew install target/ndn_cxx target/nfd |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 32 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 33 | cd ../.. |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 34 | |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 35 | echo sdk.dir=`pwd`/android-sdk-linux > local.properties |
| 36 | echo ndk.dir=`pwd`/android-sdk-linux/ndk-bundle >> local.properties |
Alexander Afanasyev | e152d99 | 2016-11-08 15:20:13 -0800 | [diff] [blame] | 37 | |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 38 | SCRIPT |
| 39 | |
| 40 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
Alexander Afanasyev | da06629 | 2017-11-12 23:02:31 -0500 | [diff] [blame] | 41 | config.vm.box = "puphpet/ubuntu1604-x64" |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 42 | |
| 43 | config.vm.provision "shell", privileged: false, inline: $script |
| 44 | |
| 45 | config.vm.provider "virtualbox" do |vb| |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 46 | vb.memory = 4048 |
| 47 | vb.cpus = 4 |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 48 | end |
| 49 | end |