diff --git a/307.patch b/307.patch new file mode 100644 index 0000000..16d4043 --- /dev/null +++ b/307.patch @@ -0,0 +1,30 @@ +From 7b94c5ac957cfa9d51815747d48dbec2d57a9aaa Mon Sep 17 00:00:00 2001 +From: Jakub Janczak +Date: Wed, 8 Feb 2023 21:33:24 +0100 +Subject: [PATCH] Fix for machines with 64bit word and base >= 4.17 + +--- + cborg/src/Codec/CBOR/Magic.hs | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/cborg/src/Codec/CBOR/Magic.hs b/cborg/src/Codec/CBOR/Magic.hs +index 1b497a2..cdeb455 100644 +--- a/cborg/src/Codec/CBOR/Magic.hs ++++ b/cborg/src/Codec/CBOR/Magic.hs +@@ -257,11 +257,15 @@ grabWord64 (Ptr ip#) = + #endif + + #if WORD_SIZE_IN_BITS == 64 ++#if MIN_VERSION_base(4,17,0) ++-- case taken from Codec.CBOR.Decoding ++ w64 w# = W64# (wordToWord64# (toWord w#)) ++#else + w64 w# = W64# (toWord w#) ++#endif + #else + w64 w# = W64# (wordToWord64# (toWord w#)) + #endif +- + #endif + + -------------------------------------------------------------------------------- diff --git a/ghc-cborg.spec b/ghc-cborg.spec index 7f2bb51..bc0a10e 100644 --- a/ghc-cborg.spec +++ b/ghc-cborg.spec @@ -20,6 +20,7 @@ Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz Source1: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal # End cabal-rpm sources +Patch0: https://patch-diff.githubusercontent.com/raw/well-typed/cborg/pull/307.patch # Begin cabal-rpm deps: BuildRequires: dos2unix @@ -117,6 +118,7 @@ This package provides the Haskell %{pkg_name} profiling library. %setup -q -n %{pkgver} dos2unix -k -n %{SOURCE1} %{pkg_name}.cabal # End cabal-rpm setup +%patch0 -p2 -b .orig %build