Hello,
I really wanted to respond to the parent thread, but I deleted it already, so this message will be a bit out of context.
For my own needs, I cabalized and debianized the Streams library. It generates binary debs for ghc6 and hugs -- but I think the hugs version is broken. In any case, it is a start, you can download the packaging at:
http://www.n-heptane.com/nhlab/tmp/Streams_packaging.tar.gz
That tarball contains only the packaging -- you just untar it over top of an existing 'Streams' directory that already contains the source. I have only done minimal testing on it.
Cabal Question:
The streams library uses cpphs to do some preprocessing. There is a hugs specific Makefile that invokes cpphs with the command-line:
cpphs --noline -D__HUGS__ -D__HUGS_VERSION__=2005 -DSIZEOF_HSINT=4 -DSIZEOF_HSWORD=4
I tried adding the -D stuff to the cc-includes section of the .cabal file, but that caused the ghc6 build to start failing. Is there an easy way to specify flags that should only be used with cpphs and only when building hugs? Or is this one of those cases when I need to use some of the fancy hook features of cabal?
Thanks. j.
On Sun, May 21, 2006 at 01:20:54PM -0700, Jeremy Shaw wrote:
Cabal Question:
The streams library uses cpphs to do some preprocessing. There is a hugs specific Makefile that invokes cpphs with the command-line:
cpphs --noline -D__HUGS__ -D__HUGS_VERSION__=2005 -DSIZEOF_HSINT=4 -DSIZEOF_HSWORD=4
I tried adding the -D stuff to the cc-includes section of the .cabal file, but that caused the ghc6 build to start failing. Is there an easy way to specify flags that should only be used with cpphs and only when building hugs? Or is this one of those cases when I need to use some of the fancy hook features of cabal?
Cabal already adds -D__HUGS__ when building for Hugs, __HUGS_VERSION__ isn't used, and the SIZEOF's aren't universally valid. For GHC, the package gets them from MachDeps.h (an undocumented interface). Doing it portably probably requires autoconfery.
Apart from that, the main in Setup.lhs could just be defaultMain.
Hello Ross,
Monday, May 22, 2006, 3:59:17 AM, you wrote:
cpphs --noline -D__HUGS__ -D__HUGS_VERSION__=2005 -DSIZEOF_HSINT=4 -DSIZEOF_HSWORD=4
Cabal already adds -D__HUGS__ when building for Hugs, __HUGS_VERSION__ isn't used, and the SIZEOF's aren't universally valid. For GHC, the package gets them from MachDeps.h (an undocumented interface). Doing it portably probably requires autoconfery.
but what to do if library depends on Hugs version and word size of target machine? GHC can solve such problems by providing all the necessary preprocessor symbols but Hugs can't :(
debian-haskell@lists.urchin.earth.li