Commit 2990db6f authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add bootPackageDb function.

parent eac54ff6
......@@ -65,6 +65,7 @@ instance ShowArgs a => ShowArgs [a] where
instance ShowArgs a => ShowArgs (Action a) where
showArgs = (showArgs =<<)
-- TODO: improve args type safety
args :: ShowArgs a => a -> Args
args = showArgs
......
......@@ -73,6 +73,12 @@ bootPkgConstraints = args $ do
_ -> redError $ "Cannot determine package version in '"
++ toStandard cabal ++ "'."
bootPackageDb :: Args
bootPackageDb = do
top <- showArg GhcSourcePath
arg $ toStandard
$ "--package-db=" ++ top </> "libraries/bootstrapping.conf"
cabalArgs :: Package -> TodoItem -> Args
cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
[ args ["configure", path, dist]
......@@ -83,6 +89,7 @@ cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
, with (Ghc stage) -- TODO: used limited to max stage1 GHC
, with (GhcPkg stage)
, customConfArgs settings
, when (stage == Stage0) bootPackageDb
, libraryArgs =<< ways settings
, when (specified HsColour) $ with HsColour
, configureArgs stage settings
......@@ -94,12 +101,11 @@ cabalArgs pkg @ (Package _ path _) todo @ (stage, dist, settings) = args
, with Happy ] -- TODO: reorder with's
ghcPkgArgs :: Package -> TodoItem -> Args
ghcPkgArgs (Package _ path _) (stage, dist, _) = return $
[ "update"
, "--force"
, toStandard $ path </> dist </> "inplace-pkg-config" ]
++
[ "--package-db=libraries/bootstrapping.conf" | stage == Stage0 ]
ghcPkgArgs (Package _ path _) (stage, dist, _) = args $
[ arg "update"
, arg "--force"
, arg $ toStandard $ path </> dist </> "inplace-pkg-config"
, when (stage == Stage0) bootPackageDb ]
buildRule :: Package -> TodoItem -> Rules ()
buildRule pkg @ (Package name path _) todo @ (stage, dist, settings) =
......
......@@ -12,16 +12,18 @@ libraryPackagesInStage Stage0 =
, "hoopl"
, "hpc"
, "transformers" ]
libraryPackagesInStage Stage1 = []
--[ "array"
--, "deepseq"
--, "Cabal/Cabal"
--, "containers"
--, "filepath"
--, "parallel"
--, "pretty"
--, "stm"
--, "template-haskell" ]
libraryPackagesInStage Stage1 =
libraryPackagesInStage Stage0 ++
[ "array"
, "deepseq"
, "Cabal/Cabal"
, "containers"
, "filepath"
, "parallel"
, "pretty"
, "stm"
, "template-haskell" ]
libraryPackagesInStage _ = []
libraryPackages :: [String]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment