[Git][haskell-team/DHG_packages][master] haskell-gi: Apply patch to fix #1067272

Ilias Tsitsimpis (@iliastsi) gitlab at salsa.debian.org
Sat Mar 30 15:17:58 GMT 2024



Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
51f4c675 by Ilias Tsitsimpis at 2024-03-30T17:07:22+02:00
haskell-gi: Apply patch to fix #1067272

- - - - -


5 changed files:

- p/haskell-haskell-gi/debian/changelog
- p/haskell-haskell-gi/debian/patches/7bb9bf28755ddd3ac0e01613b46f57d4532b5d36.patch
- p/haskell-haskell-gi/debian/patches/force-overloading
- + p/haskell-haskell-gi/debian/patches/parse-time_t
- p/haskell-haskell-gi/debian/patches/series


Changes:

=====================================
p/haskell-haskell-gi/debian/changelog
=====================================
@@ -1,3 +1,9 @@
+haskell-haskell-gi (0.26.7-4) unstable; urgency=medium
+
+  * Apply patch to parse time_t, off_t, etc. from GIR XML (Closes: #1067272)
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Sat, 30 Mar 2024 17:06:54 +0200
+
 haskell-haskell-gi (0.26.7-3) unstable; urgency=medium
 
   * debian/patches/7bb9bf28755ddd3ac0e01613b46f57d4532b5d36.patch:


=====================================
p/haskell-haskell-gi/debian/patches/7bb9bf28755ddd3ac0e01613b46f57d4532b5d36.patch
=====================================
@@ -9,8 +9,8 @@ Fixes #425
  lib/Data/GI/GIR/Arg.hs          | 2 ++
  2 files changed, 3 insertions(+)
 
-diff --git a/lib/Data/GI/CodeGen/Callable.hs b/lib/Data/GI/CodeGen/Callable.hs
-index 52a23c2e..60541595 100644
+Index: b/lib/Data/GI/CodeGen/Callable.hs
+===================================================================
 --- a/lib/Data/GI/CodeGen/Callable.hs
 +++ b/lib/Data/GI/CodeGen/Callable.hs
 @@ -573,6 +573,7 @@ prepareClosures callable nameMap = do
@@ -21,8 +21,8 @@ index 52a23c2e..60541595 100644
              _ -> badIntroError $ "Closure \"" <> n <> "\" is not a callback."
  
  freeCallCallbacks :: Callable -> Map.Map Text Text -> ExcCodeGen ()
-diff --git a/lib/Data/GI/GIR/Arg.hs b/lib/Data/GI/GIR/Arg.hs
-index 6d6f3792..cbe2e554 100644
+Index: b/lib/Data/GI/GIR/Arg.hs
+===================================================================
 --- a/lib/Data/GI/GIR/Arg.hs
 +++ b/lib/Data/GI/GIR/Arg.hs
 @@ -24,6 +24,7 @@ data Scope = ScopeTypeInvalid


=====================================
p/haskell-haskell-gi/debian/patches/force-overloading
=====================================
@@ -1,6 +1,8 @@
+Index: b/lib/Data/GI/CodeGen/Code.hs
+===================================================================
 --- a/lib/Data/GI/CodeGen/Code.hs
 +++ b/lib/Data/GI/CodeGen/Code.hs
-@@ -854,7 +854,7 @@
+@@ -873,7 +873,7 @@ ghcOptions opts = "{-# OPTIONS_GHC " <>
  -- | Generate some convenience CPP macros.
  cppMacros :: Text
  cppMacros = T.unlines


=====================================
p/haskell-haskell-gi/debian/patches/parse-time_t
=====================================
@@ -0,0 +1,80 @@
+Description: Parse time_t, off_t, etc. from GIR XML
+Author: Ilias Tsitsimpis <iliastsi at debian.org>
+Bug-Debian: https://bugs.debian.org/1067272
+Forwarded: https://github.com/haskell-gi/haskell-gi/pull/430
+
+Index: b/lib/Data/GI/GIR/Type.hs
+===================================================================
+--- a/lib/Data/GI/GIR/Type.hs
++++ b/lib/Data/GI/GIR/Type.hs
+@@ -15,8 +15,8 @@ import Data.Monoid ((<>))
+ import Data.Text (Text)
+ import qualified Data.Text as T
+ import Foreign.Storable (sizeOf)
+-import Foreign.C (CShort, CUShort, CSize)
+-import System.Posix.Types (CSsize)
++import Foreign.C (CShort, CUShort, CSize, CTime)
++import System.Posix.Types (CSsize, COff, CDev, CGid, CPid, CSocklen, CUid)
+ 
+ import Data.GI.GIR.BasicTypes (Type(..), BasicType(..))
+ import Data.GI.GIR.Parser
+@@ -47,26 +47,41 @@ nameToBasicType "utf8"     = Just TUTF8
+ nameToBasicType "filename" = Just TFileName
+ nameToBasicType "gintptr"  = Just TIntPtr
+ nameToBasicType "guintptr" = Just TUIntPtr
+-nameToBasicType "gshort"   = case sizeOf (0 :: CShort) of
+-                               2 -> Just TInt16
+-                               4 -> Just TInt32
+-                               8 -> Just TInt64
+-                               n -> error $ "Unexpected short size: " ++ show n
+-nameToBasicType "gushort"  = case sizeOf (0 :: CUShort) of
+-                               2 -> Just TUInt16
+-                               4 -> Just TUInt32
+-                               8 -> Just TUInt64
+-                               n -> error $ "Unexpected ushort size: " ++ show n
+-nameToBasicType "gssize"   = case sizeOf (0 :: CSsize) of
+-                               4 -> Just TInt32
+-                               8 -> Just TInt64
+-                               n -> error $ "Unexpected ssize length: " ++ show n
+-nameToBasicType "gsize"    = case sizeOf (0 :: CSize) of
+-                               4 -> Just TUInt32
+-                               8 -> Just TUInt64
+-                               n -> error $ "Unexpected size length: " ++ show n
++nameToBasicType "gshort"   =
++  Just $ intToBasicType "short" (sizeOf (0 :: CShort)) True
++nameToBasicType "gushort"  =
++  Just $ intToBasicType "ushort" (sizeOf (0 :: CUShort)) False
++nameToBasicType "gssize"   =
++  Just $ intToBasicType "ssize" (sizeOf (0 :: CSsize)) True
++nameToBasicType "gsize"    =
++  Just $ intToBasicType "size" (sizeOf (0 :: CSize)) False
++nameToBasicType n@"time_t" =
++  Just $ intToBasicType n (sizeOf (0 :: CTime)) ((-1 :: CTime) < 0)
++nameToBasicType n@"off_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: COff)) ((-1 :: COff) < 0)
++nameToBasicType n@"dev_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: CDev)) ((-1 :: CDev) < 0)
++nameToBasicType n@"gid_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: CGid)) ((-1 :: CGid) < 0)
++nameToBasicType n@"pid_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: CPid)) ((-1 :: CPid) < 0)
++nameToBasicType n@"socklen_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: CSocklen)) ((-1 :: CSocklen) < 0)
++nameToBasicType n@"uid_t"  =
++  Just $ intToBasicType n (sizeOf (0 :: CUid)) ((-1 :: CUid) < 0)
+ nameToBasicType _          = Nothing
+ 
++-- | Given the size and signedness of a C integer type, return a `BasicType`.
++intToBasicType :: Text -> Int -> Bool -> BasicType
++intToBasicType _ 2 True    = TInt16
++intToBasicType _ 4 True    = TInt32
++intToBasicType _ 8 True    = TInt64
++intToBasicType _ 2 False   = TUInt16
++intToBasicType _ 4 False   = TUInt32
++intToBasicType _ 8 False   = TUInt64
++intToBasicType name size _ =
++  error $ "Unexpected " ++ show name ++ " length: " ++ show size
++
+ -- | The different array types.
+ parseArrayInfo :: Parser Type
+ parseArrayInfo = queryAttr "name" >>= \case


=====================================
p/haskell-haskell-gi/debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 force-overloading
 7bb9bf28755ddd3ac0e01613b46f57d4532b5d36.patch
+parse-time_t



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/51f4c67522b2ab7b3ae9157ed7c81f931edfbde3

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/51f4c67522b2ab7b3ae9157ed7c81f931edfbde3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20240330/520bec7c/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list