From 16518d811d72c87bda42a0048f9ff50ffa601d82 Mon Sep 17 00:00:00 2001 From: hololeap Date: Mon, 16 Oct 2023 21:17:04 -0600 Subject: dev-haskell/vector: Patch for Float TestData This is required for tests to pass with newer versions of QuickCheck. Signed-off-by: hololeap Signed-off-by: Sam James --- .../files/vector-0.12.3.1-fix-testdata-float.patch | 42 ++++++++++++++++++++++ dev-haskell/vector/vector-0.12.3.1-r1.ebuild | 1 + dev-haskell/vector/vector-0.12.3.1.ebuild | 6 +++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 dev-haskell/vector/files/vector-0.12.3.1-fix-testdata-float.patch (limited to 'dev-haskell') 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 +Date: Sun, 4 Jun 2023 17:55:28 +0100 +Bug: https://github.com/haskell/vector/pull/461 +Signed-off-by: hololeap +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-lang/ghc-8.4.3:= -- cgit v1.2.3-65-gdbad