Hello community,

here is the log from the commit of package ghc-inline-c for openSUSE:Factory 
checked in at 2016-11-10 13:22:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-inline-c (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-inline-c.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-inline-c"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-inline-c/ghc-inline-c.changes        
2016-11-01 09:56:54.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-inline-c.new/ghc-inline-c.changes   
2016-11-10 13:22:15.000000000 +0100
@@ -1,0 +2,15 @@
+Mon Sep 26 06:51:57 UTC 2016 - [email protected]
+
+- Update to version 0.5.5.9 with cabal2obs.
+
+-------------------------------------------------------------------
+Thu Sep 15 06:38:35 UTC 2016 - [email protected]
+
+- Update to version 0.5.5.7 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
+Mon Jul 25 11:12:43 UTC 2016 - [email protected]
+
+- Update to version 0.5.5.5 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  inline-c-0.5.5.4.tar.gz

New:
----
  inline-c-0.5.5.9.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-inline-c.spec ++++++
--- /var/tmp/diff_new_pack.YsMD1r/_old  2016-11-10 13:22:16.000000000 +0100
+++ /var/tmp/diff_new_pack.YsMD1r/_new  2016-11-10 13:22:16.000000000 +0100
@@ -19,15 +19,14 @@
 %global pkg_name inline-c
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.5.5.4
+Version:        0.5.5.9
 Release:        0
 Summary:        Write Haskell source files including C code inline. No FFI 
required
 License:        MIT
-Group:          System/Libraries
+Group:          Development/Languages/Other
 Url:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
 BuildRequires:  ghc-Cabal-devel
-# Begin cabal-rpm deps:
 BuildRequires:  ghc-QuickCheck-devel
 BuildRequires:  ghc-ansi-wl-pprint-devel
 BuildRequires:  ghc-binary-devel
@@ -51,7 +50,6 @@
 BuildRequires:  ghc-raw-strings-qq-devel
 BuildRequires:  ghc-regex-posix-devel
 %endif
-# End cabal-rpm deps
 
 %description
 See <https://github.com/fpco/inline-c/blob/master/README.md>.
@@ -70,20 +68,14 @@
 %prep
 %setup -q -n %{pkg_name}-%{version}
 
-
 %build
 %ghc_lib_build
 
-
 %install
 %ghc_lib_install
 
-
 %check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
 
 %post devel
 %ghc_pkg_recache

++++++ inline-c-0.5.5.4.tar.gz -> inline-c-0.5.5.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inline-c-0.5.5.4/changelog.md 
new/inline-c-0.5.5.9/changelog.md
--- old/inline-c-0.5.5.4/changelog.md   2016-06-15 11:26:10.000000000 +0200
+++ new/inline-c-0.5.5.9/changelog.md   2016-09-15 13:28:42.000000000 +0200
@@ -1,3 +1,5 @@
+- 0.5.5.9: Make tests work with QuickCheck < 2.9
+- 0.5.5.8: Add workaround for QuickCheck-2.9 bug. See issue #51
 - 0.5.5.2: Add docs regarding internals. See issue #41.
 - 0.5.5.1: Add support for Interruptible calls. The version skip is
   simply because I forgot to update the changelog for 0.5.5.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inline-c-0.5.5.4/inline-c.cabal 
new/inline-c-0.5.5.9/inline-c.cabal
--- old/inline-c-0.5.5.4/inline-c.cabal 2016-07-04 11:43:10.000000000 +0200
+++ new/inline-c-0.5.5.9/inline-c.cabal 2016-09-15 13:28:42.000000000 +0200
@@ -1,5 +1,5 @@
 name:                inline-c
-version:             0.5.5.4
+version:             0.5.5.9
 synopsis:            Write Haskell source files including C code inline. No 
FFI required.
 description:         See 
<https://github.com/fpco/inline-c/blob/master/README.md>.
 license:             MIT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inline-c-0.5.5.4/src/Language/C/Inline/Internal.hs 
new/inline-c-0.5.5.9/src/Language/C/Inline/Internal.hs
--- old/inline-c-0.5.5.4/src/Language/C/Inline/Internal.hs      2016-06-15 
11:26:10.000000000 +0200
+++ new/inline-c-0.5.5.9/src/Language/C/Inline/Internal.hs      2016-08-31 
11:07:53.000000000 +0200
@@ -8,6 +8,8 @@
 {-# LANGUAGE TemplateHaskell #-}
 {-# LANGUAGE TupleSections #-}
 {-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
 
 module Language.C.Inline.Internal
     ( -- * Context handling
@@ -48,7 +50,6 @@
     ) where
 
 import           Control.Applicative
-import           Control.Concurrent.MVar (MVar, newMVar, modifyMVar, readMVar)
 import           Control.Exception (catch, throwIO)
 import           Control.Monad (forM, void, msum, unless)
 import           Control.Monad.State (evalStateT, StateT, get, put)
@@ -77,6 +78,13 @@
 import qualified Text.PrettyPrint.ANSI.Leijen as PP
 import           System.Environment (getProgName)
 
+-- We cannot use getQ/putQ before 7.10.3 because of 
<https://ghc.haskell.org/trac/ghc/ticket/10596>
+#define USE_GETQ (__GLASGOW_HASKELL__ > 710 || (__GLASGOW_HASKELL__ == 710 && 
__GLASGOW_HASKELL_PATCHLEVEL1__ >= 3))
+
+#if !USE_GETQ
+import           Control.Concurrent.MVar (MVar, newMVar, modifyMVar_, readMVar)
+#endif
+
 import           Language.C.Inline.Context
 import           Language.C.Inline.FunPtr
 import           Language.C.Inline.HaskellIdentifier
@@ -85,7 +93,17 @@
 data ModuleState = ModuleState
   { msContext :: Context
   , msGeneratedNames :: Int
-  }
+  } deriving (Typeable)
+
+getModuleState :: TH.Q (Maybe ModuleState)
+putModuleState :: ModuleState -> TH.Q ()
+
+#if USE_GETQ
+
+getModuleState = TH.getQ
+putModuleState = TH.putQ
+
+#else
 
 -- | Identifier for the current module.  Currently we use the file name.
 -- Since we're pairing Haskell files with C files, it makes more sense
@@ -105,6 +123,18 @@
 moduleStatesVar :: MVar (Map.Map ModuleId ModuleState)
 moduleStatesVar = unsafePerformIO $ newMVar Map.empty
 
+getModuleState = do
+  moduleStates <- TH.runIO (readMVar moduleStatesVar)
+  moduleId <- getModuleId
+  return (Map.lookup moduleId moduleStates)
+
+putModuleState ms = do
+  moduleId <- getModuleId
+  TH.runIO (modifyMVar_ moduleStatesVar (return . Map.insert moduleId ms))
+
+#endif
+
+
 -- | Make sure that 'moduleStatesVar' and the respective C file are up
 --   to date.
 initialiseModuleState
@@ -114,20 +144,20 @@
   -> TH.Q Context
 initialiseModuleState mbContext = do
   mbcFile <- cSourceLoc context
-  thisModule <- getModuleId
-  TH.runIO $ modifyMVar moduleStatesVar $ \moduleStates -> do
-    case Map.lookup thisModule moduleStates of
-      Just moduleState -> return (moduleStates, msContext moduleState)
-      Nothing -> do
-        -- If the file exists and this is the first time we write
-        -- something from this module (in other words, if we are
-        -- recompiling the module), kill the file first.
-        forM_ mbcFile $ \cFile -> removeIfExists cFile
-        let moduleState = ModuleState
-              { msContext = context
-              , msGeneratedNames = 0
-              }
-        return (Map.insert thisModule moduleState moduleStates, context)
+  mbModuleState <- getModuleState
+  case mbModuleState of
+    Just moduleState -> return (msContext moduleState)
+    Nothing -> do
+      -- If the file exists and this is the first time we write
+      -- something from this module (in other words, if we are
+      -- recompiling the module), kill the file first.
+      TH.runIO $ forM_ mbcFile $ \cFile -> removeIfExists cFile
+      let moduleState = ModuleState
+            { msContext = context
+            , msGeneratedNames = 0
+            }
+      putModuleState moduleState
+      return context
   where
     context = fromMaybe baseCtx mbContext
 
@@ -138,13 +168,13 @@
 
 modifyModuleState :: (ModuleState -> (ModuleState, a)) -> TH.Q a
 modifyModuleState f = do
-  thisModule <- getModuleId
-  TH.runIO $ modifyMVar moduleStatesVar $ \moduleStates ->
-    case Map.lookup thisModule moduleStates of
-      Nothing -> fail "inline-c: ModuleState not present"
-      Just ms -> do
-        let (ms', x) = f ms
-        return (Map.insert thisModule ms' moduleStates, x)
+  mbModuleState <- getModuleState
+  case mbModuleState of
+    Nothing -> fail "inline-c: ModuleState not present"
+    Just ms -> do
+      let (ms', x) = f ms
+      putModuleState ms'
+      return x
 
 -- $context
 --
@@ -158,9 +188,8 @@
 -- module.  Fails if that's not the case.
 setContext :: Context -> TH.Q ()
 setContext ctx = do
-  thisModule <- getModuleId
-  moduleStates <- TH.runIO $ readMVar moduleStatesVar
-  forM_ (Map.lookup thisModule moduleStates) $ \_ms ->
+  mbModuleState <- getModuleState
+  forM_ mbModuleState $ \_ms ->
     fail "inline-c: The module has already been initialised (setContext)."
   void $ initialiseModuleState $ Just ctx
 
@@ -302,7 +331,7 @@
 --   TH.Unsafe
 --   [t| Double -> Double |]
 --   (quickCParser_ \"double\" parseType)
---   [("x", quickCParser_ \"double\") parseType]
+--   [("x", quickCParser_ \"double\" parseType)]
 --   "cos(x)")
 -- @
 inlineExp
@@ -532,14 +561,8 @@
       case parTy of
         Plain s' -> do
           hsTy <- cToHs ctx cTy
-          mbHsName <- TH.lookupValueName $ unHaskellIdentifier s'
-          hsExp <- case mbHsName of
-            Nothing -> do
-              fail $ "Cannot capture Haskell variable " ++ unHaskellIdentifier 
s' ++
-                     ", because it's not in scope. (genericQuote)"
-            Just hsName -> do
-              hsExp <- TH.varE hsName
-              [| \cont -> cont ($(return hsExp) :: $(return hsTy)) |]
+          let hsName = TH.mkName (unHaskellIdentifier s')
+          hsExp <- [| \cont -> cont ($(TH.varE hsName) :: $(return hsTy)) |]
           return (hsTy, hsExp)
         AntiQuote antiId dyn -> do
           case Map.lookup antiId (ctxAntiQuoters ctx) of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/inline-c-0.5.5.4/test/Language/C/Types/ParseSpec.hs 
new/inline-c-0.5.5.9/test/Language/C/Types/ParseSpec.hs
--- old/inline-c-0.5.5.4/test/Language/C/Types/ParseSpec.hs     2016-06-15 
11:26:10.000000000 +0200
+++ new/inline-c-0.5.5.9/test/Language/C/Types/ParseSpec.hs     2016-09-15 
13:28:42.000000000 +0200
@@ -3,6 +3,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
 
 module Language.C.Types.ParseSpec (spec) where
 
@@ -24,14 +25,22 @@
 spec :: Hspec.SpecWith ()
 spec = do
   Hspec.it "parses everything which is pretty-printable (C)" $ do
+#if MIN_VERSION_QuickCheck(2,9,0)
+    QC.property $ QC.again $ do -- Work around 
<https://github.com/nick8325/quickcheck/issues/113>
+#else
     QC.property $ do
+#endif
       ParameterDeclarationWithTypeNames typeNames ty <-
         arbitraryParameterDeclarationWithTypeNames unCIdentifier
       return $ isGoodType ty QC.==>
         let ty' = assertParse (cCParserContext typeNames) 
parameter_declaration (prettyOneLine ty)
         in Types.untangleParameterDeclaration ty == 
Types.untangleParameterDeclaration ty'
   Hspec.it "parses everything which is pretty-printable (Haskell)" $ do
+#if MIN_VERSION_QuickCheck(2,9,0)
+    QC.property $ QC.again $ do -- Work around 
<https://github.com/nick8325/quickcheck/issues/113>
+#else
     QC.property $ do
+#endif
       ParameterDeclarationWithTypeNames typeNames ty <-
         arbitraryParameterDeclarationWithTypeNames unHaskellIdentifier
       return $ isGoodType ty QC.==>


Reply via email to