Copyright | (c) 2017 Shao Cheng |
---|---|
License | BSD3 |
Maintainer | astrohavoc@gmail.com |
Stability | alpha |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
This module provides helper functions for writing custom Setup.hs
scripts.
- userHooksWithBuildInfo :: UserHooks -> UserHooks
- simpleUserHooksWithBuildInfo :: UserHooks
- defaultMainWithBuildInfo :: IO ()
- packageDescriptionQ :: Q Exp
- packageDescriptionTypedQ :: Q (TExp PackageDescription)
- localBuildInfoQ :: Q Exp
- localBuildInfoTypedQ :: Q (TExp LocalBuildInfo)
- getComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> ComponentName -> InstallDirs FilePath
- getComponentBuildInfo :: PackageDescription -> ComponentName -> BuildInfo
- getGHCLibDir :: LocalBuildInfo -> FilePath
- runLBIProgram :: LocalBuildInfo -> Program -> [ProgArg] -> IO ()
- getLBIProgramOutput :: LocalBuildInfo -> Program -> [ProgArg] -> IO String
Writing build metadata in Setup.hs
userHooksWithBuildInfo :: UserHooks -> UserHooks Source #
Attach a post-configure action to a UserHooks
which serializes PackageDescription
to .pkg_descr.buildinfo
and LocalBuildInfo
to .lbi.buildinfo
.
They should be added to your project's .gitignore
file.
Don't forget to edit the custom-setup stanza of your project's .cabal
file and add cabal-toolkit
to the dependencies.
defaultMainWithBuildInfo :: IO () Source #
Retrieving build metadata via Template Haskell
packageDescriptionQ :: Q Exp Source #
The Template Haskell splice to retrieve PackageDescription
.
localBuildInfoQ :: Q Exp Source #
The Template Haskell splice to retrieve LocalBuildInfo
.
Convenient functions for working with build metadata
getComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> ComponentName -> InstallDirs FilePath Source #
Retrieve the InstallDirs
corresponding to a ComponentName
, assuming that component does exist and is unique.
getComponentBuildInfo :: PackageDescription -> ComponentName -> BuildInfo Source #
Retrieve the BuildInfo
corresponding to a ComponentName
, assuming that component does exist and is unique.
getGHCLibDir :: LocalBuildInfo -> FilePath Source #
Equivalent to what you get from ghc --print-libdir
.
runLBIProgram :: LocalBuildInfo -> Program -> [ProgArg] -> IO () Source #
getLBIProgramOutput :: LocalBuildInfo -> Program -> [ProgArg] -> IO String Source #