Hello community, here is the log from the commit of package ghc for openSUSE:Factory checked in at 2015-12-09 19:54:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc (Old) and /work/SRC/openSUSE:Factory/.ghc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc/ghc.changes 2015-10-12 10:02:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc.new/ghc.changes 2015-12-09 22:16:46.000000000 +0100 @@ -1,0 +2,13 @@ +Mon Dec 7 14:18:50 UTC 2015 - mimi...@gmail.com + +- update Cabal to 1.22.5.0 +* Don't recompile C sources unless needed +* Support Haddock response files. +* Add frameworks when linking a dynamic library. + +------------------------------------------------------------------- +Tue Dec 1 08:26:43 UTC 2015 - mimi...@gmail.com + +- use upstream variant of remove-cur_term-usage.patch + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc.spec ++++++ --- /var/tmp/diff_new_pack.WeZXGj/_old 2015-12-09 22:16:48.000000000 +0100 +++ /var/tmp/diff_new_pack.WeZXGj/_new 2015-12-09 22:16:48.000000000 +0100 @@ -72,7 +72,7 @@ Patch19: 0001-implement-native-code-generator-for-ppc64.patch # PATCH-FIX-UPSTREAM ghc.git-b29f20.patch peter.tromm...@ohm-hochschule.de -- nativeGen PPC: fix > 16 bit offsets in stack handling. This is a backport of my patch for Haskell trac #7830. We do not use erikd's patch because we have 64 bit native code generation for ppc64[le]. See patch 19. Patch20: ghc.git-b29f20.patch -# PATCH-FIX-OPENSUSE sbahl...@suse.com -- remove-cur_term-usage.patch openSUSE's ncurses6 doesn't export cur_term function +# PATCH-FIX-UPSTREAM judah.jacob...@gmail.com, sbahl...@suse.com -- remove-cur_term-usage.patch openSUSE's ncurses6 doesn't export cur_term function Patch24: remove-cur_term-usage.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -120,7 +120,7 @@ %global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release} %if %{defined ghclibdir} -%ghc_lib_subpackage Cabal 1.22.4.0 +%ghc_lib_subpackage Cabal 1.22.5.0 %ghc_lib_subpackage array 0.5.1.0 %ghc_lib_subpackage -c gmp-devel,libffi-devel base 4.8.1.0 %ghc_lib_subpackage binary 0.7.5.0 ++++++ ghc-7.10.2-src.tar.xz ++++++ /work/SRC/openSUSE:Factory/ghc/ghc-7.10.2-src.tar.xz /work/SRC/openSUSE:Factory/.ghc.new/ghc-7.10.2-src.tar.xz differ: char 26, line 1 ++++++ remove-cur_term-usage.patch ++++++ --- /var/tmp/diff_new_pack.WeZXGj/_old 2015-12-09 22:16:48.000000000 +0100 +++ /var/tmp/diff_new_pack.WeZXGj/_new 2015-12-09 22:16:48.000000000 +0100 @@ -1,63 +1,41 @@ -Subject: Remove use of cur_term global struct -From: Scott Bahling sbahl...@suse.com -Date: 2015-10-04 +From 96455041834b54f86482741d940a7941c53cd01e Mon Sep 17 00:00:00 2001 +From: Judah Jacobson <judah.jacob...@gmail.com> +Date: Mon, 30 Nov 2015 23:28:27 -0800 +Subject: [PATCH] Use set_curterm instead of peek/poking curterm directly. -With the move to ncurses6, it has been decided by the openSUSE -developer to build the library in threaded mode only. In threaded -mode, the global variables are protected and not exported. +This fixes the build of GHC on openSUSE, which builds ncurses in "threaded" +mode. (Threaded ncurses hides the cur_term global from use). -ghc-terminfo was accessing (reading and writing) the cur_term -global so it doesn't work with the openSUSE threaded ncurses6 -library. This is an attempt to remove the need to access cur_term -and rely only on the low-level functions. - -First, cur_term was being set to a null pointer in order to force -ncurses setupterm() to return new struct instead of a copy of the -current when the terminal name is the same. Actually (and unfortunately) -setupterm() does not return the struct but rather set the global cur_term. -Reading the ncurses code, and the NEWS file, it appears that the -behavior of setupterm() had been changed quite some time ago, and no -longer returns a copy of the struct (internal 'reuse' option) (NEWS 20041127). -The code seems to confirm this, so setting cur_term to a null pointer -shouldn't really be required - we remove poke cur_term! - -That's great, but the we still have the problem that setupterm() doesn't -return the terminal struct that is required later to setup the -cleanup routine of the Terminal type (del_curterm cterm). The only -function that appears to return the cur_term pointer is set_curterm() -which has the side effect of overwriting the current pointer in the -process :/ So, we call set_curterm() with a null pointer, retrieving -the former, cur_term pointer for our use in the cterm instance, and -then call set_curterm() again with the former pointer to set it -back again.... whew! Having looked at the ncurses set_curterm() code -it seems it handles a null pointer in the way we would need. - -Later in the withCurTerm function we use virtually the same trick -to relieve the need to peek into the cur_term global. I'm not so -sure if this is Haskell correct code though. - -Someone with more Haskell programming knowledge than me should review -this patch. It still needs to be tested as well. +Patch originally by Scott Bahling <sbahl...@suse.com>. +We also mark set_cuterm as an "unsafe" FFI call since this change may cause +it to be called more often. --- -diff -Nrup a/libraries/terminfo/System/Console/Terminfo/Base.hs b/libraries/terminfo/System/Console/Terminfo/Base.hs ---- a/libraries/terminfo/System/Console/Terminfo/Base.hs 2015-02-25 06:13:15.000000000 +0100 -+++ b/libraries/terminfo/System/Console/Terminfo/Base.hs 2015-10-03 21:40:09.106028237 +0200 -@@ -63,7 +63,6 @@ import Data.Typeable + libraries/terminfo/System/Console/Terminfo/Base.hs | 28 ++++++++++------------------ + 1 file changed, 10 insertions(+), 18 deletions(-) + +diff --git a/libraries/terminfo/System/Console/Terminfo/Base.hs b/System/Console/Terminfo/Base.hs +index 1f60679..719bb65 100644 +--- a/libraries/terminfo/System/Console/Terminfo/Base.hs ++++ b/libraries/terminfo/System/Console/Terminfo/Base.hs +@@ -63,8 +63,8 @@ import Data.Typeable data TERMINAL newtype Terminal = Terminal (ForeignPtr TERMINAL) -foreign import ccall "&" cur_term :: Ptr (Ptr TERMINAL) - foreign import ccall set_curterm :: Ptr TERMINAL -> IO (Ptr TERMINAL) +-foreign import ccall set_curterm :: Ptr TERMINAL -> IO (Ptr TERMINAL) ++-- Use "unsafe" to make set_curterm faster since it's called quite a bit. ++foreign import ccall unsafe set_curterm :: Ptr TERMINAL -> IO (Ptr TERMINAL) foreign import ccall "&" del_curterm :: FunPtr (Ptr TERMINAL -> IO ()) -@@ -73,19 +72,12 @@ foreign import ccall setupterm :: CStrin + foreign import ccall setupterm :: CString -> CInt -> Ptr CInt -> IO () +@@ -73,19 +73,15 @@ foreign import ccall setupterm :: CString -> CInt -> Ptr CInt -> IO () -- -- Throws a 'SetupTermError' if the terminfo database could not be read. setupTerm :: String -> IO Terminal -setupTerm term = bracket (peek cur_term) (poke cur_term) $ \_ -> -- withCString term $ \c_term -> -+setupTerm term = withCString term $ \c_term -> ++setupTerm term = + withCString term $ \c_term -> with 0 $ \ret_ptr -> do -- NOTE: I believe that for the way we use terminfo -- (i.e. custom output function) @@ -69,24 +47,21 @@ - when calling del_term on a struct shared by more than one - Terminal. --} - poke cur_term nullPtr ++ -- Save the previous terminal to be restored after calling setupterm. ++ old_term <- set_curterm nullPtr -- Call setupterm and check the return value. setupterm c_term stdOutput ret_ptr ret <- peek ret_ptr -@@ -93,7 +85,12 @@ setupTerm term = bracket (peek cur_term) +@@ -93,7 +89,7 @@ setupTerm term = bracket (peek cur_term) (poke cur_term) $ \_ -> then throwIO $ SetupTermError $ "Couldn't look up terminfo entry " ++ show term else do - cterm <- peek cur_term -+ -- There is no function to simply return the cur_term pointer. -+ -- We call set_curterm with nullPtr which will give us -+ -- the value of the old cur_term and then we set it back -+ -- again. -+ cterm <- set_curterm nullPtr -+ set_curterm cterm ++ cterm <- set_curterm old_term fmap Terminal $ newForeignPtr del_curterm cterm data SetupTermError = SetupTermError String -@@ -120,15 +117,10 @@ setupTermFromEnv = do +@@ -120,14 +116,10 @@ setupTermFromEnv = do -- TODO: this isn't really thread-safe... withCurTerm :: Terminal -> IO a -> IO a withCurTerm (Terminal term) f = withForeignPtr term $ \cterm -> do @@ -98,11 +73,10 @@ - _ <- set_curterm old_term - return x - else f -- + old_term <- set_curterm cterm + x <- f + set_curterm old_term + return x - ---------------------- + ----------------------