[Hackage] #208: Support program prefixes and suffixes

Hackage trac at galois.com
Thu Jan 17 14:36:54 EST 2008

#208: Support program prefixes and suffixes
  Reporter:  duncan         |        Owner:         
      Type:  enhancement    |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  normal         |   Ghcversion:  6.8.2  
  Platform:  Linux          |  
 GNU autoconf has these configure flags:

     Specifies a prefix which should be added to the name of a program when
     installing it. For example, using `--program-prefix=g' when
     a program normally named `tar' will cause the installed program to be
     named `gtar' instead.

     Specifies a suffix which should be appended to the name of a program
     when installing it.

 This would be handy for appending program versions to allow installing
 multiple versions of the same program. For example:

 cabal configure --program-prefix='$version'

 So I can end up with `haddock-0.9` and `haddock-` in my `~/bin`

 Distros that use 'alternatives' systems might like to use this feature.

 This should be fairly easy to implement, as the prefix/suffix can be
 parsed and represented as a `PathTemplate`, which handles `$version` vars
 etc. The prefix/suffix would need to be propagated into the
 `LocalBuildInfo` (and probably var-substituted into an ordinary `String`
 at that point) and then used when generating the binary name.

 This would be particularly handy in combination with a cabal-install
 feature to symlink newly-installed versions of programs into an
 alternative directory. For example we might install versioned binaries
 into ~/.cabal/bin by default and symlink the latest into ~/bin. Or we
 might symlink versioned links to each version, and an unversioned link to
 the latest one that got installed. Anyway, there's room for exploration
 there as to the best default.

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

More information about the cabal-devel mailing list