Skip to content

Instantly share code, notes, and snippets.

@obcode
Forked from cartazio/gist:1655271
Created January 22, 2012 10:06
Show Gist options
  • Save obcode/1656450 to your computer and use it in GitHub Desktop.
Save obcode/1656450 to your computer and use it in GitHub Desktop.
simple directions to install gtk haskell libs on OS X lion so that Everything works
note that these directions probably can use some cleanup, but i'm choosing these steps so that rebuilding any haskell library doesn't require remembering ANYTHING :-)
(tested on ghc 7.2.2, assumes you have standard developer things installed on mac, like x11 and stuff)
1) cabal install gtk2hs-buildtools #(this should work with any haskell platform install)
2) brew install cairo gtk gettext fontconfig
3) brew link cairo gettext fontconfig # brew will complain, who cares, this makes your life easier (at least if you're living in a haskell world :p )
4) download libfreetype, heres a URL you can use http://sourceforge.net/projects/freetype/files/freetype2/2.4.8/freetype-2.4.8.tar.bz2/download?use_mirror=iweb
5) unpack libfreetype, and then run
./configure ; make ; make install
this will install the static and dynamic library files for lib freetype in /usr/local/ (../include and ../lib) , which is what you'll want, though this will contribute to brew doctor complaining, but again, this is the easiest way
6) cabal install gtk
this should work sans complaints!
now you can eg
cabal install chart-gtk
and run
this https://gist.github.com/1655252 example chart code either by building with ghc and running the executable
or by running main in ghc, and
or
try out some other cool libraries like diagrams!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment