WxHaskell/Development/Environment

From HaskellWiki
< WxHaskell‎ | Development
Revision as of 22:46, 14 September 2011 by Dukedave (talk | contribs) (New page: == Overview == This page is intended to provide information for those wishing to work on the wxHaskell library, specifically creating and maintaining an environment in which to do so. == ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

This page is intended to provide information for those wishing to work on the wxHaskell library, specifically creating and maintaining an environment in which to do so.

Obtaining wxWidgets

Firstly, see WxHaskell/Building.

Note that wxHaskell is currently between wxWidgets 2.8 and the development 2.9 release, so it pays well to ensure new code will work with both versions. It is possible to safely co-habit two version of wxWidgets. When you do wxHaskell will build against whichever version is returned by wxconfig --version, on Linux you can change which version you build wxHaskell against by follow steps similar to this (this should be easier):

$ wx-config --version
2.8.12
$ whereis wx-config
wx-config: /usr/local/bin/wx-config
$ ls -l /usr/local/bin/wx-config
lrwxrwxrwx 1 root root 41 2011-09-14 21:20 /usr/local/bin/wx-config -> /usr/local/lib/wx/config/gtk2-unicode-debug-2.8
$ sudo rm /usr/local/bin/wx-config
$ sudo ln -s /usr/local/lib/wx/config/gtk2-unicode-2.9 /usr/local/bin/wx-config
$ wx-config --version
2.9.2

Building and testing wxHaskell

When working on wxHaskell it is suggested that you use Cabal-dev to isolate your development code from stable wxHaskell packages you may have obtained from Hackage. To do this enter the root wxHaskell directory (http://code.haskell.org/wxhaskell/) and enter the following:

cabal-dev add-source wxdirect
cabal-dev add-source wxcore
cabal-dev add-source wx

You can then install your development version of wxHaskell into a separate Cabal-dev package database (which will be under ./cabal-dev/packages-7.0.3.conf/) thus:

cabal-dev install wx

You may then build against your development install thus:

ghc -package-conf /path/to/wxhaskell/cabal-dev/packages-7.0.3.conf/ --make MyTestCode.hs