-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Adds executable dependencies to the Cabal build -- -- Please see the README on GitHub at -- https://github.com/deech/cabal-build-programs#readme @package cabal-build-programs @version 0.1.0.0 module Distribution.Simple.BuildPrograms -- | The custom field to use in Cabal stanza to specify external programs. -- In a ~.cabal~ file use: -- --
--   x-build-programs: p1,p2,p3
--   
-- -- whereas in the ~package.yaml~ of a Stack or hpack -- project you must use (note that "p1,p2,p3" are quoted): -- --
--   verbatim:
--     x-build-programs: "p1,p2,p3"
--   
buildProgramsCustomField :: String -- | This function is the easiest way to use this library in your -- Setup.hs. -- -- The default Setup.hs: -- --
--   import Distribution.Simple
--   main = defaultMain
--   
-- -- becomes: -- --
--   import Distribution.Simple.BuildPrograms -- <- only change
--   main = defaultMain
--   
defaultMain :: IO () -- | Directly access the UserHooks that back defaultMain when -- you need finer grained control, they are backed by -- simpleUserHooks: -- --
--   import Distribution.Simple.BuildPrograms
--   import Distribution.Simple(defaultMainWithHooks)
--   main = defaultMainWithHooks buildProgramUserHooks
--   
buildProgramsUserHooks :: UserHooks -- | This is the lowest level function provided by this library for use in -- a highly customized Setup.hs scripts. Most of the other -- functions wrap it in some way. -- -- LocalBuildInfo is a large datastructure that holds all the -- information required to build a project, this function gathers up only -- the components that need to be built ( or loaded in GHCi ), extracts -- the programs in the "x-build-programs" fields, checks that they exist -- and adds them as ConfiguredProgram to the ProgramDb of -- the provided LocalBuildInfo and returns a new -- LocalBuildInfo with the new ProgramDb. -- -- If any of the programs are cannot be found a formatted error message -- is returned. -- -- The expectation is that it is called from a buildHook or a -- replHook at some point before the components are built. localBuildInfoWithBuildPrograms :: Args -> Verbosity -> [Program] -> PackageDescription -> LocalBuildInfo -> IO (Either String LocalBuildInfo) -- | Used internally it figures out which components to build, extracts the -- required external programs into a lookup table. To make debugging -- easier I made it public so you print the table. componentBuildPrograms :: Verbosity -> PackageDescription -> LocalBuildInfo -> Args -> IO [(Component, [String])]