aboutsummaryrefslogtreecommitdiff
path: root/haddock-test
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-12-20 00:59:51 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-20 00:59:51 +0100
commitedb3feb49d7d87365abac961368367944d85022d (patch)
tree20d0cd5b6a5016e1c46be603e062c3c0f94a74ab /haddock-test
parent1555134703d5b1bb832361abf276fd651eff398c (diff)
test: Compatibility with Cabal 1.23
Diffstat (limited to 'haddock-test')
-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