aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CabalHelper/Main.hs')
-rw-r--r--CabalHelper/Main.hs18
1 files changed, 15 insertions, 3 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 59c3e91..2244859 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -47,8 +47,12 @@ import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..),
componentBuildInfo,
externalPackageDeps,
withComponentsLBI,
- withLibLBI,
- inplacePackageId)
+ withLibLBI)
+#if CABAL_MAJOR == 1 && CABAL_MINOR <= 22
+import Distribution.Simple.LocalBuildInfo (inplacePackageId)
+#else
+import Distribution.Simple.LocalBuildInfo (localComponentId)
+#endif
import Distribution.Simple.GHC (componentGhcOptions)
import Distribution.Simple.Program.GHC (GhcOptions(..), renderGhcOptions)
@@ -408,7 +412,10 @@ removeInplaceDeps v lbi pd clbi = let
libbi = libBuildInfo lib
liboutdir = componentOutDir lbi (CLib lib)
libopts = (componentGhcOptions normal lbi libbi libclbi liboutdir) {
- ghcOptPackageDBs = []
+ ghcOptPackageDBs = []
+#if CABAL_MAJOR == 1 && CABAL_MINOR > 22
+ , ghcOptComponentId = NoFlag
+#endif
}
(ideps, deps) = partition isInplaceDep (componentPackageDeps clbi)
@@ -419,7 +426,12 @@ removeInplaceDeps v lbi pd clbi = let
where
isInplaceDep :: (InstalledPackageId, PackageId) -> Bool
+#if CABAL_MAJOR == 1 && CABAL_MINOR <= 22
isInplaceDep (ipid, pid) = inplacePackageId pid == ipid
+#else
+ isInplaceDep (ipid, pid) = localComponentId lbi == ipid
+#endif
+
#if CABAL_MAJOR == 1 && CABAL_MINOR >= 22
-- >= 1.22 uses NubListR