guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/09: gnu: ghc-persistent: Fix build on i686-linux.


From: guix-commits
Subject: 07/09: gnu: ghc-persistent: Fix build on i686-linux.
Date: Wed, 15 Nov 2023 11:04:19 -0500 (EST)

efraim pushed a commit to branch mesa-updates
in repository guix.

commit 59fdbbb7171f0370c0ef089bccea81db320cd27c
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Nov 15 13:35:50 2023 +0200

    gnu: ghc-persistent: Fix build on i686-linux.
    
    * gnu/packages/haskell-xyz.scm (ghc-persistent)[source]: Add patch.
    * gnu/packages/patches/ghc-persistent-fix-32bit.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    
    Change-Id: I1b2c8419f3136d6c9df772d7c7abdc83a80d6112
---
 gnu/local.mk                                       |  1 +
 gnu/packages/haskell-xyz.scm                       |  3 ++-
 .../patches/ghc-persistent-fix-32bit.patch         | 25 ++++++++++++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a46d569684..d250816999 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1273,6 +1273,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/ghc-bytestring-handle-ghc9.patch        \
   %D%/packages/patches/ghc-language-haskell-extract-ghc-8.10.patch     \
   %D%/packages/patches/ghc-memory-fix-32bit.patch              \
+  %D%/packages/patches/ghc-persistent-fix-32bit.patch          \
   %D%/packages/patches/ghostscript-CVE-2023-36664.patch                \
   %D%/packages/patches/ghostscript-CVE-2023-36664-fixup.patch  \
   %D%/packages/patches/ghostscript-leptonica-hurd.patch                \
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index cf4172e590..0dd5a0922c 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -8895,7 +8895,8 @@ numbers")
               (uri (hackage-uri "persistent" version))
               (sha256
                (base32
-                "0z69yvk0rd29dp5qdhi4p587b891y90azrzzpa3g10cxp3gyywvm"))))
+                "0z69yvk0rd29dp5qdhi4p587b891y90azrzzpa3g10cxp3gyywvm"))
+              (patches (search-patches "ghc-persistent-fix-32bit.patch"))))
     (build-system haskell-build-system)
     (properties '((upstream-name . "persistent")))
     (inputs (list ghc-conduit
diff --git a/gnu/packages/patches/ghc-persistent-fix-32bit.patch 
b/gnu/packages/patches/ghc-persistent-fix-32bit.patch
new file mode 100644
index 0000000000..d0aace2445
--- /dev/null
+++ b/gnu/packages/patches/ghc-persistent-fix-32bit.patch
@@ -0,0 +1,25 @@
+https://sources.debian.org/data/main/h/haskell-persistent/2.13.3.5-2/debian/patches/fix-tests-32-bit
+Inspired by: https://github.com/yesodweb/persistent/pull/1429
+
+--- a/test/Database/Persist/THSpec.hs
++++ b/test/Database/Persist/THSpec.hs
+@@ -25,6 +25,7 @@ module Database.Persist.THSpec where
+ 
+ import Control.Applicative (Const(..))
+ import Data.Aeson (decode, encode)
++import Data.Bits (bitSizeMaybe)
+ import Data.ByteString.Lazy.Char8 ()
+ import Data.Coerce
+ import Data.Functor.Identity (Identity(..))
+@@ -237,7 +238,10 @@ spec = describe "THSpec" $ do
+         it "should have usual haskell name" $ do
+             fieldHaskell `shouldBe` FieldNameHS "Id"
+         it "should have correct underlying sql type" $ do
+-            fieldSqlType `shouldBe` SqlInt64
++            fieldSqlType `shouldBe`
++                if bitSizeMaybe (0 :: Int) <= Just 32
++                    then SqlInt32
++                    else SqlInt64
+         it "should have correct haskell type" $ do
+             fieldType `shouldBe` FTTypeCon Nothing "Int"
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]