diff options
-rw-r--r-- | cabal-helper.cabal | 2 | ||||
-rw-r--r-- | src/CabalHelper/Runtime/Compat.hs | 13 | ||||
-rw-r--r-- | src/CabalHelper/Runtime/HelperMain.hs | 11 |
3 files changed, 14 insertions, 12 deletions
diff --git a/cabal-helper.cabal b/cabal-helper.cabal index 4b642e2..30f4ade 100644 --- a/cabal-helper.cabal +++ b/cabal-helper.cabal @@ -83,7 +83,7 @@ common extensions common build-deps build-depends: base < 5 && >= 4.9.1.0 - , Cabal < 3.1 && >= 3.0 + , Cabal < 3.4 && >= 3.0 || < 2.5 && >= 2.0 || < 1.26 && >= 1.24.2.0 , cabal-plan < 0.7 && >= 0.5.0.0 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 diff --git a/src/CabalHelper/Runtime/HelperMain.hs b/src/CabalHelper/Runtime/HelperMain.hs index 9c4d557..95168ec 100644 --- a/src/CabalHelper/Runtime/HelperMain.hs +++ b/src/CabalHelper/Runtime/HelperMain.hs @@ -193,12 +193,6 @@ import Distribution.Version import qualified Distribution.InstalledPackageInfo as Installed #endif -#if CH_MIN_VERSION_Cabal(2,2,0) -import Distribution.Types.GenericPackageDescription - ( unFlagAssignment - ) -#endif - import Control.Applicative ((<$>), (<*>), ZipList(..)) import Control.Arrow (first, second, (&&&)) import Control.Monad @@ -301,11 +295,8 @@ helper_main args = do "config-flags":[] -> do return $ Just $ ChResponseFlags $ sort $ map (first unFlagName) -#if CH_MIN_VERSION_Cabal(2,2,0) - $ unFlagAssignment $ configConfigurationsFlags -#else + $ unFlagAssignment $ configConfigurationsFlags -#endif $ configFlags lbi "non-default-config-flags":[] -> do |