cabal hooks interface (was: Cabal package description sytax)

Simon Marlow simonmar at
Fri Dec 10 05:05:02 EST 2004

On 09 December 2004 23:56, ross at wrote:

> On Wed, Dec 08, 2004 at 10:42:26PM -0800, Isaac Jones wrote:
>> What about this interface for user-supplied command hooks.  [...]
>> For each of the pre-functions, a Maybe PackageDescription is
>> returned. If Nothing, then it gets the description from the file or
>> the default description you passed in.  If (Just p), then it uses
>> the description returned by the pre-functions.
> I'm not sure what's going on here.  It seems only preConf needs to
> return anything, and that shouldn't be the whole PackageDescription
> (since you want part of that static), just the build information.
>> I don't particularly like the idea of: {{system "runhaskell"
>> ["postinst.hs"]}} because it seems like a less elegant IO ExitCode.
>> runhaskell doesn't exist, and it relies on more moving parts.
> Sure it exists -- I read about it in the spec.

Ross's solution lets you put the postinst code in the setup script
itself, or optionally in an external script if you prefer.  This seems
more flexible to me.

Also, there doesn't seem much point in doing "runhaskell postinst.hs",
you might as well just run "./postinst.hs" or "./postinst".


More information about the Libraries mailing list