Latest proposal is here. Below might be out of date.
The idea is to add support for
- optional dependencies
- optional stanzas in the package description
and allow selecting these options by
- command-line options to configure, eg. --enable-debug
- properties of the environment (eg. GHC version, platform)
- environment variables
- combinations of the above
possible features / use cases
- allow different configurations to go into different build trees so they don't conflict w/ each-other?
The current syntax we have in mind is
package: foo
build-depends: base>=1.0
configuration: debug
ghc-options: -DDEBUG -O0 -Wall
configuration: !debug
ghc-options: -O
configuration: OS=windows
build-depends: Win32
configuration: !OS=windows
build-depends: unix
configuration: COMPILER=ghc
build-depends: fps
The language of the expression in a 'configuration:' field is:
config0 ::= label
| label=value
| (config)
config ::= !config0
| config0 | config
| config, config
i.e. simple boolean combinations of label and label=value.
A label expression can be made true by either adding --enable-label on the configure command line, or by setting the ENABLE_label environment variable.
A 'label=value' expression can be set by either --with-label=value on the configure command line, or by setting label=value in the environment.
Configure --help will list the available --enable and --with options by examining the package description.
We might need a --disable-environment setting to disable taking settings from the environment, so that automatic packaging systems can be made more robust in the face of arbitrary environment settings.