Skip to content

Instantly share code, notes, and snippets.

@johncant
Last active August 29, 2015 14:14
Show Gist options
  • Save johncant/6a337759304b0e473659 to your computer and use it in GitHub Desktop.
Save johncant/6a337759304b0e473659 to your computer and use it in GitHub Desktop.
GHC 7.8.4, Cabal 1.22, Haskell, Snap, Haste and React on Vagrant
#!/bin/bash
echo "Starting provisioning"
tty -s && mesg n # Can't quite remember why I needed this
set -e
echo "export PATH=\"/opt/ghc/bin/:\$PATH\"" >> ~/.bashrc
export PATH="$PATH:/opt/ghc/bin"
source ~/.bashrc
sudo apt-get -y update
sudo apt-get -y upgrade
sudo aptitude install -y libgmp3-dev zlib1g-dev libbz2-dev git vim nmap
wget https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz
tar xvf ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz
cd ghc-7.8.4
./configure --prefix=/opt/ghc
sudo make install
cd ~/
curl -O https://www.haskell.org/cabal/release/cabal-1.22.0.0/Cabal-1.22.0.0.tar.gz
tar xzvf Cabal-1.22.0.0.tar.gz
cd Cabal-1.22.0.0
ghc --make Setup.hs
./Setup configure --user
./Setup build
./Setup install
#sudo -E PATH=$PATH ./Setup install
cd ~/
# get distributive
curl -O https://www.haskell.org/cabal/release/cabal-install-1.22.0.0/cabal-install-1.22.0.0.tar.gz
# extract archive
tar xzvf cabal-install-1.22.0.0.tar.gz
cd cabal-install-1.22.0.0
# install
#sudo -E PATH=$PATH ./bootstrap.sh
./bootstrap.sh
echo "export PATH=\"$HOME/.cabal/bin/:\$PATH\"" >> ~/.bashrc
export PATH="$HOME/.cabal/bin/:$PATH"
cd ~/
cabal update
git clone -b 0.4.4.3 https://github.com/valderman/haste-compiler
cd haste-compiler
cabal install
haste-boot --dev
cd ../
haste-inst install --flags="-integer-gmp" hashable-1.2.3.1
git clone -b invoke_classes_refactor_anims https://github.com/johncant/react-haskell
haste-inst install react-haskell-1.3.0.0
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.provider "virtualbox" do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "4096"]
end
config.vm.provision "shell" do |sh|
sh.path = "deploy"
sh.privileged = false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment