Skip to content

Instantly share code, notes, and snippets.

@aztecrex
Last active June 7, 2018 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aztecrex/09dfea04e9f74d6236e77460a496d996 to your computer and use it in GitHub Desktop.
Save aztecrex/09dfea04e9f74d6236e77460a496d996 to your computer and use it in GitHub Desktop.
How to build hackage server 0.5.1 on Ubuntu in AWS
# Launch and log into a Ubuntu 16.04 instance in AWS
sudo apt-get update
sudo apt-get install -y gcc libgmp-dev libicu-dev zlib1g-dev libtinfo-dev libssl-dev
download='https://www.haskell.org/platform/download/8.2.2/haskell-platform-8.2.2-unknown-posix--core-x86_64.tar.gz'
wget "$download" -O platform.tgz
tar -xzvf platform.tgz
sudo ./install-haskell-platform.sh
cabal update
cabal --version
ghc --version
git clone https://github.com/haskell/hackage-server/
cd hackage-server
# edit cabal.project and get rid of allow-newer field
sed -e 's/allow-newer/-- allow-newer/' -i cabal.project
time cabal new-build -j
host="actual-host.compute-1.amazonaws.com"
./dist-newstyle/build/x86_64-linux/ghc-8.2.2/hackage-server-0.5.1/c/hackage-server/build/hackage-server/hackage-server init --static-dir $(pwd)/datafiles
./dist-newstyle/build/x86_64-linux/ghc-8.2.2/hackage-server-0.5.1/c/hackage-server/build/hackage-server/hackage-server run --static-dir $(pwd)/datafiles --base-uri=http://${host}:8080/ --ip=0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment