[Hackage] #819: Pass extra parameters of 'configure' to user hooks

Hackage cvs-ghc at haskell.org
Tue Mar 22 21:20:43 CET 2011

#819: Pass extra parameters of 'configure' to user hooks
  Reporter:  guest          |        Owner:                    
      Type:  enhancement    |       Status:  new               
  Priority:  normal         |    Milestone:                    
 Component:  Cabal library  |      Version:           
  Severity:  normal         |     Keywords:  configure, command
Difficulty:  unknown        |   Ghcversion:                    
  Platform:                 |  
 Non-standard options to 'configure' are not supported by Cabal; to accept
 new options requires writing a custom version of Cabal's 'defaultMain'.
 It would be useful to provide some support for extending the command-line
 parser, or at least passing unrecognized arguments to user hooks.

 To motivate this feature, here's my use case.  During the build phase, my
 package builds an executable, then uses the executable to build some data
 files.  The executable and data files are installed together.  If the
 executable needs extra arguments (e.g., search paths) to run, they can be
 supplied as command-line parameters to 'configure'.  Supporting these
 extra parameters required some changes to Cabal.

 I did it by copying 'defaultMainWithHooks' and some 200-odd lines of non-
 exported functions from Distribution.Simple into my package's Setup.hs so
 that I could override 'configureCommand'.  This gave me access to the
 command-line parser.  Relatively little code was actually changed, so
 hopefully this feature would fit nicely into the current codebase.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/819>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list