[Pkg-haskell-commits] [package-plan] 01/01: Import HGL patches

Joachim Breitner nomeata at moszumanska.debian.org
Thu Jul 10 20:21:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to branch master
in repository package-plan.

commit 76ba656a77d2493399f6feeb68db63f2d1780f87
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Jul 10 22:21:12 2014 +0200

    Import HGL patches
---
 packages.txt                                |  2 +-
 patches/HGL/3.2.0.2/00-cabal-rules.patch    | 16 +++++++
 patches/HGL/3.2.0.2/01-new-exceptions.patch | 33 +++++++++++++++
 patches/HGL/3.2.0.2/02-exceptions.patch     | 65 +++++++++++++++++++++++++++++
 patches/HGL/3.2.0.2/03-channel.patch        | 46 ++++++++++++++++++++
 patches/HGL/3.2.0.2/series                  |  4 ++
 6 files changed, 165 insertions(+), 1 deletion(-)

diff --git a/packages.txt b/packages.txt
index 51f0913..13c7ba2 100644
--- a/packages.txt
+++ b/packages.txt
@@ -284,7 +284,7 @@ hedis 0.6.2
 heist 0.13.1
 HFuse 0.2.4.1
 hgettext 0.1.30
-HGL 3.2.0.2 patched
+HGL 3.2.0.2
 highlighting-kate 0.5.8.2 -fpcre-light
 hinotify 0.3.5
 hint 0.3.3.6
