summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhololeap <hololeap@protonmail.com>2023-10-16 21:17:04 -0600
committerSam James <sam@gentoo.org>2023-10-23 04:10:25 +0100
commit16518d811d72c87bda42a0048f9ff50ffa601d82 (patch)
treee0147e0d3bdba29a63c8d5b61f47d15680317742 /dev-haskell
parentdev-haskell/vector: Migrate to CABAL_CHDEPS (diff)
downloadgentoo-16518d811d72c87bda42a0048f9ff50ffa601d82.tar.gz
gentoo-16518d811d72c87bda42a0048f9ff50ffa601d82.tar.bz2
gentoo-16518d811d72c87bda42a0048f9ff50ffa601d82.zip
dev-haskell/vector: Patch for Float TestData
This is required for tests to pass with newer versions of QuickCheck. Signed-off-by: hololeap <hololeap@protonmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell')
-rw-r--r--dev-haskell/vector/files/vector-0.12.3.1-fix-testdata-float.patch42
-rw-r--r--dev-haskell/vector/vector-0.12.3.1-r1.ebuild1
-rw-r--r--dev-haskell/vector/vector-0.12.3.1.ebuild6
3 files changed, 48 insertions, 1 deletions
diff --git a/dev-haskell/vector/files/vector-0.12.3.1-fix-testdata-float.patch b/dev-haskell/vector/files/vector-0.12.3.1-fix-testdata-float.patch
new file mode 100644
index 000000000000..8a8db580f225
--- /dev/null
+++ b/dev-haskell/vector/files/vector-0.12.3.1-fix-testdata-float.patch
@@ -0,0 +1,42 @@
+From df8dd8e8e84005aa6b187b03cd502f3c6e18cf3c Mon Sep 17 00:00:00 2001
+From: Bodigrim <andrew.lelechenko@gmail.com>
+Date: Sun, 4 Jun 2023 17:55:28 +0100
+Bug: https://github.com/haskell/vector/pull/461
+Signed-off-by: hololeap <hololeap@protonmail.com>
+Subject: [PATCH] Fix instance TestData Float/Double
+
+---
+ vector/tests/Utilities.hs | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/vector/tests/Utilities.hs b/vector/tests/Utilities.hs
+index 24799554..ae19d425 100644
+--- a/tests/Utilities.hs
++++ b/tests/Utilities.hs
+@@ -121,10 +121,24 @@ instance TestData ty where { \
+ id_TestData(())
+ id_TestData(Bool)
+ id_TestData(Int)
+-id_TestData(Float)
+-id_TestData(Double)
+ id_TestData(Ordering)
+
++instance TestData Float where
++ type Model Float = Float
++ model = id
++ unmodel = id
++
++ type EqTest Float = Property
++ equal x y = property (x == y || (isNaN x && isNaN y))
++
++instance TestData Double where
++ type Model Double = Double
++ model = id
++ unmodel = id
++
++ type EqTest Double = Property
++ equal x y = property (x == y || (isNaN x && isNaN y))
++
+ bimapEither :: (a -> b) -> (c -> d) -> Either a c -> Either b d
+ bimapEither f _ (Left a) = Left (f a)
+ bimapEither _ g (Right c) = Right (g c)
diff --git a/dev-haskell/vector/vector-0.12.3.1-r1.ebuild b/dev-haskell/vector/vector-0.12.3.1-r1.ebuild
index 4cf6adb680e4..23f7fd1c6530 100644
--- a/dev-haskell/vector/vector-0.12.3.1-r1.ebuild
+++ b/dev-haskell/vector/vector-0.12.3.1-r1.ebuild
@@ -21,6 +21,7 @@ IUSE="+boundschecks internalchecks unsafechecks"
PATCHES=(
"${FILESDIR}/${PN}-0.12.3.1-disable-doctests.patch"
+ "${FILESDIR}/${PN}-0.12.3.1-fix-testdata-float.patch"
)
RDEPEND="
diff --git a/dev-haskell/vector/vector-0.12.3.1.ebuild b/dev-haskell/vector/vector-0.12.3.1.ebuild
index 156029e20ec1..5608e0226ed9 100644
--- a/dev-haskell/vector/vector-0.12.3.1.ebuild
+++ b/dev-haskell/vector/vector-0.12.3.1.ebuild
@@ -24,7 +24,11 @@ SLOT="0/${PV}"
KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv ~x86"
IUSE="+boundschecks internalchecks unsafechecks"
-PATCHES=( "${FILESDIR}/${PN}-0.12.3.1-cabal-doctest.patch" )
+PATCHES=(
+ "${FILESDIR}/${PN}-0.12.3.1-cabal-doctest.patch"
+ "${FILESDIR}/${PN}-0.12.3.1-fix-testdata-float.patch"
+
+)
RDEPEND=">=dev-haskell/primitive-0.6.4.0:=[profile?] <dev-haskell/primitive-0.8:=[profile?]
>=dev-lang/ghc-8.4.3:=