Commit 5d6c2d7a authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add userPackages for overriding default targetPackages.

parent 5b1c2153
......@@ -6,7 +6,7 @@ module Expression (
Ways, Packages,
Environment (..), defaultEnvironment,
append, appendM, remove, appendSub, appendSubD, filterSub, removeSub,
interpret,
interpret, interpretDiff,
applyPredicate, (?), (??), stage, notStage, builder, notBuilder, package,
configKeyValue, configKeyValues,
configKeyYes, configKeyNo, configKeyNonEmpty
......@@ -89,6 +89,9 @@ interpret = flip runReaderT
fromDiff :: Monoid a => DiffExpr a -> Expr a
fromDiff = fmap (($ mempty) . appEndo)
interpretDiff :: Environment -> Expr a -> Action a
interpretDiff env = interpret env . fromDiff
applyPredicate :: Monoid a => Predicate -> Expr a -> Expr a
applyPredicate predicate expr = do
bool <- predicate
......
......@@ -18,7 +18,7 @@ generateTargets :: Rules ()
generateTargets = action $
forM_ [Stage0 ..] $ \stage -> do
let env = defaultEnvironment { getStage = stage }
pkgs <- interpret env $ fromDiff targetPackages
pkgs <- interpretDiff env $ targetPackages <> userPackages
forM_ pkgs $ \pkg -> do
let dir = targetDirectory stage pkg
need [pkgPath pkg </> dir </> "package-data.mk"]
......
module UserSettings (
userSettings
userSettings, userPackages
) where
import Base hiding (arg, args, Args)
......@@ -12,6 +12,9 @@ userSettings :: Settings
userSettings = mconcat
[ package compiler ? stage Stage0 ? append ["foo", "bar"]
, builder (Ghc Stage0) ? remove ["-O2"]
, builder GhcCabal ? removeSub "--configure-option=CFLAGS" ["-Werror"]
]
, builder GhcCabal ? removeSub "--configure-option=CFLAGS" ["-Werror"] ]
userPackages :: Settings
userPackages = mconcat
[ stage Stage1 ? remove [cabal]
, remove [compiler] ]
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