Here are the steps listed before for cabalizing
gtk2hs build:

0. build two mini Haskell programs hierarchyGen and TypeGen
1. using these, generate two .chs files automatically
2. using grep magic, generate dependencies between different .chs
modules
3. run c2hs to generate a binary representation of the C header file
4. run c2hs to generate .hs files for each .chs using the binary file
from step 3.; generate file according to dependencies
5. run hsc2hs to generate .hs files from .hsc files
6. build a few C files
7. build all .hs files
8. link everything


After doing some checking, I do think it's not that
dificult to get this into cabal. Steps 5 to 8 are easy, and
done by cabal itself. Steps 0 to 4 can be done as long as
we drive everything by Haskell code. Such code would then
be installed as a pre-build hook.

I think actually rewriting steps 2 as Haskell code and use
c2hs as a library to get steps 3 and 4 could make debugging
easier. However, it's possible to get everything working
by using Haskell code in Setup.lhs just to call everything
like it is today in the proper sequence, including building
c2hs, and check if everything went well.

Maurício


------------------------------------------------------------------------------
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to