| Haskell Core Libraries (Cabal package) | Contents | Index

Distribution.Simple

Portability | GHC
Stability | alpha
Maintainer | Isaac Jones <ijones@syntaxpolice.org>

Contents

Simple interface
Customization

Description
Explanation: Simple build system; basically the interface for Distribution.Simple.* modules. When given the parsed command-line args and package information, is able to perform basic commands like configure, build, install, register, etc. 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.
Synopsis

module Distribution.Package
module Distribution.Version
module Distribution.License
module Distribution.Extension
defaultMain :: IO ()
defaultMainNoRead :: PackageDescription -> IO ()

data UserHooks = UserHooks {

runTests :: (Args -> Bool -> LocalBuildInfo -> IO ExitCode)
readDesc :: (IO (Maybe PackageDescription))
hookedPreProcessors :: [PPSuffixHandler]
preConf :: (Args -> ConfigFlags -> IO HookedBuildInfo)
postConf :: (Args -> ConfigFlags -> LocalBuildInfo -> IO ExitCode)
preBuild :: (Args -> Int -> IO HookedBuildInfo)
postBuild :: (Args -> Int -> LocalBuildInfo -> IO ExitCode)
preClean :: (Args -> Int -> IO HookedBuildInfo)
postClean :: (Args -> Int -> LocalBuildInfo -> IO ExitCode)
preCopy :: (Args -> CopyFlags -> IO HookedBuildInfo)
postCopy :: (Args -> CopyFlags -> LocalBuildInfo -> IO ExitCode)
preInst :: (Args -> InstallFlags -> IO HookedBuildInfo)
postInst :: (Args -> InstallFlags -> LocalBuildInfo -> IO ExitCode)
preSDist :: (Args -> Int -> IO HookedBuildInfo)
postSDist :: (Args -> Int -> LocalBuildInfo -> IO ExitCode)
preReg :: (Args -> RegisterFlags -> IO HookedBuildInfo)
postReg :: (Args -> RegisterFlags -> LocalBuildInfo -> IO ExitCode)
preUnreg :: (Args -> RegisterFlags -> IO HookedBuildInfo)
postUnreg :: (Args -> RegisterFlags -> LocalBuildInfo -> IO ExitCode)
preHaddock :: (Args -> Int -> IO HookedBuildInfo)
postHaddock :: (Args -> Int -> LocalBuildInfo -> IO ExitCode)
prePFE :: (Args -> Int -> IO HookedBuildInfo)
postPFE :: (Args -> Int -> LocalBuildInfo -> IO ExitCode)

}

type Args = [String]
defaultMainWithHooks :: UserHooks -> IO ()
defaultUserHooks :: UserHooks
emptyUserHooks :: UserHooks
defaultHookedPackageDesc :: IO (Maybe FilePath)

Documentation
module Distribution.Package
module Distribution.Version
module Distribution.License
module Distribution.Extension
Simple interface
defaultMain :: IO ()
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 :: PackageDescription -> IO ()
Like `defaultMain`, but accepts the package description as input rather than using IO to read it.
Customization
data UserHooks

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

UserHooks |

runTests :: (Args -> Bool -> LocalBuildInfo -> IO ExitCode) | Used for `./setup test`
readDesc :: (IO (Maybe PackageDescription)) | Read the description file
hookedPreProcessors :: [PPSuffixHandler] | Custom preprocessors in addition to and overriding `knownSuffixHandlers`.
preConf :: (Args -> ConfigFlags -> IO HookedBuildInfo) |
postConf :: (Args -> ConfigFlags -> LocalBuildInfo -> IO ExitCode) |
preBuild :: (Args -> Int -> IO HookedBuildInfo) |
postBuild :: (Args -> Int -> LocalBuildInfo -> IO ExitCode) |
preClean :: (Args -> Int -> IO HookedBuildInfo) |
postClean :: (Args -> Int -> LocalBuildInfo -> IO ExitCode) |
preCopy :: (Args -> CopyFlags -> IO HookedBuildInfo) |
postCopy :: (Args -> CopyFlags -> LocalBuildInfo -> IO ExitCode) |
preInst :: (Args -> InstallFlags -> IO HookedBuildInfo) |
postInst :: (Args -> InstallFlags -> LocalBuildInfo -> IO ExitCode) | guaranteed to be run on target
preSDist :: (Args -> Int -> IO HookedBuildInfo) |
postSDist :: (Args -> Int -> LocalBuildInfo -> IO ExitCode) |
preReg :: (Args -> RegisterFlags -> IO HookedBuildInfo) |
postReg :: (Args -> RegisterFlags -> LocalBuildInfo -> IO ExitCode) |
preUnreg :: (Args -> RegisterFlags -> IO HookedBuildInfo) |
postUnreg :: (Args -> RegisterFlags -> LocalBuildInfo -> IO ExitCode) |
preHaddock :: (Args -> Int -> IO HookedBuildInfo) |
postHaddock :: (Args -> Int -> LocalBuildInfo -> IO ExitCode) |
prePFE :: (Args -> Int -> IO HookedBuildInfo) |
postPFE :: (Args -> Int -> LocalBuildInfo -> IO ExitCode) |

type Args = [String]
defaultMainWithHooks :: UserHooks -> IO ()
A customizable version of `defaultMain`.
defaultUserHooks :: UserHooks

Basic default `UserHooks`:

- on non-Windows systems, `postConf` runs `./configure`, if present.
- the pre-hooks `preBuild`, `preClean`, `preCopy`, `preInst`, `preReg` and `preUnreg` read additional build information from package`.buildinfo`, if present.

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

emptyUserHooks :: UserHooks
Empty `UserHooks` which do nothing.
defaultHookedPackageDesc :: IO (Maybe FilePath)
Optional auxiliary package information file (pkgname`.buildinfo`)
Produced by Haddock version 0.7