Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
# ...
# This mess of B.S., constructed mostly from <http://apt.llvm.org>, is, as far as I can tell, The
# Right Way to get non-ancient clang installed on Precise. (Why am I using Precise again? 'cuz
# Vagrant says so? ಠ_ಠ)
#
# Yes, non-ancient clang requires slightly-less-ancient gcc to build ... which isn't available on
# Precise ... so *that* has to be installed manually, *too*. -_-
config.vm.provision "shell", privileged: true, inline: <<-SHELL
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y update
apt-get -q -y install python-software-properties 2>&1
add-apt-repository -y ppa:ubuntu-toolchain-r/test
add-apt-repository -y 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main'
apt-get -q -y update
#update-alternatives --remove-all gcc
apt-get -q -y install gcc-4.9
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 2>&1
update-alternatives --set cc /usr/bin/gcc
update-alternatives --config gcc
gpg --keyserver http://apt.llvm.org/llvm-snapshot.gpg.key --recv-keys 15CF4D18AF4F7421 2>&1
#update-alternatives --remove-all clang
apt-get -q -y --force-yes install clang-3.8 lldb-3.8
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 10
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 40
update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-3.8 10
update-alternatives --install /usr/bin/lldb-mi lldb-mi /usr/bin/lldb-mi-3.8 10
update-alternatives --install /usr/bin/lldb-server lldb-server /usr/bin/lldb-server-3.8 10
update-alternatives --config clang
update-alternatives --config lldb
update-alternatives --config lldb-mi
update-alternatives --config lldb-server
SHELL
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment