aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Runtime/Compat.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-12-28 23:46:41 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-12-29 16:35:59 +0100
commit0c284ed48bd1a531807f5e524894766de8d179bd (patch)
treec9f741fdb5cf0732511899e7d1c1f969057a3cab /src/CabalHelper/Runtime/Compat.hs
parent6fc491ce84b41939d8080cff56c3a5c98cb7e1df (diff)
Fix Cabal HEAD
Diffstat (limited to 'src/CabalHelper/Runtime/Compat.hs')
-rw-r--r--src/CabalHelper/Runtime/Compat.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/CabalHelper/Runtime/Compat.hs b/src/CabalHelper/Runtime/Compat.hs
index 3582766..27b53be 100644
--- a/src/CabalHelper/Runtime/Compat.hs
+++ b/src/CabalHelper/Runtime/Compat.hs
@@ -25,6 +25,7 @@ module CabalHelper.Runtime.Compat
, componentNameFromComponent
, componentOutDir
, internalPackageDBPath
+ , unFlagAssignment
) where
import System.FilePath
@@ -124,10 +125,16 @@ import Distribution.Version
import qualified Distribution.InstalledPackageInfo as Installed
#endif
-#if CH_MIN_VERSION_Cabal(2,2,0)
+#if CH_MIN_VERSION_Cabal(3,3,0)
+import Distribution.Types.Flag
+ ( unFlagAssignment
+ )
+#elif CH_MIN_VERSION_Cabal(2,2,0)
import Distribution.Types.GenericPackageDescription
( unFlagAssignment
)
+#else
+#define NOP_UN_FLAG_ASSIGNMENT 1
#endif
#if CH_MIN_VERSION_Cabal(2,5,0)
@@ -226,3 +233,7 @@ internalPackageDBPath :: LocalBuildInfo -> FilePath -> FilePath
internalPackageDBPath lbi distPref =
distPref </> "package.conf.inplace"
#endif
+
+#ifdef NOP_UN_FLAG_ASSIGNMENT
+unFlagAssignment = id
+#endif