Safe Haskell | None |
---|---|
Language | Haskell98 |
Utility functions for reading cabal file fields through template haskell.
Synopsis
- packageVariable :: Text a => (PackageDescription -> a) -> Q Exp
- packageVariableFrom :: Text a => FilePath -> (PackageDescription -> a) -> Q Exp
- packageString :: String -> DocString
- data PackageDescription = PackageDescription {
- specVersionRaw :: Either Version VersionRange
- package :: PackageIdentifier
- licenseRaw :: Either License License
- licenseFiles :: [FilePath]
- copyright :: String
- maintainer :: String
- author :: String
- stability :: String
- testedWith :: [(CompilerFlavor, VersionRange)]
- homepage :: String
- pkgUrl :: String
- bugReports :: String
- sourceRepos :: [SourceRepo]
- synopsis :: String
- description :: String
- category :: String
- customFieldsPD :: [(String, String)]
- buildTypeRaw :: Maybe BuildType
- setupBuildInfo :: Maybe SetupBuildInfo
- library :: Maybe Library
- subLibraries :: [Library]
- executables :: [Executable]
- foreignLibs :: [ForeignLib]
- testSuites :: [TestSuite]
- benchmarks :: [Benchmark]
- dataFiles :: [FilePath]
- dataDir :: FilePath
- extraSrcFiles :: [FilePath]
- extraTmpFiles :: [FilePath]
- extraDocFiles :: [FilePath]
- data PackageIdentifier = PackageIdentifier {}
- module Distribution.Version
Template Haskell functions
packageVariable :: Text a => (PackageDescription -> a) -> Q Exp Source #
Renders the package variable specified by the function. The cabal file interrogated is the first one that is found in the current working directory.
packageVariableFrom :: Text a => FilePath -> (PackageDescription -> a) -> Q Exp Source #
Renders the package variable specified by the function, from a cabal file and the given path.
packageString :: String -> DocString Source #
Provides a Pretty instance for String, allowing text fields to be used
in packageVariable
. Use it composed with an accessor, eg.
packageVariable (packageString . copyright)
Cabal file data structures
The data structures for the cabal file are re-exported here for ease of use.
data PackageDescription #
This data type is the internal representation of the file pkg.cabal
.
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.
PackageDescription | |
|
Instances
data PackageIdentifier #
The name and version of a package.
PackageIdentifier | |
|
Instances
module Distribution.Version