Re-export Expression from Predicates
[ghc.git] / src / Settings / Builders / GhcPkg.hs
1 module Settings.Builders.GhcPkg (ghcPkgBuilderArgs) where
2
3 import Base
4 import Builder
5 import Predicates
6 import Settings
7 import Settings.Builders.GhcCabal
8
9 ghcPkgBuilderArgs :: Args
10 ghcPkgBuilderArgs = builder GhcPkg ? (initArgs <> updateArgs)
11
12 initPredicate :: Predicate
13 initPredicate = orM $ map (output . packageDbDirectory) [Stage0 ..]
14
15 initArgs :: Args
16 initArgs = initPredicate ? do
17 mconcat [ arg "init"
18 , arg =<< getOutput ]
19
20 -- TODO: move inplace-pkg-config to buildRootPath, see #113.
21 updateArgs :: Args
22 updateArgs = notM initPredicate ? do
23 pkg <- getPackage
24 dir <- getContextDirectory
25 mconcat [ arg "update"
26 , arg "--force"
27 , bootPackageDbArgs
28 , arg $ pkgPath pkg -/- dir -/- "inplace-pkg-config" ]