Sunday, 27 July 2014

GHC 7.8 with cabal-install on Windows 7

Here's how I set up GHC 7.8 with cabal install on Windows 7 64bit. These instructions are basically what https://github.com/23Skidoo/haskell-platform-windows says to do. Note: The setup requires MSYS, I used the "git bash" which comes with git for windows which worked fine.
  1. Downloaded the binary build from http://www.haskell.org/ghc/download_ghc_7_8_2#binaries and extracted to C:\\ghc-7.8.2
  2. Added a bunch of stuff to path
    1. export PATH=/c/ghc-7.8.2/bin:/c/ghc-7.8.2/mingw/bin:/c/ghc-7.8.2/perl:$PATH
  3. Install dependencies for cabal. In this order, installed each of zlib, transformers, mtl, text, parsec, network, HTTP, random, stm. To do that I did the following:
    1. Went to https://hackage.haskell.org/package/<packagename>
    2. Download the tar (at the bottom of the page) and extract
    3. Configure and install it by running the following (note: some packages have Setup.lhs instead of .hs):
      1. runghc Setup.hs configure --prefix="C:\\ghc-7.8.2"
      2. runghc Setup.hs build
      3. runghc Setup.hs haddock
      4. runghc Setup.hs install
  4. Installed cabal install 1.18.05 by going to https://hackage.haskell.org/package/cabal-install-1.18.0.5 and follow the same instructions as the dependencies to install it.
  5. Now run cabal update and cabal install cabal-install to install the latest cabal install.
  6. Added everything to my PATH more permanently: (http://www.rapidee.com/en/about helps)
    1. C:\\ghc-7.8.2\\bin
    2. C:\\Users\\Tim Monks\\AppData\\Roaming\\cabal\\bin
Now I can use cabal sandboxes and ghc 7.8 on Windows 7 :)