packages feed

wxdirect 0.91.0.0 → 0.92.0.0

raw patch · 2 files changed

+22/−6 lines, 2 filesdep ~basedep ~directorydep ~filepathPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, directory, filepath, parsec, strict, time

API changes (from Hackage documentation)

Files

src/ParseC.hs view
@@ -14,8 +14,10 @@ 
 import Data.Char( isSpace )
 import Data.List( isPrefixOf )
+import Data.Maybe( isJust )
 import Data.Functor( (<$>) )
 import System.Process( readProcess )
+import System.Environment (lookupEnv)
 import Text.ParserCombinators.Parsec
 import qualified Text.ParserCombinators.Parsec.Token as P
 import Text.ParserCombinators.Parsec.Language
@@ -55,10 +57,24 @@         )
         ""
 
+readShellProcess :: FilePath -> [String] -> IO String
+readShellProcess f as = readProcess "sh" (f:as) "" 
+
+isMsys :: IO Bool
+isMsys = isJust <$> lookupEnv "MSYSTEM"
+
+deMsysPaths :: String -> IO String
+deMsysPaths s = head . lines <$> readProcess "sh" ["-c", "cd " ++ s ++ "; pwd -W"] ""
+
 getIncludeDirectories :: IO [String]
-getIncludeDirectories = 
-  filter (isPrefixOf "-I") . words <$> 
-    readProcess "wx-config" ["--cppflags"] ""
+getIncludeDirectories = do
+  im <- isMsys
+  if im
+    then readShellProcess "wx-config" ["--cppflags"] >>= 
+            mapM (fmap ("-I"++) . deMsysPaths . drop 2) . filter (isPrefixOf "-I") . words
+    else
+        filter (isPrefixOf "-I") . words <$> 
+            readProcess "wx-config" ["--cppflags"] ""
     
                       
 -- flaky, but suitable
wxdirect.cabal view
@@ -1,5 +1,5 @@ name:         wxdirect
-version:      0.91.0.0
+version:      0.92.0.0
 license:      BSD3
 license-file: LICENSE
 author:       Daan Leijen
@@ -49,8 +49,8 @@     directory,
     parsec     >= 2.1.0 && < 4,
     strict,
-    time       >= 1.0   && < 1.5,
-    filepath   <  1.4,
+    time       >= 1.0,
+    filepath   <  1.5,
     process    >= 1.1   && < 1.3
 
   if flag(splitBase)