diff --git a/patches/HGL/3.2.0.2/00-cabal-rules.patch b/patches/HGL/3.2.0.2/00-cabal-rules.patch
new file mode 100644
index 0000000..c05876c
--- /dev/null
+++ b/patches/HGL/3.2.0.2/00-cabal-rules.patch
@@ -0,0 +1,16 @@
+Description: Change cabal file to include proper dependencies for
+ building with GHC 7.4.
+Forwarded: yes
+Author: Ernesto Hernández-Novich (USB) <emhn at usb.ve>
+
+--- a/HGL.cabal
++++ b/HGL.cabal
+@@ -22,7 +22,7 @@
+ 
+ library
+   if flag(split-base)
+-    build-depends: base >= 3 && < 4, array
++    build-depends: base >= 3, array, stm
+   else
+     build-depends: base < 2
+   exposed-modules:
diff --git a/patches/HGL/3.2.0.2/01-new-exceptions.patch b/patches/HGL/3.2.0.2/01-new-exceptions.patch
new file mode 100644
index 0000000..667de2d
--- /dev/null
+++ b/patches/HGL/3.2.0.2/01-new-exceptions.patch
@@ -0,0 +1,33 @@
+Description: Convert old-style try/catch to new-style Control.Exception
+ style. This gets rids of several compilation warnings. I left this
+ patch separate because I removed an #ifdef and am not sure if this is
+ the best way to solve the issue.
+Forwarded: yes
+Author: Ernesto Hernández-Novich <emhn at usb.ve>
+
+--- a/Graphics/HGL/Internals/Utilities.hs
++++ b/Graphics/HGL/Internals/Utilities.hs
+@@ -20,7 +20,7 @@
+         modMVar, modMVar_
+ 	) where
+ 
+-import qualified Control.Exception as E (bracket, try, IOException, tryJust, ioErrors)
++import qualified Control.Exception as E (bracket, try, IOException, tryJust)
+ import Control.Concurrent( MVar, takeMVar, putMVar )
+ 
+ bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
+@@ -32,14 +32,7 @@
+ 
+ type Exception = E.IOException
+ safeTry :: IO a -> IO (Either Exception a)
+-
+-#if __GLASGOW_HASKELL >= 610 
+--- ghc-6.10
+ safeTry = E.try
+-#else
+--- ghc 6.8 (and below?)
+-safeTry = E.tryJust E.ioErrors
+-#endif
+ 
+ 
+ ----------------------------------------------------------------
diff --git a/patches/HGL/3.2.0.2/02-exceptions.patch b/patches/HGL/3.2.0.2/02-exceptions.patch
new file mode 100644
index 0000000..8d527e0
--- /dev/null
+++ b/patches/HGL/3.2.0.2/02-exceptions.patch
@@ -0,0 +1,65 @@
+Description: Convert old-style try/catch to new-style Control.Exception
+ style. This gets rids of several compilation warnings.
+Forwarded: yes
+Author: Ernesto Hernández-Novich <emhn at usb.ve>
+
+--- a/Graphics/HGL/X11/Display.hs
++++ b/Graphics/HGL/X11/Display.hs
+@@ -1,3 +1,5 @@
++{-# LANGUAGE ScopedTypeVariables #-}
++
+ -- #hide
+ module Graphics.HGL.X11.Display
+ 	( getDisplayName
+@@ -14,12 +16,13 @@
+ import Control.Monad (when)
+ import Data.Maybe (isJust)
+ import System.Environment (getEnv)
+-import System.IO.Error (try)
+ import System.IO.Unsafe (unsafePerformIO)
+ 
++import qualified Control.Exception as CE
++
+ getDisplayName :: IO String
+ getDisplayName = do
+-  disp <- try (getEnv "DISPLAY")
++  disp <- CE.try (getEnv "DISPLAY") :: IO (Either CE.IOException String)
+   return (either (const ":0.0") id disp)
+ 
+ displayRef :: MVar (Maybe X.Display)
+@@ -32,8 +35,9 @@
+   openDisplay'
+  where
+   openDisplay' = do      
+-    display <- X.openDisplay host `catch` \ err -> 
+-                 ioError (userError ("Unable to open X display " ++ host))
++    display <- X.openDisplay host
++               `CE.catch`
++               (\(e :: CE.SomeException) -> ioError $ userError $ "Unable to open X display " ++ host)
+     modMVar displayRef (const $ Just display)
+     return display
+ 
+--- a/Graphics/HGL/X11/Types.hs
++++ b/Graphics/HGL/X11/Types.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE ScopedTypeVariables #-}
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module      :  Graphics.HGL.X11.Types
+@@ -26,6 +27,7 @@
+ import Graphics.HGL.Internals.Types
+ 
+ import qualified Graphics.X11.Xlib as X
++import qualified Control.Exception as CE
+ 
+ import Control.Concurrent.MVar (MVar)
+ import Data.Bits
+@@ -84,7 +86,7 @@
+   (X.Color p _ _ _ _) <-
+       X.allocColor display color_map (X.Color 0 r g b xcolor_flags)
+   return p)
+-     `catch` \ err -> 
++     `CE.catch` \(err :: CE.SomeException) ->
+                print err >> return 0
+ --	       ioError (userError ("Error: " ++ show err
+ --			      ++ "\nUnable to allocate colo[u]r " ++ show (r,g,b) 
diff --git a/patches/HGL/3.2.0.2/03-channel.patch b/patches/HGL/3.2.0.2/03-channel.patch
new file mode 100644
index 0000000..1022a08
--- /dev/null
+++ b/patches/HGL/3.2.0.2/03-channel.patch
@@ -0,0 +1,46 @@
+Description: Stop using Control.Concurrent.Chan and migrate to the
+ more modern Control.Concurrent.STM.TChan. Migration was triggered
+ by the fact that the library needs isEmptyChan and GHC 7.4 suggest
+ using STM's version instead.
+Forwarded: yes
+Author: Ernesto Hernández-Novich (USB) <emhn at usb.ve>
+
+--- a/Graphics/HGL/Internals/Events.hs
++++ b/Graphics/HGL/Internals/Events.hs
+@@ -20,7 +20,8 @@
+ 
+ import Graphics.HGL.Internals.Event
+ import Graphics.HGL.Internals.Flag
+-import Control.Concurrent.Chan(Chan, newChan, readChan, writeChan, isEmptyChan)
++import Control.Concurrent.STM (atomically)
++import Control.Concurrent.STM.TChan (TChan, newTChan, readTChan, writeTChan, isEmptyTChan)
+ 
+ ----------------------------------------------------------------
+ -- Interface
+@@ -37,7 +38,7 @@
+ -- of the Graphics library).  Exposure events in X11 behave in a
+ -- similar way except that they do not overtake other events.)
+ 
+-data Events = Events { events :: Chan Event
++data Events = Events { events :: TChan Event
+                      , tick   :: Flag ()
+                      }
+ 
+@@ -53,13 +54,13 @@
+ ----------------------------------------------------------------
+ 
+ newEvents = do
+-  events <- newChan 
++  events <- atomically $ newTChan
+   tick   <- newFlag
+   return (Events { events=events, tick=tick })
+ 
+-getEvent  evs = readChan    (events evs)
+-isNoEvent evs = isEmptyChan (events evs)
+-sendEvent evs = writeChan   (events evs)
++getEvent  evs = atomically $ readTChan    (events evs)
++isNoEvent evs = atomically $ isEmptyTChan (events evs)
++sendEvent evs = atomically . writeTChan   (events evs)
+ sendTick  evs = setFlag     (tick evs) ()
+ getTick   evs = resetFlag   (tick evs)
+ 
diff --git a/patches/HGL/3.2.0.2/series b/patches/HGL/3.2.0.2/series
new file mode 100644
index 0000000..15f9378
--- /dev/null
+++ b/patches/HGL/3.2.0.2/series
@@ -0,0 +1,4 @@
+00-cabal-rules.patch
+01-new-exceptions.patch
+02-exceptions.patch
+03-channel.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/package-plan.git



More information about the Pkg-haskell-commits mailing list