Cabal-3.0.0.0: A framework for packaging Haskell software

CopyrightIsaac Jones 2003-2004
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Distribution.Simple.LocalBuildInfo

Contents

Description

Once a package has been configured we have resolved conditionals and dependencies, configured the compiler and other needed external programs. The LocalBuildInfo is used to hold all this information. It holds the install dirs, the compiler, the exact package dependencies, the configured programs, the package database to use and a bunch of miscellaneous configure flags. It gets saved and reloaded from a file (dist/setup-config). It gets passed in to very many subsequent build actions.

Synopsis

Documentation

data LocalBuildInfo #

Data cached after configuration step. See also ConfigFlags.

Constructors

LocalBuildInfo 

Fields

Instances
Read LocalBuildInfo # 
Instance details

Defined in Distribution.Types.LocalBuildInfo

Show LocalBuildInfo # 
Instance details

Defined in Distribution.Types.LocalBuildInfo

Generic LocalBuildInfo # 
Instance details

Defined in Distribution.Types.LocalBuildInfo

Associated Types

type Rep LocalBuildInfo :: Type -> Type #

Binary LocalBuildInfo # 
Instance details

Defined in Distribution.Types.LocalBuildInfo

type Rep LocalBuildInfo # 
Instance details

Defined in Distribution.Types.LocalBuildInfo

