aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-08-03 03:56:19 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-08-03 04:43:14 +0200
commitc80fc646ccb4e1f19cc40ebbb319de2211c21a2a (patch)
treeaf7f594c83c39069238827bc9218d884a1341c7f /CabalHelper
parent268d4210fed6d986b8bf9a45b167e03c8cab01c8 (diff)
Fix *-inplace dependencies in ghc-merged-pkg-options output
Diffstat (limited to 'CabalHelper')
-rw-r--r--CabalHelper/Main.hs17
1 files changed, 6 insertions, 11 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 2b6aea3..9d08b71 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -201,17 +201,11 @@ main = do
"ghc-merged-pkg-options":flags -> do
let pd = localPkgDescr lbi
- res <- mconcat . map snd <$> (componentsMap lbi v distdir $ \c clbi bi -> let
- outdir = componentOutDir lbi c
- opts = componentGhcOptions normal lbi bi clbi outdir
- comp = compiler lbi
- opts' = mempty {
+ res <- mconcat . map snd <$> (componentOptions' lvd True flags (\_ _ o -> return o) $ \opts -> mempty {
ghcOptPackageDBs = ghcOptPackageDBs opts,
ghcOptPackages = ghcOptPackages opts,
ghcOptHideAllPackages = ghcOptHideAllPackages opts
- }
-
- in return opts')
+ })
let res' = res { ghcOptPackageDBs = nub $ ghcOptPackageDBs res }
@@ -286,7 +280,7 @@ componentsMap lbi v distdir f = do
reverse <$> readIORef lr
-componentOptions (lbi, v, distdir) inplaceFlag flags f = do
+componentOptions' (lbi, v, distdir) inplaceFlag flags rf f = do
let pd = localPkgDescr lbi
componentsMap lbi v distdir $ \c clbi bi -> let
outdir = componentOutDir lbi c
@@ -295,11 +289,12 @@ componentOptions (lbi, v, distdir) inplaceFlag flags f = do
["--with-inplace"] -> (clbi, mempty)
[] -> removeInplaceDeps v lbi pd clbi
opts = componentGhcOptions normal lbi bi clbi' outdir
- comp = compiler lbi
opts' = f opts
- in renderGhcOptions' lbi v $ opts' `mappend` adopts
+ in rf lbi v $ opts' `mappend` adopts
+componentOptions (lbi, v, distdir) inplaceFlag flags f =
+ componentOptions' (lbi, v, distdir) inplaceFlag flags renderGhcOptions' f
componentNameToCh CLibName = ChLibName
componentNameToCh (CExeName n) = ChExeName n