I would be happy to work around it if I could, but I can't. As far as I can
tell, I can't pass any flags to Haddock via the Cabal file. I would love to
tell Hackage to run Haddock like so, "cabal haddock
--haddock-option=--optghc=-D__HADDOCK__", but I don't know how.

Let's suppose that I do actually want to define __HADDOCK__ for my library.
Can I do this with a user-defined hook using the Cabal library?

You might want to define it conditionally, depending on version.

Cabal supports package-version macros, and haddock installs both
a package (the paths are wrong in the package description, but you
can find the version number there) and an executable for itself, but the package version macros are not available in Setup.hs.

Still, you might find something useful in the discussion for this ticket:

   Cabal should support Cabal-version-dependent Setup.hs
   http://hackage.haskell.org/trac/hackage/ticket/326

Claus

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to