type Rep LocalBuildInfo = D1 (MetaData "LocalBuildInfo" "Distribution.Types.LocalBuildInfo" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) (C1 (MetaCons "LocalBuildInfo" PrefixI True) (((((S1 (MetaSel (Just "configFlags") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ConfigFlags) :*: S1 (MetaSel (Just "flagAssignment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FlagAssignment)) :*: (S1 (MetaSel (Just "componentEnabledSpec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentRequestedSpec) :*: S1 (MetaSel (Just "extraConfigArgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [String]))) :*: ((S1 (MetaSel (Just "installDirTemplates") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 InstallDirTemplates) :*: S1 (MetaSel (Just "compiler") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Compiler)) :*: (S1 (MetaSel (Just "hostPlatform") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Platform) :*: (S1 (MetaSel (Just "buildDir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "cabalFilePath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe FilePath)))))) :*: (((S1 (MetaSel (Just "componentGraph") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Graph ComponentLocalBuildInfo)) :*: S1 (MetaSel (Just "componentNameMap") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map ComponentName [ComponentLocalBuildInfo]))) :*: (S1 (MetaSel (Just "installedPkgs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 InstalledPackageIndex) :*: S1 (MetaSel (Just "pkgDescrFile") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe FilePath)))) :*: ((S1 (MetaSel (Just "localPkgDescr") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PackageDescription) :*: S1 (MetaSel (Just "withPrograms") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ProgramDb)) :*: (S1 (MetaSel (Just "withPackageDB") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PackageDBStack) :*: (S1 (MetaSel (Just "withVanillaLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "withProfLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))))) :*: ((((S1 (MetaSel (Just "withSharedLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "withStaticLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) :*: (S1 (MetaSel (Just "withDynExe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "withFullyStaticExe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) :*: ((S1 (MetaSel (Just "withProfExe") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "withProfLibDetail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ProfDetailLevel)) :*: (S1 (MetaSel (Just "withProfExeDetail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ProfDetailLevel) :*: (S1 (MetaSel (Just "withOptimization") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 OptimisationLevel) :*: S1 (MetaSel (Just "withDebugInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 DebugInfoLevel))))) :*: (((S1 (MetaSel (Just "withGHCiLib") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "splitSections") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) :*: (S1 (MetaSel (Just "splitObjs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: (S1 (MetaSel (Just "stripExes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "stripLibs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))) :*: ((S1 (MetaSel (Just "exeCoverage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "libCoverage") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) :*: (S1 (MetaSel (Just "progPrefix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PathTemplate) :*: (S1 (MetaSel (Just "progSuffix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 PathTemplate) :*: S1 (MetaSel (Just "relocatable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))))))

localComponentId :: LocalBuildInfo -> ComponentId #

Extract the ComponentId from the public library component of a LocalBuildInfo if it exists, or make a fake component ID based on the package ID.

localUnitId :: LocalBuildInfo -> UnitId #

Extract the UnitId from the library component of a LocalBuildInfo if it exists, or make a fake unit ID based on the package ID.

localCompatPackageKey :: LocalBuildInfo -> String #

Extract the compatibility package key from the public library component of a LocalBuildInfo if it exists, or make a fake package key based on the package ID.

Buildable package components

data Component #

Instances
Eq Component # 
Instance details

Defined in Distribution.Types.Component

Read Component # 
Instance details

Defined in Distribution.Types.Component

Show Component # 
Instance details

Defined in Distribution.Types.Component

Semigroup Component # 
Instance details

Defined in Distribution.Types.Component

HasBuildInfo Component # 
Instance details

Defined in Distribution.Types.Component

Methods

buildInfo :: Lens' Component BuildInfo #

buildable :: Lens' Component Bool #

buildTools :: Lens' Component [LegacyExeDependency] #

buildToolDepends :: Lens' Component [ExeDependency] #

cppOptions :: Lens' Component [String] #

asmOptions :: Lens' Component [String] #

cmmOptions :: Lens' Component [String] #

ccOptions :: Lens' Component [String] #

cxxOptions :: Lens' Component [String] #

ldOptions :: Lens' Component [String] #

pkgconfigDepends :: Lens' Component [PkgconfigDependency] #

frameworks :: Lens' Component [String] #

extraFrameworkDirs :: Lens' Component [String] #

asmSources :: Lens' Component [FilePath] #

cmmSources :: Lens' Component [FilePath] #

cSources :: Lens' Component [FilePath] #

cxxSources :: Lens' Component [FilePath] #

jsSources :: Lens' Component [FilePath] #

hsSourceDirs :: Lens' Component [FilePath] #

otherModules :: Lens' Component [ModuleName] #

virtualModules :: Lens' Component [ModuleName] #

autogenModules :: Lens' Component [ModuleName] #

defaultLanguage :: Lens' Component (Maybe Language) #

otherLanguages :: Lens' Component [Language] #

defaultExtensions :: Lens' Component [Extension] #

otherExtensions :: Lens' Component [Extension] #

oldExtensions :: Lens' Component [Extension] #

extraLibs :: Lens' Component [String] #

extraGHCiLibs :: Lens' Component [String] #

extraBundledLibs :: Lens' Component [String] #

extraLibFlavours :: Lens' Component [String] #

extraDynLibFlavours :: Lens' Component [String] #

extraLibDirs :: Lens' Component [String] #

includeDirs :: Lens' Component [FilePath] #

includes :: Lens' Component [FilePath] #

autogenIncludes :: Lens' Component [FilePath] #

installIncludes :: Lens' Component [FilePath] #

options :: Lens' Component (PerCompilerFlavor [String]) #

profOptions :: Lens' Component (PerCompilerFlavor [String]) #

sharedOptions :: Lens' Component (PerCompilerFlavor [String]) #

staticOptions :: Lens' Component (PerCompilerFlavor [String]) #

customFieldsBI :: Lens' Component [(String, String)] #

targetBuildDepends :: Lens' Component [Dependency] #

mixins :: Lens' Component [Mixin] #

data ComponentName #

Instances
Eq ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Ord ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Read ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Show ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Generic ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Associated Types

type Rep ComponentName :: Type -> Type #

Binary ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Pretty ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

Parsec ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

type Rep ComponentName # 
Instance details

Defined in Distribution.Types.ComponentName

data LibraryName #

Instances
Eq LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Data LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LibraryName -> c LibraryName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LibraryName #

toConstr :: LibraryName -> Constr #

dataTypeOf :: LibraryName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LibraryName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LibraryName) #

gmapT :: (forall b. Data b => b -> b) -> LibraryName -> LibraryName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LibraryName -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LibraryName -> r #

gmapQ :: (forall d. Data d => d -> u) -> LibraryName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LibraryName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LibraryName -> m LibraryName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LibraryName -> m LibraryName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LibraryName -> m LibraryName #

Ord LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Read LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Show LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Generic LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Associated Types

type Rep LibraryName :: Type -> Type #

Binary LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

NFData LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

Methods

rnf :: LibraryName -> () #

type Rep LibraryName # 
Instance details

Defined in Distribution.Types.LibraryName

type Rep LibraryName = D1 (MetaData "LibraryName" "Distribution.Types.LibraryName" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) (C1 (MetaCons "LMainLibName" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "LSubLibName" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnqualComponentName)))

componentNameString :: ComponentName -> Maybe UnqualComponentName #

This gets the underlying unqualified component name. In fact, it is guaranteed to uniquely identify a component, returning Nothing if the ComponentName was for the public library.

data ComponentLocalBuildInfo #

The first five fields are common across all algebraic variants.

Constructors

LibComponentLocalBuildInfo 

Fields

FLibComponentLocalBuildInfo 

Fields

ExeComponentLocalBuildInfo 

Fields

TestComponentLocalBuildInfo 

Fields

BenchComponentLocalBuildInfo 

Fields

Instances
Read ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

Show ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

Generic ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

Associated Types

type Rep ComponentLocalBuildInfo :: Type -> Type #

Binary ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

IsNode ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

Associated Types

type Key ComponentLocalBuildInfo :: Type #

type Rep ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

type Rep ComponentLocalBuildInfo = D1 (MetaData "ComponentLocalBuildInfo" "Distribution.Types.ComponentLocalBuildInfo" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) ((C1 (MetaCons "LibComponentLocalBuildInfo" PrefixI True) (((S1 (MetaSel (Just "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentName) :*: (S1 (MetaSel (Just "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentId) :*: S1 (MetaSel (Just "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) :*: (S1 (MetaSel (Just "componentIsIndefinite_") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: (S1 (MetaSel (Just "componentInstantiatedWith") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(ModuleName, OpenModule)]) :*: S1 (MetaSel (Just "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, MungedPackageId)])))) :*: ((S1 (MetaSel (Just "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(OpenUnitId, ModuleRenaming)]) :*: (S1 (MetaSel (Just "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]) :*: S1 (MetaSel (Just "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]))) :*: ((S1 (MetaSel (Just "componentCompatPackageKey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Just "componentCompatPackageName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 MungedPackageName)) :*: (S1 (MetaSel (Just "componentExposedModules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ExposedModule]) :*: S1 (MetaSel (Just "componentIsPublic") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))))) :+: C1 (MetaCons "FLibComponentLocalBuildInfo" PrefixI True) ((S1 (MetaSel (Just "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentName) :*: (S1 (MetaSel (Just "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentId) :*: S1 (MetaSel (Just "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) :*: ((S1 (MetaSel (Just "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, MungedPackageId)]) :*: S1 (MetaSel (Just "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(OpenUnitId, ModuleRenaming)])) :*: (S1 (MetaSel (Just "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]) :*: S1 (MetaSel (Just "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]))))) :+: (C1 (MetaCons "ExeComponentLocalBuildInfo" PrefixI True) ((S1 (MetaSel (Just "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentName) :*: (S1 (MetaSel (Just "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentId) :*: S1 (MetaSel (Just "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) :*: ((S1 (MetaSel (Just "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, MungedPackageId)]) :*: S1 (MetaSel (Just "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(OpenUnitId, ModuleRenaming)])) :*: (S1 (MetaSel (Just "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]) :*: S1 (MetaSel (Just "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId])))) :+: (C1 (MetaCons "TestComponentLocalBuildInfo" PrefixI True) ((S1 (MetaSel (Just "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentName) :*: (S1 (MetaSel (Just "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentId) :*: S1 (MetaSel (Just "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) :*: ((S1 (MetaSel (Just "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, MungedPackageId)]) :*: S1 (MetaSel (Just "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(OpenUnitId, ModuleRenaming)])) :*: (S1 (MetaSel (Just "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]) :*: S1 (MetaSel (Just "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId])))) :+: C1 (MetaCons "BenchComponentLocalBuildInfo" PrefixI True) ((S1 (MetaSel (Just "componentLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentName) :*: (S1 (MetaSel (Just "componentComponentId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ComponentId) :*: S1 (MetaSel (Just "componentUnitId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UnitId))) :*: ((S1 (MetaSel (Just "componentPackageDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(UnitId, MungedPackageId)]) :*: S1 (MetaSel (Just "componentIncludes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(OpenUnitId, ModuleRenaming)])) :*: (S1 (MetaSel (Just "componentExeDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId]) :*: S1 (MetaSel (Just "componentInternalDeps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [UnitId])))))))
type Key ComponentLocalBuildInfo # 
Instance details

Defined in Distribution.Types.ComponentLocalBuildInfo

foldComponent :: (Library -> a) -> (ForeignLib -> a) -> (Executable -> a) -> (TestSuite -> a) -> (Benchmark -> a) -> Component -> a #

componentBuildable :: Component -> Bool #

Is a component buildable (i.e., not marked with buildable: False)? See also this note in Distribution.Types.ComponentRequestedSpec.

Since: 2.0.0.2

pkgComponents :: PackageDescription -> [Component] #

All the components in the package.

pkgBuildableComponents :: PackageDescription -> [Component] #

A list of all components in the package that are buildable, i.e., were not marked with buildable: False. This does NOT indicate if we are actually going to build the component, see enabledComponents instead.

Since: 2.0.0.2

depLibraryPaths #

Arguments

:: Bool

Building for inplace?

-> Bool

Generate prefix-relative library paths

-> LocalBuildInfo 
-> ComponentLocalBuildInfo

Component that is being built

-> NoCallStackIO [FilePath] 

Determine the directories containing the dynamic libraries of the transitive dependencies of the component we are building.

When wanted, and possible, returns paths relative to the installDirs prefix

allLibModules :: Library -> ComponentLocalBuildInfo -> [ModuleName] #

Get all module names that needed to be built by GHC; i.e., all of these ModuleNames have interface files associated with them that need to be installed.

withAllComponentsInBuildOrder :: PackageDescription -> LocalBuildInfo -> (Component -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each buildable Library or Executable (Component) in the PackageDescription, subject to the build order specified by the compBuildOrder field of the given LocalBuildInfo

withLibLBI :: PackageDescription -> LocalBuildInfo -> (Library -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled library in the package description with the ComponentLocalBuildInfo.

withExeLBI :: PackageDescription -> LocalBuildInfo -> (Executable -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled Executable in the package description. Extended version of withExe that also gives corresponding build info.

withBenchLBI :: PackageDescription -> LocalBuildInfo -> (Benchmark -> ComponentLocalBuildInfo -> IO ()) -> IO () #

Perform the action on each enabled Benchmark in the package description.

Installation directories

data PathTemplateVariable #

Constructors

PrefixVar

The $prefix path variable

BindirVar

The $bindir path variable

LibdirVar

The $libdir path variable

LibsubdirVar

The $libsubdir path variable

DynlibdirVar

The $dynlibdir path variable

DatadirVar

The $datadir path variable

DatasubdirVar

The $datasubdir path variable

DocdirVar

The $docdir path variable

HtmldirVar

The $htmldir path variable

PkgNameVar

The $pkg package name path variable

PkgVerVar

The $version package version path variable

PkgIdVar

The $pkgid package Id path variable, eg foo-1.0

LibNameVar

The $libname path variable

CompilerVar

The compiler name and version, eg ghc-6.6.1

OSVar

The operating system name, eg windows or linux

ArchVar

The CPU architecture name, eg i386 or x86_64

AbiVar

The compiler's ABI identifier,

AbiTagVar

The optional ABI tag for the compiler

ExecutableNameVar

The executable name; used in shell wrappers

TestSuiteNameVar

The name of the test suite being run

TestSuiteResultVar

The result of the test suite being run, eg pass, fail, or error.

BenchmarkNameVar

The name of the benchmark being run

Instances
Eq PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

Ord PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

Read PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

Show PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

Generic PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

Associated Types

type Rep PathTemplateVariable :: Type -> Type #

Binary PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

type Rep PathTemplateVariable # 
Instance details

Defined in Distribution.Simple.InstallDirs.Internal

type Rep PathTemplateVariable = D1 (MetaData "PathTemplateVariable" "Distribution.Simple.InstallDirs.Internal" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) ((((C1 (MetaCons "PrefixVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "BindirVar" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "LibdirVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "LibsubdirVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DynlibdirVar" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "DatadirVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "DatasubdirVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DocdirVar" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "HtmldirVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "PkgNameVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "PkgVerVar" PrefixI False) (U1 :: Type -> Type))))) :+: (((C1 (MetaCons "PkgIdVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "LibNameVar" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "CompilerVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "OSVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ArchVar" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "AbiVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AbiTagVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ExecutableNameVar" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "TestSuiteNameVar" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "TestSuiteResultVar" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "BenchmarkNameVar" PrefixI False) (U1 :: Type -> Type))))))

data PathTemplate #

An abstract path, possibly containing variables that need to be substituted for to get a real FilePath.

Instances
Eq PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

Ord PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

Read PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

Show PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

Generic PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

Associated Types

type Rep PathTemplate :: Type -> Type #

Binary PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

type Rep PathTemplate # 
Instance details

Defined in Distribution.Simple.InstallDirs

type Rep PathTemplate = D1 (MetaData "PathTemplate" "Distribution.Simple.InstallDirs" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" True) (C1 (MetaCons "PathTemplate" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [PathComponent])))

data CopyDest #

The location prefix for the copy command.

Constructors

NoCopyDest 
CopyTo FilePath 
CopyToDb FilePath

when using the ${pkgroot} as prefix. The CopyToDb will adjust the paths to be relative to the provided package database when copying / installing.

Instances
Eq CopyDest # 
Instance details

Defined in Distribution.Simple.InstallDirs

Show CopyDest # 
Instance details

Defined in Distribution.Simple.InstallDirs

Generic CopyDest # 
Instance details

Defined in Distribution.Simple.InstallDirs

Associated Types

type Rep CopyDest :: Type -> Type #

Methods

from :: CopyDest -> Rep CopyDest x #

to :: Rep CopyDest x -> CopyDest #

Binary CopyDest # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

put :: CopyDest -> Put #

get :: Get CopyDest #

putList :: [CopyDest] -> Put #

type Rep CopyDest # 
Instance details

Defined in Distribution.Simple.InstallDirs

type Rep CopyDest = D1 (MetaData "CopyDest" "Distribution.Simple.InstallDirs" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) (C1 (MetaCons "NoCopyDest" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "CopyTo" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath)) :+: C1 (MetaCons "CopyToDb" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath))))

type InstallDirTemplates = InstallDirs PathTemplate #

The installation directories in terms of PathTemplates that contain variables.

The defaults for most of the directories are relative to each other, in particular they are all relative to a single prefix. This makes it convenient for the user to override the default installation directory by only having to specify --prefix=... rather than overriding each individually. This is done by allowing $-style variables in the dirs. These are expanded by textual substitution (see substPathTemplate).

A few of these installation directories are split into two components, the dir and subdir. The full installation path is formed by combining the two together with /. The reason for this is compatibility with other Unix build systems which also support --libdir and --datadir. We would like users to be able to configure --libdir=/usr/lib64 for example but because by default we want to support installing multiple versions of packages and building the same package for multiple compilers we append the libsubdir to get: /usr/lib64/$libname/$compiler.

An additional complication is the need to support relocatable packages on systems which support such things, like Windows.

data InstallDirs dir #

The directories where we will install files for packages.

We have several different directories for different types of files since many systems have conventions whereby different types of files in a package are installed in different directories. This is particularly the case on Unix style systems.

Constructors

InstallDirs 

Fields

Instances
Functor InstallDirs # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

fmap :: (a -> b) -> InstallDirs a -> InstallDirs b #

(<$) :: a -> InstallDirs b -> InstallDirs a #

Eq dir => Eq (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

(==) :: InstallDirs dir -> InstallDirs dir -> Bool #

(/=) :: InstallDirs dir -> InstallDirs dir -> Bool #

Read dir => Read (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Show dir => Show (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

showsPrec :: Int -> InstallDirs dir -> ShowS #

show :: InstallDirs dir -> String #

showList :: [InstallDirs dir] -> ShowS #

Generic (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Associated Types

type Rep (InstallDirs dir) :: Type -> Type #

Methods

from :: InstallDirs dir -> Rep (InstallDirs dir) x #

to :: Rep (InstallDirs dir) x -> InstallDirs dir #

Semigroup dir => Semigroup (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

(<>) :: InstallDirs dir -> InstallDirs dir -> InstallDirs dir #

sconcat :: NonEmpty (InstallDirs dir) -> InstallDirs dir #

stimes :: Integral b => b -> InstallDirs dir -> InstallDirs dir #

(Semigroup dir, Monoid dir) => Monoid (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

mempty :: InstallDirs dir #

mappend :: InstallDirs dir -> InstallDirs dir -> InstallDirs dir #

mconcat :: [InstallDirs dir] -> InstallDirs dir #

Binary dir => Binary (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

Methods

put :: InstallDirs dir -> Put #

get :: Get (InstallDirs dir) #

putList :: [InstallDirs dir] -> Put #

type Rep (InstallDirs dir) # 
Instance details

Defined in Distribution.Simple.InstallDirs

type Rep (InstallDirs dir) = D1 (MetaData "InstallDirs" "Distribution.Simple.InstallDirs" "Cabal-3.0.0.0-CD1INMNwoxXIKVgcu1nec5" False) (C1 (MetaCons "InstallDirs" PrefixI True) ((((S1 (MetaSel (Just "prefix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "bindir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir)) :*: (S1 (MetaSel (Just "libdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "libsubdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir))) :*: ((S1 (MetaSel (Just "dynlibdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "flibdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir)) :*: (S1 (MetaSel (Just "libexecdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "libexecsubdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir)))) :*: (((S1 (MetaSel (Just "includedir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "datadir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir)) :*: (S1 (MetaSel (Just "datasubdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "docdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir))) :*: ((S1 (MetaSel (Just "mandir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "htmldir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir)) :*: (S1 (MetaSel (Just "haddockdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir) :*: S1 (MetaSel (Just "sysconfdir") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 dir))))))

combineInstallDirs :: (a -> b -> c) -> InstallDirs a -> InstallDirs b -> InstallDirs c #

substituteInstallDirTemplates :: PathTemplateEnv -> InstallDirTemplates -> InstallDirTemplates #

Substitute the install dir templates into each other.

To prevent cyclic substitutions, only some variables are allowed in particular dir templates. If out of scope vars are present, they are not substituted for. Checking for any remaining unsubstituted vars can be done as a subsequent operation.

The reason it is done this way is so that in prefixRelativeInstallDirs we can replace prefix with the PrefixVar and get resulting PathTemplates that still have the PrefixVar in them. Doing this makes it each to check which paths are relative to the $prefix.

toPathTemplate :: FilePath -> PathTemplate #

Convert a FilePath to a PathTemplate including any template vars.

fromPathTemplate :: PathTemplate -> FilePath #

Convert back to a path, any remaining vars are included

initialPathTemplateEnv :: PackageIdentifier -> UnitId -> CompilerInfo -> Platform -> PathTemplateEnv #

The initial environment has all the static stuff but no paths

absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest -> InstallDirs FilePath #

Backwards compatibility function which computes the InstallDirs assuming that $libname points to the public library (or some fake package identifier if there is no public library.) IF AT ALL POSSIBLE, please use absoluteComponentInstallDirs instead.

prefixRelativeInstallDirs :: PackageId -> LocalBuildInfo -> InstallDirs (Maybe FilePath) #

Backwards compatibility function which computes the InstallDirs assuming that $libname points to the public library (or some fake package identifier if there is no public library.) IF AT ALL POSSIBLE, please use prefixRelativeComponentInstallDirs instead.