-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Helper functions for writing custom Setup.hs scripts.
--   
--   Helper functions for writing custom Setup.hs scripts.
--   
--   This is useful to access configuration parameters of a
--   <tt>Cabal</tt>-based project at runtime, e.g. when you want to supply
--   the right <tt>GHC_PACKAGE_PATH</tt> to <tt>ghc</tt> oder
--   <tt>ghci</tt>.
@package cabal-toolkit
@version 0.0.5


-- | This module provides helper functions for writing custom
--   <tt>Setup.hs</tt> scripts.
module Distribution.Simple.Toolkit

-- | Attach a post-configure action to a <a>UserHooks</a> which serializes
--   <a>PackageDescription</a> to <tt>.pkg_descr.buildinfo</tt> and
--   <a>LocalBuildInfo</a> to <tt>.lbi.buildinfo</tt>. They should be added
--   to your project's <tt>.gitignore</tt> file. Don't forget to edit the
--   <a>custom-setup</a> stanza of your project's <tt>.cabal</tt> file and
--   add <tt>cabal-toolkit</tt> to the dependencies.
userHooksWithBuildInfo :: UserHooks -> UserHooks
simpleUserHooksWithBuildInfo :: UserHooks
defaultMainWithBuildInfo :: IO ()

-- | The Template Haskell splice to retrieve <a>PackageDescription</a>.
packageDescriptionQ :: Q Exp
packageDescriptionTypedQ :: Q (TExp PackageDescription)

-- | The Template Haskell splice to retrieve <a>LocalBuildInfo</a>.
localBuildInfoQ :: Q Exp
localBuildInfoTypedQ :: Q (TExp LocalBuildInfo)

-- | Retrieve the <a>InstallDirs</a> corresponding to a
--   <a>ComponentName</a>, assuming that component does exist and is
--   unique.
getComponentInstallDirs :: PackageDescription -> LocalBuildInfo -> ComponentName -> InstallDirs FilePath

-- | Retrieve the <a>BuildInfo</a> corresponding to a <a>ComponentName</a>,
--   assuming that component does exist and is unique.
getComponentBuildInfo :: PackageDescription -> ComponentName -> BuildInfo

-- | Equivalent to what you get from <tt>ghc --print-libdir</tt>.
getGHCLibDir :: LocalBuildInfo -> FilePath

-- | Run a <a>Program</a> with default <a>Verbosity</a>.
runLBIProgram :: LocalBuildInfo -> Program -> [ProgArg] -> IO ()

-- | Run a <a>Program</a> and retrieve <tt>stdout</tt> with default
--   <a>Verbosity</a>.
getLBIProgramOutput :: LocalBuildInfo -> Program -> [ProgArg] -> IO String

-- | Extract <a>PackageDBFlag</a>s from <a>LocalBuildInfo</a> to put into
--   the <a>packageDBFlags</a> field of <a>DynFlags</a>. This is useful to
--   ensure the invocation of GHC API shares the same package databases
--   (e.g. a <tt>stack</tt> snapshot)
getGHCPackageDBFlags :: LocalBuildInfo -> [PackageDBFlag]
cmakeProgram :: Program
makeProgram :: Program
ninjaProgram :: Program
