ContentsIndex
Distribution.PackageDescription
Portability
Stability alpha
Maintainer Isaac Jones <ijones@syntaxpolice.org>
Description
Package description and parsing.
Synopsis
data PackageDescription = PackageDescription {
package :: PackageIdentifier
license :: License
copyright :: String
maintainer :: String
author :: String
stability :: String
testedWith :: [(CompilerFlavor, VersionRange)]
homepage :: String
pkgUrl :: String
description :: String
category :: String
buildDepends :: [Dependency]
buildable :: Bool
ccOptions :: [String]
ldOptions :: [String]
frameworks :: [String]
library :: (Maybe Library)
executables :: [Executable]
}
emptyPackageDescription :: PackageDescription
readPackageDescription :: FilePath -> IO PackageDescription
parseDescription :: String -> ParseResult PackageDescription
writePackageDescription :: FilePath -> PackageDescription -> IO ()
showPackageDescription :: PackageDescription -> String
unionPackageDescription :: PackageDescription -> PackageDescription -> PackageDescription
basicStanzaFields :: [StanzaField PackageDescription]
setupMessage :: String -> PackageDescription -> IO ()
withLib :: PackageDescription -> a -> (Library -> IO a) -> IO a
hasLibs :: PackageDescription -> Bool
data BuildInfo = BuildInfo {
cSources :: [FilePath]
hsSourceDir :: FilePath
extensions :: [Extension]
extraLibs :: [String]
extraLibDirs :: [String]
includeDirs :: [FilePath]
includes :: [FilePath]
options :: [(CompilerFlavor, [String])]
}
emptyBuildInfo :: BuildInfo
data Executable = Executable {
exeName :: String
executableModules :: [String]
modulePath :: FilePath
buildInfo :: BuildInfo
}
data Library = Library {
exposedModules :: [String]
hiddenModules :: [String]
libBuildInfo :: BuildInfo
}
emptyExecutable :: Executable
exeModules :: PackageDescription -> [String]
libModules :: PackageDescription -> [String]
hcOptions :: CompilerFlavor -> [(CompilerFlavor, [String])] -> [String]
Documentation
data PackageDescription
This data type is the internal representation of the file pkg.descr. It contains two kinds of information about the package: information which is needed for all packages, such as the package name and version, and information which is needed for the simple build system only, such as the compiler options and library name.
Constructors
PackageDescription
package :: PackageIdentifier
license :: License
copyright :: String
maintainer :: String
author :: String
stability :: String
testedWith :: [(CompilerFlavor, VersionRange)]
homepage :: String
pkgUrl :: String
description :: String
category :: String
buildDepends :: [Dependency]
buildable :: Boolpackage is buildable here
ccOptions :: [String]options for C compiler
ldOptions :: [String]options for linker
frameworks :: [String]
library :: (Maybe Library)
executables :: [Executable]
Instances
Show PackageDescription
Read PackageDescription
Eq PackageDescription
emptyPackageDescription :: PackageDescription
readPackageDescription :: FilePath -> IO PackageDescription
Parse the given package file.
parseDescription :: String -> ParseResult PackageDescription
writePackageDescription :: FilePath -> PackageDescription -> IO ()
showPackageDescription :: PackageDescription -> String
unionPackageDescription :: PackageDescription -> PackageDescription -> PackageDescription
This isn't quite the right way to go about this. For one thing, the Right Thing for excutables isn't exactly clear. For another thing, it's hard to tell whether or not the field was provided at all in p1. The only way to guess (as the parser is currently implemented) is to compare it with the emptyPackageDescription variable, though it's possible that they will be equal, but the user actually did provide that field. Another question is what to do about the required, static fields which should not be in p2. We should definitely check to be sure they're in p1, and not in p2, though not in this function. FIXME: executables not implemented correctly, library (buildinfo) not yet implemented.
basicStanzaFields :: [StanzaField PackageDescription]
setupMessage :: String -> PackageDescription -> IO ()
withLib :: PackageDescription -> a -> (Library -> IO a) -> IO a
If the package description has a library section, call the given function with the library build info as argument.
hasLibs :: PackageDescription -> Bool
does this package have any libraries?
data BuildInfo
Constructors
BuildInfo
cSources :: [FilePath]
hsSourceDir :: FilePath
extensions :: [Extension]
extraLibs :: [String]
extraLibDirs :: [String]
includeDirs :: [FilePath]
includes :: [FilePath]
options :: [(CompilerFlavor, [String])]
Instances
Show BuildInfo
Read BuildInfo
Eq BuildInfo
emptyBuildInfo :: BuildInfo
data Executable
Constructors
Executable
exeName :: String
executableModules :: [String]
modulePath :: FilePath
buildInfo :: BuildInfo
Instances
Show Executable
Read Executable
Eq Executable
data Library
Constructors
Library
exposedModules :: [String]
hiddenModules :: [String]
libBuildInfo :: BuildInfo
Instances
Show Library
Eq Library
Read Library
emptyExecutable :: Executable
exeModules :: PackageDescription -> [String]
Get all the module names from the exes in this package
libModules :: PackageDescription -> [String]
Get all the module names from the libraries in this package
hcOptions :: CompilerFlavor -> [(CompilerFlavor, [String])] -> [String]
Select options for a particular Haskell compiler.
Produced by Haddock version 0.6