id,summary,reporter,owner,description,type,status,priority,resolution,keywords,cc,topic,difficulty,mentor
1602,"Supply dependencies for non-simple cabal build types (eg, Setup.hs)",creswick,,"Non-standard builds often need to implement specific build steps in Setup.hs, specifying a build-type: Custom in the project cabal file.  The user hook system works reasonably well for modifying or replacing the specific sub steps of a build, but *implementing* anything more than the simplest logic in Setup.hs is very difficult.

A great deal of this difficulty stems from the lack of library support for code in Setup.hs.  Adding a cabal section that specifies a build-depends: for Custom (and possibly other) build types would allow developers to reuse build code between projects, to share build system modifications on hackage more easily, and to prototype new additions to cabal.

Setup.hs *can* allow arbitrarily complex build system manipulations; however, it is not practical to do so because the infrastructure surrounding Setup.hs doesn't promote code reuse.  The addition of dependencies that cabal-install would install prior to building setup.hs and issuing the build would enable developers to produce custom builds that perform complex operations that utilize the high-quality libraries available on hackage.  Furthermore, this would provide the means to prototype (and distribute) new cabal / cabal-install features before integrating experimental code into the stable tools.

I think something akin to the Library section would work for this, e.g.;

{{{
    CustomBuild
        Setup-is: Setup.hs
        Build-Depends:  ...
        Build-tools:    ...
        ...
        (I expect that most of the fields applicable to 
         Library would also apply here.)
}}}",proposed-project,new,not yet rated,,,creswick@…,Cabal,1 person Summer,not-accepted
