Skip to content

Instantly share code, notes, and snippets.

@cartazio
Forked from deepakjois/README.md
Created June 19, 2012 20:50
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 cartazio/2956474 to your computer and use it in GitHub Desktop.
Save cartazio/2956474 to your computer and use it in GitHub Desktop.
Installing GHC and diagrams on OS X Lion

Installing GHC 7.4.2 (and/or current haskell platform) and diagrams on OS X Lion

Install prerequisites

GHC 7.4.2 64-bit (or other recent 64bit version)

use haskell platform install via haskell platform site or mac homebrew. Both should by default provide (currently) ghc 7.4.2 64bit.

Install dependencies (ordered by dependencies)

  • cabal install gtk2hs-buildtools (this MUST be done before anything else)
  • brew install cairo gtk gettext fontconfig
  • brew link cairo gettext fontconfig
  • download libfreetype (link to recent version, no guarantee that this remains up to date), unpack libfreetype, and then run ./configure ; make ; make install.
  • cabal install gtk

Install Diagrams

cabal install diagrams

Test installation

Create a file called example.hs

{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine

main = defaultMain (circle 1)

On the commandline run ghc --make example.hs, and verify that the build steps succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment