tag 516277 + patch
thanks

The attached patch fixes the build of alex.  It incorporates Ruben
Molina's change, which was already made upstream, along with another
upstream change to Main.hs required to allow alex to build.

It also includes some required changes to get_version.hs.

-- 
Matt                                                 http://ftbfs.org/
diff -ru alex-2.2~/debian/get_version.hs alex-2.2/debian/get_version.hs
--- alex-2.2~/debian/get_version.hs     2009-02-24 20:34:01.000000000 -0800
+++ alex-2.2/debian/get_version.hs      2009-02-24 20:52:49.000000000 -0800
@@ -1,14 +1,16 @@
 
 module Main (main) where
 
+import Data.Version ( showVersion )
 import Distribution.Package
 import Distribution.PackageDescription
+import Distribution.PackageDescription.Parse ( readPackageDescription )
 import Distribution.Simple.Utils
 import Distribution.Verbosity
 import Distribution.Version
 
 main :: IO ()
-main = do fp <- findPackageDesc normal "."
+main = do fp <- findPackageDesc "."
           pd <- readPackageDescription normal fp
           putStr $ showVersion $ pkgVersion $ package $ packageDescription pd
 
diff -ru alex-2.2~/Setup.lhs alex-2.2/Setup.lhs
--- alex-2.2~/Setup.lhs 2009-02-24 20:34:01.000000000 -0800
+++ alex-2.2/Setup.lhs  2009-02-24 20:34:16.000000000 -0800
@@ -4,7 +4,7 @@
 module Main where
 
 import Distribution.PackageDescription (PackageDescription(..))
-import Distribution.Simple.Setup ( BuildFlags(..) )
+import Distribution.Simple.Setup ( BuildFlags(..), buildVerbose )
 import Distribution.Simple ( defaultMainWithHooks, defaultUserHooks, 
UserHooks(..) )
 import Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..) )
 import Distribution.Simple.Program
diff -ru alex-2.2~/src/Main.hs alex-2.2/src/Main.hs
--- alex-2.2~/src/Main.hs       2009-02-24 20:34:01.000000000 -0800
+++ alex-2.2/src/Main.hs        2009-02-24 21:00:17.000000000 -0800
@@ -22,6 +22,9 @@
 import Paths_alex ( version, getDataDir )
 
 import Control.Exception as Exception ( block, unblock, catch, throw )
+#if __GLASGOW_HASKELL__ >= 610
+import Control.Exception ( bracketOnError )
+#endif
 import Control.Monad ( when, liftM )
 import Data.Char ( chr )
 import Data.List ( isSuffixOf )
@@ -303,6 +306,7 @@
 dieAlex :: String -> IO a
 dieAlex s = getProgramName >>= \prog -> die (prog ++ ": " ++ s)
 
+#if __GLASGOW_HASKELL__ < 610
 bracketOnError
        :: IO a         -- ^ computation to run first (\"acquire resource\")
        -> (a -> IO b)  -- ^ computation to run last (\"release resource\")
@@ -316,3 +320,4 @@
           (\e -> do { after a; throw e })
     return r
  )
+#endif

Reply via email to