diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CabalHelper/Compiletime/Compat/ProgramDb.hs | 1 | ||||
-rw-r--r-- | src/CabalHelper/Shared/Common.hs | 24 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/CabalHelper/Compiletime/Compat/ProgramDb.hs b/src/CabalHelper/Compiletime/Compat/ProgramDb.hs index 56b033c..eb0f26d 100644 --- a/src/CabalHelper/Compiletime/Compat/ProgramDb.hs +++ b/src/CabalHelper/Compiletime/Compat/ProgramDb.hs @@ -26,5 +26,6 @@ module CabalHelper.Compiletime.Compat.ProgramDb import Distribution.Simple.Program #if !MIN_VERSION_Cabal(2,0,0) +defaultProgramDb :: ProgramConfiguration defaultProgramDb = defaultProgramConfiguration #endif diff --git a/src/CabalHelper/Shared/Common.hs b/src/CabalHelper/Shared/Common.hs index a7e7377..1f0c49e 100644 --- a/src/CabalHelper/Shared/Common.hs +++ b/src/CabalHelper/Shared/Common.hs @@ -28,6 +28,19 @@ module CabalHelper.Shared.Common where #define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal #endif +import Distribution.PackageDescription + ( GenericPackageDescription + ) +import Distribution.Verbosity + ( Verbosity + ) + +#if CH_MIN_VERSION_Cabal(2,2,0) +import qualified Distribution.PackageDescription.Parsec as P +#else +import qualified Distribution.PackageDescription.Parse as P +#endif + import Control.Applicative import Control.Exception as E import Control.Monad @@ -39,11 +52,6 @@ import Data.Typeable import Data.ByteString (ByteString) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BS8 -#if CH_MIN_VERSION_Cabal(2,2,0) -import qualified Distribution.PackageDescription.Parsec as P -#else -import qualified Distribution.PackageDescription.Parse as P -#endif import System.Environment import System.IO import qualified System.Info @@ -143,7 +151,11 @@ replace n r hs' = go "" hs' go acc [] = reverse acc -#if CH_MIN_VERSION_Cabal(2,2,0) +readPackageDescription + :: Verbosity + -> FilePath + -> IO GenericPackageDescription +#if CH_MIN_VERSION_Cabal(2,0,0) readPackageDescription = P.readGenericPackageDescription #else readPackageDescription = P.readPackageDescription |