aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Runtime/Main.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2017-12-01 15:38:08 +0200
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commit70db4d93c48565bebeade5845d5d8c55fbc19e7a (patch)
tree14fe5802019b417f7415b642e5fb2483274c0af1 /src/CabalHelper/Runtime/Main.hs
parent080a503271592babe0957ff37300d02fddff1e8f (diff)
Update as per @DanielG comments
Diffstat (limited to 'src/CabalHelper/Runtime/Main.hs')
-rw-r--r--src/CabalHelper/Runtime/Main.hs42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/CabalHelper/Runtime/Main.hs b/src/CabalHelper/Runtime/Main.hs
index 2e5108a..0ef826a 100644
--- a/src/CabalHelper/Runtime/Main.hs
+++ b/src/CabalHelper/Runtime/Main.hs
@@ -19,9 +19,7 @@
#undef CH_MIN_VERSION_Cabal
#define CH_MIN_VERSION_Cabal MIN_VERSION_Cabal
#endif
-#if CH_MIN_VERSION_Cabal(2,0,0)
-import Distribution.Backpack (OpenUnitId(..))
-#endif
+
import Distribution.Simple.Utils (cabalVersion)
import Distribution.Simple.Configure
import Distribution.Package
@@ -108,17 +106,6 @@ import qualified Distribution.ModuleName as C
import Distribution.Text
( display
)
-#if CH_MIN_VERSION_Cabal(2,0,0)
-import Distribution.Types.ModuleRenaming
- ( ModuleRenaming(..)
- )
-import Distribution.Types.UnitId
- ( DefUnitId
- )
-import Distribution.Utils.NubList
- ( toNubListR
- )
-#endif
import Distribution.Verbosity
( Verbosity
, silent
@@ -162,16 +149,26 @@ import Distribution.Types.UnqualComponentName
#if CH_MIN_VERSION_Cabal(2,0,0)
-- CPP >= 2.0
-import Distribution.Version
- ( versionNumbers
- , mkVersion
+import Distribution.Backpack (OpenUnitId(..))
+import Distribution.Types.ModuleRenaming
+ ( ModuleRenaming(..)
+ )
+import Distribution.Types.MungedPackageId
+ ( MungedPackageId
)
import Distribution.Types.UnitId
( UnitId
, unDefUnitId
)
-import Distribution.Types.MungedPackageId
- ( MungedPackageId
+import Distribution.Types.UnitId
+ ( DefUnitId
+ )
+import Distribution.Utils.NubList
+ ( toNubListR
+ )
+import Distribution.Version
+ ( versionNumbers
+ , mkVersion
)
#endif
@@ -503,10 +500,9 @@ removeInplaceDeps :: Verbosity
removeInplaceDeps _v lbi pd clbi includeDirs = let
removeInplace c =
let
- (ideps, deps) = partition (isInplaceDep lbi c) (componentPackageDeps c)
- (_, incs) = partition (isInplaceCompInc c) (componentIncludes c)
+ (ideps, incs) = partition (isInplaceCompInc c) (componentIncludes c)
hasIdeps' = not $ null ideps
- c' = c { componentPackageDeps = deps
+ c' = c { componentPackageDeps = error "using deprecated field:componentPackageDeps"
, componentInternalDeps = []
, componentIncludes = incs }
in (hasIdeps',c')
@@ -646,7 +642,7 @@ componentEntrypoints (CLib Library {..})
(map gmModuleName $ otherModules libBuildInfo)
#if CH_MIN_VERSION_Cabal(2,0,0)
componentEntrypoints (CFLib (ForeignLib{..}))
- = error $ "componentEntrypoints:Need to process ForeignLib Component"
+ = ChLibEntrypoint [] []
#endif
componentEntrypoints (CExe Executable {..})
= ChExeEntrypoint modulePath (map gmModuleName $ otherModules buildInfo)