on master help sign in
Fix Windows
d348ef4Hamish Mackenzie
jsaddle-webkit2gtk/jsaddle-webkit2gtk.cabal+4−2
@@ -1,5 +1,5 @@
1name: jsaddle-webkit2gtk
1name: jsaddle-webkit2gtk
2−version: 0.8.2.0
2+version: 0.8.2.1
3cabal-version: >=1.10
3cabal-version: >=1.10
4build-type: Simple
4build-type: Simple
5license: MIT
5license: MIT
@@ -38,8 +38,10 @@ library
38 haskell-gi-base >=0.20 && <0.21,
38 haskell-gi-base >=0.20 && <0.21,
39 jsaddle >=0.8.0.0 && <0.9,
39 jsaddle >=0.8.0.0 && <0.9,
40 text >=1.2.1.3 && <1.3,
40 text >=1.2.1.3 && <1.3,
41− unix >=2.3.1.0 && <2.8,
42 webkit2gtk3-javascriptcore >=0.14.0.0 && <0.15
41 webkit2gtk3-javascriptcore >=0.14.0.0 && <0.15
42+ if !os(windows)
43+ build-depends:
44+ unix >=2.3.1.0 && <2.8
43 default-language: Haskell2010
45 default-language: Haskell2010
44 hs-source-dirs: src
46 hs-source-dirs: src
45 ghc-options: -ferror-spans -Wall
47 ghc-options: -ferror-spans -Wall
jsaddle-webkit2gtk/src/Language/Javascript/JSaddle/WebKitGTK.hs+6
@@ -34,7 +34,9 @@ import Control.Monad (void)
34import Control.Monad.IO.Class (MonadIO(..), MonadIO)
34import Control.Monad.IO.Class (MonadIO(..), MonadIO)
35import Control.Concurrent (forkIO, yield)
35import Control.Concurrent (forkIO, yield)
36
36
37+#ifndef mingw32_HOST_OS
37import System.Posix.Signals (installHandler, keyboardSignal, Handler(Catch))
38import System.Posix.Signals (installHandler, keyboardSignal, Handler(Catch))
39+#endif
38import System.Directory (getCurrentDirectory)
40import System.Directory (getCurrentDirectory)
39
41
40import Data.Monoid ((<>))
42import Data.Monoid ((<>))
@@ -94,7 +96,11 @@ quitWebView wv = postGUIAsync $ do w <- widgetGetToplevel wv --TODO: Shouldn't t
94 widgetDestroy w
96 widgetDestroy w
95
97
96installQuitHandler :: WebView -> IO ()
98installQuitHandler :: WebView -> IO ()
99+#ifdef mingw32_HOST_OS
100+installQuitHandler wv = return () -- TODO: Maybe figure something out here for Windows users.
101+#else
97installQuitHandler wv = void $ installHandler keyboardSignal (Catch (quitWebView wv)) Nothing
102installQuitHandler wv = void $ installHandler keyboardSignal (Catch (quitWebView wv)) Nothing
103+#endif
98
104
99postGUIAsync :: IO () -> IO ()
105postGUIAsync :: IO () -> IO ()
100postGUIAsync action =
106postGUIAsync action =
jsaddle-webkitgtk/jsaddle-webkitgtk.cabal+4−2
@@ -1,5 +1,5 @@
1name: jsaddle-webkitgtk
1name: jsaddle-webkitgtk
2−version: 0.8.2.0
2+version: 0.8.2.1
3cabal-version: >=1.10
3cabal-version: >=1.10
4build-type: Simple
4build-type: Simple
5license: MIT
5license: MIT
@@ -34,8 +34,10 @@ library
34 haskell-gi-base >=0.20 && <0.21,
34 haskell-gi-base >=0.20 && <0.21,
35 jsaddle >=0.8.0.0 && <0.9,
35 jsaddle >=0.8.0.0 && <0.9,
36 text >=1.2.1.3 && <1.3,
36 text >=1.2.1.3 && <1.3,
37− unix >=2.3.1.0 && <2.8,
38 webkitgtk3-javascriptcore >=0.14.0.0 && <0.15
37 webkitgtk3-javascriptcore >=0.14.0.0 && <0.15
38+ if !os(windows)
39+ build-depends:
40+ unix >=2.3.1.0 && <2.8
39 default-language: Haskell2010
41 default-language: Haskell2010
40 hs-source-dirs: src
42 hs-source-dirs: src
41 ghc-options: -ferror-spans -Wall
43 ghc-options: -ferror-spans -Wall
jsaddle-webkitgtk/src/Language/Javascript/JSaddle/WebKitGTK.hs+7−2
@@ -35,8 +35,9 @@ import qualified Control.Exception as E (catch)
35import Control.Exception (SomeException(..))
35import Control.Exception (SomeException(..))
36import Control.Concurrent (forkIO, yield)
36import Control.Concurrent (forkIO, yield)
37
37
38+#ifndef mingw32_HOST_OS
38−import System.Posix.Signals
39+import System.Posix.Signals (installHandler, keyboardSignal, Handler(Catch))
39− (Handler(..), keyboardSignal, installHandler)
40+#endif
40import System.Directory (getCurrentDirectory)
41import System.Directory (getCurrentDirectory)
41
42
42import Data.Monoid ((<>))
43import Data.Monoid ((<>))
@@ -95,7 +96,11 @@ quitWebView wv = postGUIAsync $ do w <- widgetGetToplevel wv --TODO: Shouldn't t
95 widgetDestroy w
96 widgetDestroy w
96
97
97installQuitHandler :: WebView -> IO ()
98installQuitHandler :: WebView -> IO ()
99+#ifdef mingw32_HOST_OS
100+installQuitHandler wv = return () -- TODO: Maybe figure something out here for Windows users.
101+#else
98installQuitHandler wv = void $ installHandler keyboardSignal (Catch (quitWebView wv)) Nothing
102installQuitHandler wv = void $ installHandler keyboardSignal (Catch (quitWebView wv)) Nothing
103+#endif
99
104
100postGUIAsync :: IO () -> IO ()
105postGUIAsync :: IO () -> IO ()
101postGUIAsync action =
106postGUIAsync action =