aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-test/src')
-rw-r--r--haddock-test/src/Test/Haddock/Config.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/haddock-test/src/Test/Haddock/Config.hs b/haddock-test/src/Test/Haddock/Config.hs
index 8f1f4885..cd878178 100644
--- a/haddock-test/src/Test/Haddock/Config.hs
+++ b/haddock-test/src/Test/Haddock/Config.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE RecordWildCards #-}
-
+{-# LANGUAGE CPP #-}
module Test.Haddock.Config
( TestPackage(..), CheckConfig(..), DirConfig(..), Config(..)
@@ -218,9 +218,13 @@ baseDependencies ghcPath = do
-- consequences of unsetting it - but looks like it works (for now).
unsetEnv "GHC_PACKAGE_PATH"
- (_, _, cfg) <- configure normal (Just ghcPath) Nothing
+ (comp, _, cfg) <- configure normal (Just ghcPath) Nothing
defaultProgramConfiguration
+#if MIN_VERSION_Cabal(1,23,0)
+ pkgIndex <- getInstalledPackages normal comp [GlobalPackageDB] cfg
+#else
pkgIndex <- getInstalledPackages normal [GlobalPackageDB] cfg
+#endif
mapM (getDependency pkgIndex) ["base", "process", "ghc-prim"]
where
getDependency pkgIndex name = case ifaces pkgIndex name of