Merge remote-tracking branch 'prezi/master'

Conflicts:
	Language/Haskell/GhcMod/CabalHelper.hs
This commit is contained in:
Daniel Gröber
2015-05-20 11:37:17 +02:00
7 changed files with 70 additions and 3 deletions

View File

@@ -102,13 +102,20 @@ withCabal action = do
opts <- options
liftIO $ whenM (isSetupConfigOutOfDate <$> getCurrentWorld crdl) $
withDirectory_ (cradleRootDir crdl) $ do
let progOpts =
let pkgDbArgs = "--package-db=clear" : map pkgDbArg (cradlePkgDbStack crdl)
progOpts =
[ "--with-ghc=" ++ T.ghcProgram opts ]
-- Only pass ghc-pkg if it was actually set otherwise we
-- might break cabal's guessing logic
++ if T.ghcPkgProgram opts /= T.ghcPkgProgram defaultOptions
then [ "--with-ghc-pkg=" ++ T.ghcPkgProgram opts ]
else []
++ pkgDbArgs
void $ readProcess (T.cabalProgram opts) ("configure":progOpts) ""
writeAutogenFiles $ cradleRootDir crdl </> "dist"
action
pkgDbArg :: GhcPkgDb -> String
pkgDbArg GlobalDb = "--package-db=global"
pkgDbArg UserDb = "--package-db=user"
pkgDbArg (PackageDb p) = "--package-db=" ++ p