Cabal hooks

ross at ross at
Tue Jan 11 20:22:59 EST 2005

On Wed, Jan 12, 2005 at 12:06:11AM +0200, Krasimir Angelov wrote:
> I still get "*** Exception: Line 1: Parse of field 'name' failed"
> error if name field from Setup.buildinfo is empty.

Ah, writePackageDescription is writing an empty name field.  The parser
doesn't mind if the name field is missing, but does if it's present and
empty.  It was Isaac's original plan to write to the hooked description,
but things have evolved a bit, and that's not workable with the current
setup, as the hook doesn't have access to the original package description.

But maybe the unmodified defaultUserHooks will do what you want.
Suppose you have containing just

cc-options: @CPPFLAGS@
ld-options: @LDFLAGS@

and add Setup.buildinfo to AC_CONFIG_FILES.  Then the preConf of
defaultUserHooks will run configure, which will generate Setup.buildinfo,
and the pre-hook will then read that to get the extra fields to merge
with the package description.  All the other pre-hooks will also read
Setup.buildinfo for merging in the same way.  There's no need to store
a modified package description.

More information about the Libraries mailing list