Monday, May 19, 2008

wxhaskell a go go

Ive been trying to get wxhaskell installed and working on mac os running leopard for the past few weeks in my spare time. Unfortunately I couldn't find much information to help me with the process so I thought I would publish a quick step through.

First, install MacPorts 1.6.0
from there:
$ sudo port install ghc wxWidgets darcs

that gets you ghc 6.8.2, and wxWidgets wxWidgets 2.8.7 and darcs 2
we need darcs, due to the latest release of the wxhaskell bindings not working right for wx 2.8 yet in leopard, so we get to check it out from the wxhaskell darcs repo. to do that, get a checkout:
$ darcs get

that should get you a checkout. next we need to configure:

$ ./configure --hc=/opt/local/bin/ghc \
--hcpkg=/opt/local/bin/ghc-pkg \

that should get your installed configured. next make it:
$ make

then install it as root:
$ sudo make install

ok, that gets wx-core installed, next we need to get wx installed.

$ cd wx
$ runhaskell Setup configure
$ runhaskell Setup build
$ sudo runhaskell Setup install

if all went well, you're ghc-pkg list should look something like this:

$ ghc-pkg list
unix-, wx-0.10.3, wxcore-0.10.3, xhtml-3000.0.2.1

woot! wx-0.10.3 and wxcore-0.10.3 installed... now for the real test

$ cd ../samples/wx
$ ghc -package wx -o helloworld HelloWorld.hs
$ /opt/local/bin/macosx-app -v helloworld
$ open

should open the hello world app! Hopefully once wxhaskell gets a new release out, we can get a macport that will make this a bit easier. good hunting :)


Post a Comment

Links to this post:

Create a Link

<< Home