... |
... |
@@ -24,6 +24,7 @@ packageArgs = do |
24
|
24
|
-- immediately and may lead to cyclic dependencies.
|
25
|
25
|
-- See: https://gitlab.haskell.org/ghc/ghc/issues/16809.
|
26
|
26
|
cross = flag CrossCompiling
|
|
27
|
+ haveCurses = any (/= "") <$> traverse setting [ CursesIncludeDir, CursesLibDir ]
|
27
|
28
|
|
28
|
29
|
-- Check if the bootstrap compiler has the same version as the one we
|
29
|
30
|
-- are building. This is used to build cross-compilers
|
... |
... |
@@ -85,7 +86,7 @@ packageArgs = do |
85
|
86
|
-- backends at the moment, so we might as well disable it
|
86
|
87
|
-- for cross GHC.
|
87
|
88
|
[ andM [expr (ghcWithInterpreter stage), notCross] `cabalFlag` "internal-interpreter"
|
88
|
|
- , notM cross `cabalFlag` "terminfo"
|
|
89
|
+ , orM [ notM cross, haveCurses ] `cabalFlag` "terminfo"
|
89
|
90
|
, arg "-build-tool-depends"
|
90
|
91
|
, flag UseLibzstd `cabalFlag` "with-libzstd"
|
91
|
92
|
-- ROMES: While the boot compiler is not updated wrt -this-unit-id
|
... |
... |
@@ -120,7 +121,7 @@ packageArgs = do |
120
|
121
|
|
121
|
122
|
-------------------------------- ghcPkg --------------------------------
|
122
|
123
|
, package ghcPkg ?
|
123
|
|
- builder (Cabal Flags) ? notM cross `cabalFlag` "terminfo"
|
|
124
|
+ builder (Cabal Flags) ? orM [ notM cross, haveCurses ] `cabalFlag` "terminfo"
|
124
|
125
|
|
125
|
126
|
-------------------------------- ghcBoot ------------------------------
|
126
|
127
|
, package ghcBoot ?
|
... |
... |
@@ -202,10 +203,10 @@ packageArgs = do |
202
|
203
|
, package haskeline ?
|
203
|
204
|
builder (Cabal Flags) ? arg "-examples"
|
204
|
205
|
-- Don't depend upon terminfo when cross-compiling to avoid unnecessary
|
205
|
|
- -- dependencies.
|
206
|
|
- -- TODO: Perhaps the user should rather be responsible for this?
|
|
206
|
+ -- dependencies unless the user provided ncurses explicitly.
|
|
207
|
+ -- TODO: Perhaps the user should be able to explicitly enable/disable this.
|
207
|
208
|
, package haskeline ?
|
208
|
|
- builder (Cabal Flags) ? notM cross `cabalFlag` "terminfo"
|
|
209
|
+ builder (Cabal Flags) ? orM [ notM cross, haveCurses ] `cabalFlag` "terminfo"
|
209
|
210
|
|
210
|
211
|
-------------------------------- terminfo ------------------------------
|
211
|
212
|
, package terminfo ?
|