| Copyright | (c) The University of Glasgow 2006 Duncan Coutts 2008 |
|---|---|
| Maintainer | cabal-devel@haskell.org |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- data SetupRunnerArgs (spec :: SetupWrapperSpec) where
- NotInLibrary :: SetupRunnerArgs 'UseGeneralSetup
- InLibraryArgs :: forall flags. InLibraryArgs flags -> SetupRunnerArgs ('TryInLibrary flags)
- data SPostConfigurePhase flags where
- SBuildPhase :: SPostConfigurePhase BuildFlags
- SHaddockPhase :: SPostConfigurePhase HaddockFlags
- SReplPhase :: SPostConfigurePhase ReplFlags
- SCopyPhase :: SPostConfigurePhase CopyFlags
- SRegisterPhase :: SPostConfigurePhase RegisterFlags
- STestPhase :: SPostConfigurePhase TestFlags
- SBenchPhase :: SPostConfigurePhase BenchmarkFlags
- data InLibraryArgs flags where
- InLibraryConfigureArgs :: ElaboratedSharedConfig -> ElaboratedReadyPackage -> TVar InstalledPackageIndex -> InLibraryArgs ConfigFlags
- InLibraryPostConfigureArgs :: forall flags. SPostConfigurePhase flags -> InLibraryLBI -> InLibraryArgs flags
- type family SetupRunnerRes (spec :: SetupWrapperSpec) where ...
- data InLibraryLBI
- type family RightFlagsForPhase flags (setupSpec :: SetupWrapperSpec) where ...
- setupWrapper :: forall (setupSpec :: SetupWrapperSpec) flags. RightFlagsForPhase flags setupSpec => Verbosity -> SetupScriptOptions -> Maybe PackageDescription -> CommandUI flags -> (flags -> CommonSetupFlags) -> (Version -> IO flags) -> (Version -> [String]) -> SetupRunnerArgs setupSpec -> IO (SetupRunnerRes setupSpec)
- data SetupScriptOptions = SetupScriptOptions {
- useCabalVersion :: VersionRange
- useCabalSpecVersion :: Maybe Version
- useCompiler :: Maybe Compiler
- usePlatform :: Maybe Platform
- usePackageDB :: PackageDBStackCWD
- usePackageIndex :: Maybe InstalledPackageIndex
- useProgramDb :: ProgramDb
- useDistPref :: SymbolicPath Pkg ('Dir Dist)
- useLoggingHandle :: Maybe Handle
- useWorkingDir :: Maybe (SymbolicPath CWD ('Dir Pkg))
- useExtraPathEnv :: [FilePath]
- useExtraEnvOverrides :: [(String, Maybe FilePath)]
- useDependencies :: [(ComponentId, PackageId)]
- useDependenciesExclusive :: Bool
- useVersionMacros :: Bool
- useWin32CleanHack :: Bool
- setupCacheLock :: Maybe Lock
- isInteractive :: Bool
- isMainLibOrExeComponent :: Bool
- defaultSetupScriptOptions :: SetupScriptOptions
- externalSetupMethod :: WithCallStack (FilePath -> SetupRunner 'UseGeneralSetup)
Documentation
data SetupRunnerArgs (spec :: SetupWrapperSpec) where Source #
Constructors
| NotInLibrary :: SetupRunnerArgs 'UseGeneralSetup | |
| InLibraryArgs :: forall flags. InLibraryArgs flags -> SetupRunnerArgs ('TryInLibrary flags) |
data SPostConfigurePhase flags where Source #
Constructors
data InLibraryArgs flags where Source #
Constructors
| InLibraryConfigureArgs :: ElaboratedSharedConfig -> ElaboratedReadyPackage -> TVar InstalledPackageIndex -> InLibraryArgs ConfigFlags | |
| InLibraryPostConfigureArgs :: forall flags. SPostConfigurePhase flags -> InLibraryLBI -> InLibraryArgs 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.
Constructors
| InLibraryLBI LocalBuildInfo | |
| NotInLibraryNoLBI |
type family RightFlagsForPhase flags (setupSpec :: SetupWrapperSpec) where ... Source #
Equations
| RightFlagsForPhase flags 'UseGeneralSetup = () | |
| RightFlagsForPhase flags ('TryInLibrary flags') = flags ~ flags' |
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 #