Created
January 7, 2012 22:48
-
-
Save tcrayford/1576350 to your computer and use it in GitHub Desktop.
getting cabal/ghc working on heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run this on an empty Heroku app: | |
# heroku create -s cedar my-haskell | |
# heroku run bash --app my-haskell | |
curl ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.bz2 | tar -xjvf - | |
cd gmp-5.0.2 | |
./configure -prefix /app/gmp | |
make install | |
(seems to work, make check all passes) | |
export LD_LIBRARY_PATH=/app/gmp/lib | |
curl "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-unknown-linux.tar.bz2" | tar -xjvf - | |
cd ghc-7.0.4 | |
./configure -prefix /app/ghc | |
make install | |
NEED TO CONFIGURE RTS AS PER | |
http://stackoverflow.com/questions/2558166/using-ghc-cabal-with-gmp-installed-in-user-space | |
/app/ghc/bin/ghc-pkg describe rts | sed | |
ghc/bin/ghc-pkg describe rts | sed "s/library-dirs: \/app\/ghc\/lib\/ghc-7.0.4/library-dirs: \/app\/ghc\/lib\/ghc-7.0.4\n \/app\/gmp\/lib\//" > rts.pkg | |
curl http://lambda.haskell.org/platform/download/2011.4.0.0/haskell-platform-2011.4.0.0.tar.gz | tar -xzvf - | |
cd haskell-platform-2011.4.0.0 | |
./configure -prefix /app/haskell-platform --with-ghc=/app/ghc/bin/ghc --with-ghc-pkg=/app/ghc/bin/ghc-pkg --with-hsc2hs=/app/ghc/bin/hsc2hs | |
curl http://www.haskell.org/cabal/release/cabal-1.10.2.0/Cabal-1.10.2.0.tar.gz | tar -xzvf - | |
cd Cabal-1.10.2.0 | |
/app/ghc/bin/runghc Setup.hs configure --user --prefix=/app/caballib -p --with-compiler=/app/ghc/bin/ghc --ghc | |
/app/ghc/bin/runghc Setup.hs build | |
/app/ghc/bin/runghc Setup.hs install | |
curl "http://www.haskell.org/cabal/release/cabal-install-0.10.2/cabal-install-0.10.2.tar.gz" | tar -xzvf - | |
cd cabal-install-0.10.2 | |
export PATH="$PATH:/app/ghc/bin" | |
sh bootstrap.sh | |
/app/ghc/bin/runghc Setup.hs configure --user --prefix=/app/cabal-install -p --with-compiler=/app/ghc/bin/ghc --ghc | |
/app/ghc/bin/runghc Setup.hs build | |
/app/ghc/bin/runghc Setup.hs install | |
congrats, you now have a working cabal in /app/.cabal/bin. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment