summaryrefslogtreecommitdiff
blob: 86d523b362f18b940609a8b2a75539bc765e0fcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- a/Setup.hs
+++ b/Setup.hs
@@ -22,2 +22,3 @@ import Distribution.Simple.Setup ( BuildFlags, ConfigFlags
 import Distribution.Simple.Utils (installOrdinaryFile, rawSystemExitWithEnv, rawSystemStdInOut, die)
+import qualified Distribution.Simple.Utils as DSU
 import Distribution.System (OS (..), Arch (..), buildOS, buildArch)
@@ -81,3 +82,9 @@ rawShellSystemStdInOut :: Verbosity                     -- Verbosity level
                        -> IO (String, String, ExitCode) -- (Command result, Errors, Command exit status)
+#if MIN_VERSION_Cabal(2,2,0)
+rawShellSystemStdInOut v f as = do
+  (~(DSU.IODataText so), se, c) <- rawSystemStdInOut v "sh" (f:as) Nothing Nothing Nothing DSU.IODataModeText
+  return (so, se, c)
+#else
 rawShellSystemStdInOut v f as = rawSystemStdInOut v "sh" (f:as) Nothing Nothing Nothing False
+#endif
 
@@ -438,3 +445,7 @@ deMsysPaths bi = do
         let cor ph = do
+#if MIN_VERSION_Cabal(2,2,0)
+            (~(DSU.IODataText r), e, c) <- rawSystemStdInOut normal "sh" ["-c", "cd " ++ ph ++ "; pwd -W"] Nothing Nothing Nothing DSU.IODataModeText
+#else
             (r, e, c ) <- rawSystemStdInOut normal "sh" ["-c", "cd " ++ ph ++ "; pwd -W"] Nothing Nothing Nothing False
+#endif
             unless (c == ExitSuccess) (putStrLn ("Error: failed to convert MSYS path to native path \n" ++ e) >> exitFailure)
@@ -504,3 +515,7 @@ sharedLibName ver basename =
         where
+#if MIN_VERSION_Cabal(2,2,0)
+          full_ver = (concat . intersperse "." . map show . versionNumbers) ver
+#else
           full_ver = (concat . intersperse "." . map show . versionBranch) ver
+#endif