Cabal-2.0.1.0: A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2005
LicenseBSD3
Maintainer[email protected]
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Simple

Contents

Description

This is the command line front end to the Simple build system. When given the parsed command-line args and package information, is able to perform basic commands like configure, build, install, register, etc.

This module exports the main functions that Setup.hs scripts use. It re-exports the UserHooks type, the standard entry points like defaultMain and defaultMainWithHooks and the predefined sets of UserHooks that custom Setup.hs scripts can extend to add their own behaviour.

This module isn't called "Simple" because it's simple. Far from it. It's called "Simple" because it does complicated things to simple software.

The original idea was that there could be different build systems that all presented the same compatible command line interfaces. There is still a Distribution.Make system but in practice no packages use it.

Synopsis

Documentation

Simple interface

defaultMain :: IO () Source #

A simple implementation of main for a Cabal setup script. It reads the package description file using IO, and performs the action specified on the command line.

defaultMainNoRead :: GenericPackageDescription -> IO () Source #

Like defaultMain, but accepts the package description as input rather than using IO to read it.

defaultMainArgs :: [String] -> IO () Source #

A version of defaultMain that is passed the command line arguments, rather than getting them from the environment.

Customization

data UserHooks Source #

Hooks allow authors to add specific functionality before and after a command is run, and also to specify additional preprocessors.

  • WARNING: The hooks interface is under rather constant flux as we try to understand users needs. Setup files that depend on this interface may break in future releases.

Constructors

UserHooks 

Fields

type Args = [String] Source #

defaultMainWithHooks :: UserHooks -> IO () Source #

A customizable version of defaultMain.

defaultMainWithHooksArgs :: UserHooks -> [String] -> IO () Source #

A customizable version of defaultMain that also takes the command line arguments.

Standard sets of hooks

simpleUserHooks :: UserHooks Source #

Hooks that correspond to a plain instantiation of the "simple" build system

defaultUserHooks :: UserHooks Source #

Deprecated: Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2 compatibility in which case you must stick with defaultUserHooks

Basic autoconf UserHooks:

Thus configure can use local system information to generate package.buildinfo and possibly other files.

emptyUserHooks :: UserHooks Source #

Empty UserHooks which do nothing.

Utils

defaultHookedPackageDesc :: IO (Maybe FilePath) Source #

Optional auxiliary package information file (pkgname.buildinfo)