sof patch for --ghc-pkg-config-file=

Isaac Jones ijones at
Fri Sep 15 13:06:55 EDT 2006

Emailing to libraries@, please followup to cabal-devel.

Here's a patch from Sigbjorn which adds --ghc-pkg-config-file= to
cabal.  This is an oldish patch, but I haven't stopped getting
requests for this feature :)

This allows you to create a "local" package config file, rather than
using the --user or --global files, this is useful for in-place
building, as when you're developing a set of related packages.

I still have some debate about whether this patch should go in; it
assumes a model of package registration where you have a config file
(as opposed to a directory) which isn't the case for nhc or Hugs.  But
the idea doesn't seem to bother anyone but me, and the flag is clearly
marked as a ghc-related flag, so I'm thinking of letting it through.

Does anyone want to massage this to work w/ the current cabal head?




Changed paths:
   M /Distribution/Make.hs
   M /Distribution/Setup.hs
   M /Distribution/Simple/Build.hs
   M /Distribution/Simple/Configure.hs
   M /Distribution/Simple/GHCPackageConfig.hs
   M /Distribution/Simple/Install.hs
   M /Distribution/Simple/LocalBuildInfo.hs
   M /Distribution/Simple/Register.hs
   M /Distribution/Simple.hs
   M /tests/ModuleTest.hs

A couple of extensions:

- support for specifying what GHC package configuration file
  to use during (un)registration. Specified via the command-line
  option --ghc-pkg-config-file=<path> which is understood by
  'configure', 'install', 'register', and 'unregister' commands.
- better handling of package-specific header files during installation.
  If you use the Include-Dirs: and Includes: fields in your .cabal
  file to refer to package-local header files and directories, these
  will be created&copied during 'install'. i.e., suppose you spec
  the following:
     Include-Dirs: /usr/local/include/openssl, include
     Includes: include/openssl-exts.h, +openssl/openssl.h

  The 'install' action will emit the following ghc-pkg fields when
  updating/installing the GHC package:
     include_dirs = [ "/usr/local/include/openssl",
     c_includes =   [ "openssl-exts.h", "openssl/openssl.h"]

  and creates the directory in include_dirs's second element, followed
  by copying openssl-exts.h into that directory.

     - only directories that don't start with '/' are created inside
       the package's install directory.
     - Includes: entries that are prefixed with '+' are assumed to be
       referring to non-package header files and aren't (attempted) 
       copied into the package's installation tree. Bit of a twiddly
       hack, but supporting the distinction between package and 
       non-package header files does seem to be necessary.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sof-cabal-patch1
Type: application/octet-stream
Size: 25773 bytes
Desc: not available
Url :

More information about the Libraries mailing list