From d7c27bbcf14255c634ff66eda74e75e14ecae567 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Sun, 11 Oct 2015 09:55:14 -0700 Subject: [PATCH 1/5] Refactor / idempotent-fy vagrant.sh Big changes: 1) Update packages! 2) Remove uncessary X11 packages (wisely, before updating all the packages) 3) Install all packages at once 4) Leave package addition in same order, because, it looked interesting? 5) Look for symlink before making it (Vagrant errors out on second provision otherwise) 6) Build demboyz --- vagrant.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/vagrant.sh b/vagrant.sh index 3b2eef5..388ea2f 100755 --- a/vagrant.sh +++ b/vagrant.sh @@ -4,10 +4,24 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt-get update -sudo apt-get install build-essential -y +# Remove X11 cruft +sudo apt-get autoremove -y -sudo apt-get install gcc-4.9 g++-4.9 -y -sudo apt-get install gcc-4.9-multilib g++-4.9-multilib -y +# Keep things up to date +sudo apt-get upgrade -y -sudo apt-get install clang-3.6++ -y -sudo ln -s /usr/bin/clang++-3.6 /usr/bin/clang++ +packages=""; # Start with nothing; can re-order rest to heart's content + +packages="$packages build-essential" +packages="$packages gcc-4.9 g++-4.9" +packages="$packages gcc-4.9-multilib g++-4.9-multilib" +packages="$packages clang-3.6++" + +sudo apt-get install -y $packages + +# Why doesn't clang do this for us? +[ ! -e /usr/bin/clang++ ] && sudo ln -s /usr/bin/clang++-3.6 /usr/bin/clang++ + +# Build it! +cd /vagrant/premake +/bin/bash gmake.sh && { cd gmake; make; } From d2e8a8de902cc50f26c6564b345abedfdece8024 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Sun, 11 Oct 2015 09:55:36 -0700 Subject: [PATCH 2/5] Use shell provisioner --- Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 7e8de7d..67ff6ec 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -119,4 +119,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # chef-validator, unless you changed the configuration. # # chef.validation_client_name = "ORGNAME-validator" + + # Shell provisioner + config.vm.provision "shell", path: "vagrant.sh" end From cfb3de06283407295c5e1d7b14cde731c90a9e89 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Sun, 11 Oct 2015 09:55:52 -0700 Subject: [PATCH 3/5] Ignore bin output files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 660478a..59df4d4 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ Desktop.ini # Generated Project Files premake/*/ +bin/* # Vagrant .vagrant/ From f6f37692f0f6f5ac758ff5cb0849d687c41c7f38 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Mon, 12 Oct 2015 16:54:59 -0700 Subject: [PATCH 4/5] Use update-alternatives for clang++ --- vagrant.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vagrant.sh b/vagrant.sh index 388ea2f..6793084 100755 --- a/vagrant.sh +++ b/vagrant.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # http://askubuntu.com/a/497033 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y @@ -20,8 +20,9 @@ packages="$packages clang-3.6++" sudo apt-get install -y $packages # Why doesn't clang do this for us? -[ ! -e /usr/bin/clang++ ] && sudo ln -s /usr/bin/clang++-3.6 /usr/bin/clang++ +sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.6 10 +sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 10 # Build it! cd /vagrant/premake -/bin/bash gmake.sh && { cd gmake; make; } +./gmake.sh && { cd gmake; make; } From 63785fea420a34155a9d76e78163194f6aea24d6 Mon Sep 17 00:00:00 2001 From: "John H. Robinson, IV" Date: Mon, 12 Oct 2015 16:55:23 -0700 Subject: [PATCH 5/5] Updated README for Vagrant builds --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1f0af83..0614851 100644 --- a/README.md +++ b/README.md @@ -40,16 +40,15 @@ When following instructions below, the compiled binary will be output in the bin ### Using Vagrant - # Launch VM + # Launch VM and build vagrant up + + # Patch VM and re-build + vagrant provision + + # Manual build vagrant ssh - cd /vagrant - - # Install Linux dependencies (first time setup) - ./vagrant.sh - - # Build demboyz - cd premake + cd /vagrant/premake ./gmake.sh && cd gmake make