Make sure you have the 64-bit version of GHC. If you installed GHC using brew install haskell-platform
, you are using the 32-bit version which wont work with the instructions below. To install the 64-bit version
-
Follow instructions in this gist. However, note that the patch for
cabal-install
that they point to is not available anymore. There is a similar patch in this gist, which worked for me. Read this comment for more info on how to apply the patch. -
You could try
brew install --devel --64-bit haskell-platform
, and report back here if it works for you. I have not tried it myself.
cabal install gtk2hs-buildtools
brew install cairo gtk gettext fontconfig
brew link cairo gettext fontconfig
- download libfreetype, unpack libfreetype, and then run
./configure ; make ; make install
. cabal install gtk
cabal install diagrams
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.