Skip to content

Instantly share code, notes, and snippets.

@amyboyd
Forked from timbod7/aws-codeworld.sh
Last active August 29, 2015 14:08
Show Gist options
  • Save amyboyd/78de71cf443c4ce6c8df to your computer and use it in GitHub Desktop.
Save amyboyd/78de71cf443c4ce6c8df to your computer and use it in GitHub Desktop.
# Update and install basic dependencies
cd ~
sudo yum update -y
sudo yum install -y git
sudo yum install -y zlib-devel
sudo yum install -y ncurses-devel
# Needed for ghcjs-boot --dev
sudo yum install -y patch
sudo yum install -y autoconf
sudo yum install -y automake
mkdir downloads
mkdir build
DOWNLOADS=$HOME/downloads
BUILD=$HOME/build
PREFIX=$HOME
mkdir $PREFIX/bin
export PATH=$PREFIX/bin:$PATH
# Install GHC 7.8, since it's required for GHCJS.
sudo yum install -y gcc
sudo yum install -y gmp-devel
sudo yum install -y gcc-c++
sudo yum install -y openssl-devel
(cd $DOWNLOADS && wget http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-unknown-linux-centos65.tar.bz2)
(cd $BUILD && tar -xjf $DOWNLOADS/ghc-7.8.2-x86_64-unknown-linux-centos65.tar.bz2)
(cd $BUILD/ghc-7.8.2 && ./configure --prefix $PREFIX)
(cd $BUILD/ghc-7.8.2 && make install)
# Install all the dependencies for cabal
fromHackage() {
(cd $DOWNLOADS && wget https://hackage.haskell.org/package/$1-$2/$1-$2.tar.gz)
(cd $BUILD && tar -xzf $DOWNLOADS/$1-$2.tar.gz)
(cd $BUILD/$1-$2 && runghc $3 configure --prefix=$PREFIX)
(cd $BUILD/$1-$2 && runghc $3 build)
(cd $BUILD/$1-$2 && runghc $3 install)
}
fromHackage zlib 0.5.4.1 Setup.hs
fromHackage stm 2.4.3 Setup.hs
fromHackage random 1.0.1.1 Setup.hs
fromHackage mtl 2.1.3.1 Setup.hs
fromHackage text 1.1.1.3 Setup.lhs
fromHackage parsec 3.1.5 Setup.hs
fromHackage network 2.5.0.0 Setup.hs
fromHackage HTTP 4000.2.17 Setup.lhs
# Get a patched version of cabal (https://github.com/ghcjs/cabal) and
# then git checkout ghcjs to switch to the GHCJS branch, and finally
# cabal install both the Cabal and cabal-install packages.
fromLocal() {
(cd $1 && runghc $2 configure --prefix=$PREFIX)
(cd $1 && runghc $2 build)
(cd $1 && runghc $2 install)
}
git clone -b ghcjs https://github.com/ghcjs/cabal.git
(cd cabal && git checkout f70ed6277942c74bdd68f63e2b0694d57dcb8606) # Current ghcjs/HEAD doesn't build
fromLocal cabal/Cabal Setup.hs
fromLocal cabal/cabal-install Setup.hs
cabal update
# Get GHCJS itself (https://github.com/ghcjs/ghcjs) and cabal install.
cabal install --prefix=$PREFIX alex
cabal install --prefix=$PREFIX happy
git clone https://github.com/ananthakumaran/webify.git
(cd webify && cabal install)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment