Cabal and c2hs
Dominic Steinitz
dominic.steinitz at blueyonder.co.uk
Sat Jul 5 03:06:35 EDT 2008
Way back in 2005, I was able to build my haskell version of ping with
this Setup.hs
> import Distribution.Simple
> import Distribution.Simple.Utils(rawSystemPath)
>
> main =
> defaultMainWithHooks
> defaultUserHooks {
> hookedPreProcessors =
> [("chs", \_ _ -> myPpC2hs)]
> }
>
> myPpC2hs inFile outFile verbose
> = rawSystemPath verbose "c2hs" ["-o", outFile, inFile]
rawSystemPath no longer seems to exist (in Distribution.Simple.Utils at
any rate).
Looking at the latest haddock, there does seem to be
> runSimplePreProcessor :: PreProcessor -> FilePath -> FilePath -> Verbosity -> IO ()
> ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
but I'm struggling to see what I put in BuildInfo and LocalBuildInfo.
I presume I put "." as the FilePath?
> main = runSimplePreProcessor (ppC2hs undefined undefined) "." "." deafening
Is there some way of getting hold of the BuildInfo and LocalBuildInfo to
pass into runSimplePreProcessor?
Thanks, Dominic.
More information about the Libraries
mailing list