Copyright | (c) The University of Glasgow 2004 |
---|---|
Maintainer | libraries@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This is the information about an installed package that
is communicated to the ghc-pkg
program in order to register
a package. ghc-pkg
now consumes this package format (as of version
6.4). This is specific to GHC at the moment.
The .cabal
file format is for describing a package that is not yet
installed. It has a lot of flexibility, like conditionals and dependency
ranges. As such, that format is not at all suitable for describing a package
that has already been built and installed. By the time we get to that stage,
we have resolved all conditionals and resolved dependency version
constraints to exact versions of dependent packages. So, this module defines
the InstalledPackageInfo
data structure that contains all the info we keep
about an installed package. There is a parser and pretty printer. The
textual format is rather simpler than the .cabal
format: there are no
sections, for example.
Synopsis
- data InstalledPackageInfo = InstalledPackageInfo {
- sourcePackageId :: PackageId
- sourceLibName :: Maybe UnqualComponentName
- installedComponentId_ :: ComponentId
- installedUnitId :: UnitId
- instantiatedWith :: [(ModuleName, OpenModule)]
- compatPackageKey :: String
- license :: Either License License
- copyright :: String
- maintainer :: String
- author :: String
- stability :: String
- homepage :: String
- pkgUrl :: String
- synopsis :: String
- description :: String
- category :: String
- abiHash :: AbiHash
- indefinite :: Bool
- exposed :: Bool
- exposedModules :: [ExposedModule]
- hiddenModules :: [ModuleName]
- trusted :: Bool
- importDirs :: [FilePath]
- libraryDirs :: [FilePath]
- libraryDynDirs :: [FilePath]
- dataDir :: FilePath
- hsLibraries :: [String]
- extraLibraries :: [String]
- extraGHCiLibraries :: [String]
- includeDirs :: [FilePath]
- includes :: [String]
- depends :: [UnitId]
- abiDepends :: [AbiDependency]
- ccOptions :: [String]
- cxxOptions :: [String]
- ldOptions :: [String]
- frameworkDirs :: [FilePath]
- frameworks :: [String]
- haddockInterfaces :: [FilePath]
- haddockHTMLs :: [FilePath]
- pkgRoot :: Maybe FilePath
- installedPackageId :: InstalledPackageInfo -> UnitId
- installedComponentId :: InstalledPackageInfo -> ComponentId
- installedOpenUnitId :: InstalledPackageInfo -> OpenUnitId
- sourceComponentName :: InstalledPackageInfo -> ComponentName
- requiredSignatures :: InstalledPackageInfo -> Set ModuleName
- data ExposedModule = ExposedModule {}
- data AbiDependency = AbiDependency {
- depUnitId :: UnitId
- depAbiHash :: AbiHash
- data ParseResult a
- = ParseFailed PError
- | ParseOk [PWarning] a
- data PError
- = AmbiguousParse String LineNo
- | NoParse String LineNo
- | TabsError LineNo
- | FromString String (Maybe LineNo)
- data PWarning
- emptyInstalledPackageInfo :: InstalledPackageInfo
- parseInstalledPackageInfo :: String -> ParseResult InstalledPackageInfo
- showInstalledPackageInfo :: InstalledPackageInfo -> String
- showFullInstalledPackageInfo :: InstalledPackageInfo -> String
- showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
- showSimpleInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String)
Documentation
data InstalledPackageInfo Source #
Instances
installedPackageId :: InstalledPackageInfo -> UnitId Source #
Deprecated: Use installedUnitId instead
Backwards compatibility with Cabal pre-1.24.
This type synonym is slightly awful because in cabal-install
we define an InstalledPackageId
but it's a ComponentId,
not a UnitId!
installedOpenUnitId :: InstalledPackageInfo -> OpenUnitId Source #
Get the indefinite unit identity representing this package.
This IS NOT guaranteed to give you a substitution; for
instantiated packages you will get DefiniteUnitId (installedUnitId ipi)
.
For indefinite libraries, however, you will correctly get
an OpenUnitId
with the appropriate OpenModuleSubst
.
requiredSignatures :: InstalledPackageInfo -> Set ModuleName Source #
Returns the set of module names which need to be filled for an indefinite package, or the empty set if the package is definite.
data ExposedModule Source #
Instances
data AbiDependency Source #
An ABI dependency is a dependency on a library which also
records the ABI hash (abiHash
) of the library it depends
on.
The primary utility of this is to enable an extra sanity when GHC loads libraries: it can check if the dependency has a matching ABI and if not, refuse to load this library. This information is critical if we are shadowing libraries; differences in the ABI hash let us know what packages get shadowed by the new version of a package.
Instances
data ParseResult a Source #
Instances
Monad ParseResult # | |
Defined in Distribution.ParseUtils (>>=) :: ParseResult a -> (a -> ParseResult b) -> ParseResult b Source # (>>) :: ParseResult a -> ParseResult b -> ParseResult b Source # return :: a -> ParseResult a Source # fail :: String -> ParseResult a Source # | |
Functor ParseResult # | |
Defined in Distribution.ParseUtils fmap :: (a -> b) -> ParseResult a -> ParseResult b Source # (<$) :: a -> ParseResult b -> ParseResult a Source # | |
MonadFail ParseResult # | |
Defined in Distribution.ParseUtils fail :: String -> ParseResult a Source # | |
Applicative ParseResult # | |
Defined in Distribution.ParseUtils pure :: a -> ParseResult a Source # (<*>) :: ParseResult (a -> b) -> ParseResult a -> ParseResult b Source # liftA2 :: (a -> b -> c) -> ParseResult a -> ParseResult b -> ParseResult c Source # (*>) :: ParseResult a -> ParseResult b -> ParseResult b Source # (<*) :: ParseResult a -> ParseResult b -> ParseResult a Source # | |
Show a => Show (ParseResult a) # | |
Defined in Distribution.ParseUtils |
AmbiguousParse String LineNo | |
NoParse String LineNo | |
TabsError LineNo | |
FromString String (Maybe LineNo) |
showInstalledPackageInfo :: InstalledPackageInfo -> String Source #
Pretty print InstalledPackageInfo
.
pkgRoot
isn't printed, as ghc-pkg prints it manually (as GHC-8.4).
showFullInstalledPackageInfo :: InstalledPackageInfo -> String Source #
The variant of showInstalledPackageInfo
which outputs pkgroot
field too.
showInstalledPackageInfoField :: String -> Maybe (InstalledPackageInfo -> String) Source #
>>>
let ipi = emptyInstalledPackageInfo { maintainer = "Tester" }
>>>
fmap ($ ipi) $ showInstalledPackageInfoField "maintainer"
Just "maintainer: Tester"