aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper/Main.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-08-21 06:34:09 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-08-21 09:26:08 +0200
commitc7aba0dbaaf7889e2cc653bf203e4b046b9a5029 (patch)
tree9049c995cd4e512ead627b3df45201669d1f6ecd /CabalHelper/Main.hs
parentaf90d1aed4227033bfc657278067a5cbcff8226c (diff)
Factor helper compilation into seperate module for testing
Diffstat (limited to 'CabalHelper/Main.hs')
-rw-r--r--CabalHelper/Main.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 5f5690b..dec3dfd 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -81,7 +81,7 @@ import Text.Printf
import CabalHelper.Sandbox
import CabalHelper.Common
-import CabalHelper.Types
+import CabalHelper.Types hiding (Options(..))
usage = do
prog <- getProgName
@@ -201,10 +201,9 @@ main = do
ghcOptPackages = ghcOptPackages opts
})
- let res' = res { ghcOptPackageDBs = withPackageDB lbi
- , ghcOptHideAllPackages = Flag True
- , ghcOptPackages = nub $ ghcOptPackages res
- }
+ let res' = nubPackageFlags $ res { ghcOptPackageDBs = withPackageDB lbi
+ , ghcOptHideAllPackages = Flag True
+ }
Just . ChResponseList <$> renderGhcOptions' lbi v res'
@@ -375,7 +374,12 @@ removeInplaceDeps v lbi pd clbi = let
isInplaceDep :: (InstalledPackageId, PackageId) -> Bool
isInplaceDep (ipid, pid) = inplacePackageId pid == ipid
+#if CABAL_MAJOR == 1 && CABAL_MINOR >= 22
+-- >= 1.22 uses NubListR
+nubPackageFlags opts = opts
+#else
nubPackageFlags opts = opts { ghcOptPackages = nub $ ghcOptPackages opts }
+#endif
renderGhcOptions' lbi v opts = do
#if CABAL_MAJOR == 1 && CABAL_MINOR < 20