[Haskell-cafe] Arbitrary files in a Cabal package: how to install

Ross Paterson ross at soi.city.ac.uk
Mon Jul 25 06:57:53 EDT 2005


[moving to libraries]

On Sun, Jul 24, 2005 at 02:32:27AM -0400, Dimitry Golubovsky wrote:
> I am trying to use Cabal for buiding HSFFIG as a package. Among other 
> files to install I have the special template for hsc2hs which is a C 
> include file. If I specify it in the Includes: clause nothing happens: 
> it is not copied anywhere during installation.
> 
> I need this file to be placed somewhere in the package instalation 
> location, so when programs are compiled with my package could include 
> that file.
> 
> Of course I may specify additional step in the Makefile, but it would be 
> more consistent to do this in Cabal.
> 
> How can arbitrary files be declared parts of a package, and destination 
> directories for them be specified?

There are several programs like this (e.g. hsc2hs, happy), but
specifying destination directories would be non-portable.

I think there should be a new field (data-files?) listing files to be
installed where the program can find them:
- for GHC under Unix, in {prefix}/share/{exeName}/
- for GHC under Windows, in the same directory as the executable
  ({Program Files}/{packageID})
- For Hugs, in the same directory as the Main module
  ({Hugs}/programs/{exeName})


More information about the Libraries mailing list