[Haskell-cafe] cabal, Setup.lhs example

Magnus Therning magnus at therning.org
Wed Jul 21 06:00:03 EDT 2010

On Wed, Jul 21, 2010 at 04:53, Rogan Creswick <creswick at gmail.com> wrote:
> On Tue, Jul 20, 2010 at 8:50 PM, Tom Hawkins <tomahawkins at gmail.com> wrote:
>> Thanks.  I tried this, but it appears cabal-install ignores the
>> Setup.hs file.  The only way I could get it to take is if I run
>> 'runhaskell Setup.hs configure' directly.  I always assumed
>> cabal-install runs Setup.hs under the hood, but apparently not.  Why
>> is this?
> I believe you must set
> Build-type: Custom
> in your cabal file to use user hooks in Setup.hs.  I don't fully
> understand the implications of using Custom, though.

I am successfully using hooks with the following in my .cabal file:

    Build-Type    : Simple

and my main in Setup.hs looks like this:

    main = defaultMainWithHooks $ simpleUserHooks
        { cleanHook = profileClean
        , runTests = runTestsBuild


Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

More information about the Haskell-Cafe mailing list