Haskell Hierarchical Libraries (Cabal package)Source codeContentsIndex
Distribution.Simple
Portabilityportable
Stabilityalpha
MaintainerIsaac 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.Compiler
module Language.Haskell.Extension
defaultMain :: IO ()
defaultMainNoRead :: PackageDescription -> IO ()
defaultMainArgs :: [String] -> IO ()
data UserHooks = UserHooks {
runTests :: (Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
readDesc :: (IO (Maybe PackageDescription))
hookedPreProcessors :: [PPSuffixHandler]
hookedPrograms :: [Program]
preConf :: (Args -> ConfigFlags -> IO HookedBuildInfo)
confHook :: (PackageDescription -> ConfigFlags -> IO LocalBuildInfo)
postConf :: (Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preBuild :: (Args -> BuildFlags -> IO HookedBuildInfo)
buildHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> BuildFlags -> IO ())
postBuild :: (Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preClean :: (Args -> CleanFlags -> IO HookedBuildInfo)
cleanHook :: (PackageDescription -> Maybe LocalBuildInfo -> Maybe UserHooks -> CleanFlags -> IO ())
postClean :: (Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ExitCode)
preCopy :: (Args -> CopyFlags -> IO HookedBuildInfo)
copyHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> CopyFlags -> IO ())
postCopy :: (Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preInst :: (Args -> InstallFlags -> IO HookedBuildInfo)
instHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> InstallFlags -> IO ())
postInst :: (Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preSDist :: (Args -> SDistFlags -> IO HookedBuildInfo)
sDistHook :: (PackageDescription -> Maybe LocalBuildInfo -> Maybe UserHooks -> SDistFlags -> IO ())
postSDist :: (Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ExitCode)
preReg :: (Args -> RegisterFlags -> IO HookedBuildInfo)
regHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> RegisterFlags -> IO ())
postReg :: (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preUnreg :: (Args -> RegisterFlags -> IO HookedBuildInfo)
unregHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> RegisterFlags -> IO ())
postUnreg :: (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
preHaddock :: (Args -> HaddockFlags -> IO HookedBuildInfo)
haddockHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> HaddockFlags -> IO ())
postHaddock :: (Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
prePFE :: (Args -> PFEFlags -> IO HookedBuildInfo)
pfeHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> PFEFlags -> IO ())
postPFE :: (Args -> PFEFlags -> PackageDescription -> 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.Compiler
module Language.Haskell.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.
defaultMainArgs :: [String] -> IO ()
Customization
data UserHooks
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. 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 -> PackageDescription -> 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.
hookedPrograms :: [Program]These programs are detected at configure time. Arguments for them are added to the configure command.
preConf :: (Args -> ConfigFlags -> IO HookedBuildInfo)Hook to run before configure command
confHook :: (PackageDescription -> ConfigFlags -> IO LocalBuildInfo)Over-ride this hook to get different behavior during configure.
postConf :: (Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after configure command
preBuild :: (Args -> BuildFlags -> IO HookedBuildInfo)Hook to run before build command. Second arg indicates verbosity level.
buildHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> BuildFlags -> IO ())Over-ride this hook to get different behavior during build.
postBuild :: (Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after build command. Second arg indicates verbosity level.
preClean :: (Args -> CleanFlags -> IO HookedBuildInfo)Hook to run before clean command. Second arg indicates verbosity level.
cleanHook :: (PackageDescription -> Maybe LocalBuildInfo -> Maybe UserHooks -> CleanFlags -> IO ())Over-ride this hook to get different behavior during clean.
postClean :: (Args -> CleanFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ExitCode)Hook to run after clean command. Second arg indicates verbosity level.
preCopy :: (Args -> CopyFlags -> IO HookedBuildInfo)Hook to run before copy command
copyHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> CopyFlags -> IO ())Over-ride this hook to get different behavior during copy.
postCopy :: (Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after copy command
preInst :: (Args -> InstallFlags -> IO HookedBuildInfo)Hook to run before install command
instHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> InstallFlags -> IO ())Over-ride this hook to get different behavior during install.
postInst :: (Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after install command. postInst should be run on the target, not on the build machine.
preSDist :: (Args -> SDistFlags -> IO HookedBuildInfo)Hook to run before sdist command. Second arg indicates verbosity level.
sDistHook :: (PackageDescription -> Maybe LocalBuildInfo -> Maybe UserHooks -> SDistFlags -> IO ())Over-ride this hook to get different behavior during sdist.
postSDist :: (Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO ExitCode)Hook to run after sdist command. Second arg indicates verbosity level.
preReg :: (Args -> RegisterFlags -> IO HookedBuildInfo)Hook to run before register command
regHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> RegisterFlags -> IO ())Over-ride this hook to get different behavior during pfe.
postReg :: (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after register command
preUnreg :: (Args -> RegisterFlags -> IO HookedBuildInfo)Hook to run before unregister command
unregHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> RegisterFlags -> IO ())Over-ride this hook to get different behavior during pfe.
postUnreg :: (Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after unregister command
preHaddock :: (Args -> HaddockFlags -> IO HookedBuildInfo)Hook to run before haddock command. Second arg indicates verbosity level.
haddockHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> HaddockFlags -> IO ())Hook to run after haddock command. Second arg indicates verbosity level. |Over-ride this hook to get different behavior during haddock.
postHaddock :: (Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)
prePFE :: (Args -> PFEFlags -> IO HookedBuildInfo)Hook to run before pfe command. Second arg indicates verbosity level.
pfeHook :: (PackageDescription -> LocalBuildInfo -> Maybe UserHooks -> PFEFlags -> IO ())Over-ride this hook to get different behavior during pfe.
postPFE :: (Args -> PFEFlags -> PackageDescription -> LocalBuildInfo -> IO ExitCode)Hook to run after pfe command. Second arg indicates verbosity level.
type Args = [String]
defaultMainWithHooks :: UserHooks -> IO ()
A customizable version of defaultMain.
defaultUserHooks :: UserHooks

Basic default UserHooks:

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.8