[Haskell-cafe] c2hs and cabal?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Nov 27 19:33:42 EST 2006


On Mon, 2006-11-27 at 22:26 +0000, Magnus Therning wrote:
> Can I use cabal to build packages that incorporates C libraries and FFI
> Haskell created using c2hs?

Yes you can. Cabal understands a bit about .chs files. I think all you
need to do is specify the module in the exposed-modules or other-modules
and Cabal will find the .chs file and try to build a .hs file from it.

However at the moment your .chs files cannot import each other because
Cabal doesn't to any dependency analysis. That means you can't use
c2hs's {# import #} hooks.

An initial patch was posted to the cabal-devel mailing list to do this
properly but it hasn't been integrated yet.

Duncan



More information about the Haskell-Cafe mailing list