Multiple .cabal Files

Jeremy O'Donoghue jeremy.odonoghue at gmail.com
Tue Jan 9 05:35:31 EST 2007


Oddly, I was about to ask almost exactly the same question.

The supplementary is:

I'm trying to convert wxHaskell to use a cabal based build system.

Building wxHaskell (somewhat simplified) consists of the following steps:

1) Build wxc, a library which provides C callable functions for the
    C++ methods in wxWidgets. This is really a C project, and I don't
    think cabal is the appropriate tool. I have a makefile for this.
2) Build wxdirect, an automated FFI generator. This is pure Haskell.
    I have a cabal build for this.
3) Build wxcore library. This is a low-level Haskell wrapper around the
    wxc library which is essentially autogenerated using wxdirect.
    I have a cabal build for this.
4) Build wx library. This is a higher level Haskell library which depends
   on wxcore. I have a cabal build for this.

The problem is that I have currently put the three cabal builds in
separate directories, which makes the whole thing rather messy.

Is there some way to specify the basic dependencies that:

wx depends on wxcore
wxcore depends on running wxdirect on some set of files
wxdirect tool (an executable) needs to be built first.

It would seem to me like this is probably a fairly common pattern in
any project which wraps a substantial external library, as the
approach is: automatically wrap the C API to give a low level
(basically imperative) Haskell API; wrap the low level API in
something more 'Haskellish'.

I'm looking for a suggested approach. I could roll my own, but it
sounds like there is a generic pattern here, so I'd rather (if I have
to) write something others can also use (or, better, use something
others have already done ;-)

Regards
Jeremy

On 09/01/07, Duncan Coutts <duncan.coutts at worc.ox.ac.uk> wrote:
> On Mon, 2007-01-08 at 15:20 -0800, Ashley Yakeley wrote:
> > Is there a way to tell cabal to pick a particular .cabal file when there
> > are several in the current directory?
>
> Not at the moment, no.
>
> Duncan
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>


More information about the Libraries mailing list