Ticket #277 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

add data-dir field

Reported by: guest Assigned to:
Priority: normal Milestone:
Component: Cabal library Version: HEAD
Severity: minor Keywords:
Cc: Difficulty: easy (<4 hours)
GHC Version: 6.8.2 Platform:

Description

Cabal currently looks for data files to install relative to the source directory, giving the package author no possibility to move them into their own directory without cluttering up the cabal file (you end up writing things like data-files: data/foo, data/bar, data/foobar) and the source (where you'll have to include the "data/" prefix in all calls to getDataFileName).

The proposal is to add a data-dir field to the package configuration that specifies a single path which is used as a prefix for all data files in the source directory. The location of the installed files is not affected by data-dir.

Notes:

  • It's impossible to change data-dir to take a list of paths without breaking the Paths_foo module interface.
  • installation of data files will have to copy source files from a different location, ditto for sdist
  • installed packages don't change. In particular the Paths_foo module doesn't change.

Attachments

cabal-add-data-dir-field.patch (13.8 kB) - added by guest on 05/09/08 07:10:57.
proposed implementation

Change History

05/09/08 07:10:57 changed by guest

  • attachment cabal-add-data-dir-field.patch added.

proposed implementation

05/21/08 09:01:30 changed by duncan

  • status changed from new to closed.
  • resolution set to fixed.

Applied.

Fri May  9 14:04:48 BST 2008  Bertram Felgenhauer <int-e@gmx.de>
  * add data-dir field to package config
  Cabal will look for data files to install relative to the directory given
  in the data-dir field, allowing package authors to better structure their
  source tree. There's no behavioural change by default.

Fri May  9 14:13:06 BST 2008  Bertram Felgenhauer <int-e@gmx.de>
  * document data-dir field