Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
5d6c2d7a
Commit
5d6c2d7a
authored
Jun 14, 2015
by
Andrey Mokhov
Browse files
Add userPackages for overriding default targetPackages.
parent
5b1c2153
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Expression.hs
View file @
5d6c2d7a
...
...
@@ -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
...
...
src/Rules.hs
View file @
5d6c2d7a
...
...
@@ -18,7 +18,7 @@ generateTargets :: Rules ()
generateTargets
=
action
$
forM_
[
Stage0
..
]
$
\
stage
->
do
let
env
=
defaultEnvironment
{
getStage
=
stage
}
pkgs
<-
interpret
env
$
fromDiff
targetPackages
pkgs
<-
interpret
Diff
env
$
targetPackages
<>
userPackages
forM_
pkgs
$
\
pkg
->
do
let
dir
=
targetDirectory
stage
pkg
need
[
pkgPath
pkg
</>
dir
</>
"package-data.mk"
]
...
...
src/UserSettings.hs
View file @
5d6c2d7a
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
]
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment