From edb3feb49d7d87365abac961368367944d85022d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 20 Dec 2015 00:59:51 +0100 Subject: test: Compatibility with Cabal 1.23 --- haddock-test/src/Test/Haddock/Config.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'haddock-test') 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 -- cgit v1.2.3