cabal-install
Copyright(c) The University of Glasgow 2006
Duncan Coutts 2008
Maintainercabal-devel@haskell.org
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.SetupWrapper

Description

An interface to building and installing Cabal packages. If the Built-Type field is specified as something other than Custom, and the current version of Cabal is acceptable, this performs setup actions directly. Otherwise it builds the setup script and runs it with the given arguments.

Synopsis

Documentation

data SetupRunnerArgs (spec :: SetupWrapperSpec) where Source #

Constructors

NotInLibrary :: SetupRunnerArgs 'UseGeneralSetup 
InLibraryArgs :: forall flags. InLibraryArgs flags -> SetupRunnerArgs ('TryInLibrary flags) 

type family SetupRunnerRes (spec :: SetupWrapperSpec) where ... Source #

Equations

SetupRunnerRes 'UseGeneralSetup = () 
SetupRunnerRes ('TryInLibrary phase) = InLibraryPhaseRes phase 

data InLibraryLBI Source #

If we end up using the in-library method, we use the InLibraryLBI constructor. If not, we use the NotInLibraryNoLBI constructor.

NB: we don't know ahead of time whether we can use the in-library method; e.g. for a package with Hooks build-type, it depends on whether the Cabal version used by the package matches with the Cabal version that cabal-install was built against.

type family RightFlagsForPhase flags (setupSpec :: SetupWrapperSpec) where ... Source #

Equations

RightFlagsForPhase flags 'UseGeneralSetup = () 
RightFlagsForPhase flags ('TryInLibrary flags') = flags ~ flags' 

setupWrapper Source #

Arguments

:: forall (setupSpec :: SetupWrapperSpec) flags. RightFlagsForPhase flags setupSpec 
=> Verbosity 
-> SetupScriptOptions 
-> Maybe PackageDescription 
-> CommandUI flags 
-> (flags -> CommonSetupFlags) 
-> (Version -> IO flags)

produce command flags given the Cabal library version

-> (Version -> [String]) 
-> SetupRunnerArgs setupSpec 
-> IO (SetupRunnerRes setupSpec) 

Configure a Setup and run a command in one step. The command flags may depend on the Cabal library version in use.

data SetupScriptOptions Source #

SetupScriptOptions are options used to configure and run Setup, as opposed to options given to the Cabal command at runtime.

Constructors

SetupScriptOptions 

Fields

externalSetupMethod :: WithCallStack (FilePath -> SetupRunner 'UseGeneralSetup) Source #