summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2021-07-30 23:30:08 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2021-07-30 23:30:08 +0100
commitc16eca8aec2f8d32183a7c733377e84cf449a11d (patch)
tree0aef0d85e4b04c6b632064ae40e8e7762c2a41fa /dev-haskell
parentdev-haskell/reflection: drop old (diff)
downloadgentoo-c16eca8aec2f8d32183a7c733377e84cf449a11d.tar.gz
gentoo-c16eca8aec2f8d32183a7c733377e84cf449a11d.tar.bz2
gentoo-c16eca8aec2f8d32183a7c733377e84cf449a11d.zip
dev-haskell/quickcheck-classes-base: fix USE="binary-laws -unary-laws" case
Reported-by: Toralf Förster Closes: https://bugs.gentoo.org/804870 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'dev-haskell')
-rw-r--r--dev-haskell/quickcheck-classes-base/Manifest1
-rw-r--r--dev-haskell/quickcheck-classes-base/files/quickcheck-classes-base-0.6.2.0-laws.patch51
-rw-r--r--dev-haskell/quickcheck-classes-base/metadata.xml23
-rw-r--r--dev-haskell/quickcheck-classes-base/quickcheck-classes-base-0.6.2.0.ebuild36
4 files changed, 89 insertions, 22 deletions
diff --git a/dev-haskell/quickcheck-classes-base/Manifest b/dev-haskell/quickcheck-classes-base/Manifest
index 4aab9890f14a..f2a44f231837 100644
--- a/dev-haskell/quickcheck-classes-base/Manifest
+++ b/dev-haskell/quickcheck-classes-base/Manifest
@@ -1 +1,2 @@
DIST quickcheck-classes-base-0.6.0.0.tar.gz 25760 BLAKE2B d09794c63da8311836e6422006d262fca21f7d71b473b69f57bd49b3ed2e39f29fcfd18b73fd311db4f6b1cca390cc579f2438481dbd680841c835d7d0d9f557 SHA512 3d0a7c68ab1cdaddbd272df633e0704f5ee3997b3a86fe79cb960f7c84f8546f3360b9d52ada45b9db6344135f0aab1093d5304935ae19f43d235790fba83216
+DIST quickcheck-classes-base-0.6.2.0.tar.gz 26732 BLAKE2B aa3b7be411c66b72eb07c81e9fe2c1accdde254ae8e510080d7b0ea93df0148317a61633f96fe459ab329af112eee3d8243fb728f5416d95d258b90a40d1d9cf SHA512 730255f74582081e65fa8c6b36ab8a2c26991a8e7d8140361151614e7a9619f178e50820cdfc3bf5771f1688dce369f9d71de683bc89481a20f8d2382ae4b58d
diff --git a/dev-haskell/quickcheck-classes-base/files/quickcheck-classes-base-0.6.2.0-laws.patch b/dev-haskell/quickcheck-classes-base/files/quickcheck-classes-base-0.6.2.0-laws.patch
new file mode 100644
index 000000000000..f806f226a06d
--- /dev/null
+++ b/dev-haskell/quickcheck-classes-base/files/quickcheck-classes-base-0.6.2.0-laws.patch
@@ -0,0 +1,51 @@
+From b59ab822c261283004c2e87cffc653dc2b35c030 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Fri, 30 Jul 2021 23:23:19 +0100
+Subject: [PATCH] quickcheck-classes-base: move qe1_q under UNARY_LAWS define
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In https://bugs.gentoo.org/804870 Toralf noticed a build failure:
+
+```
+ $ cabal build --flags=binary-laws --flags=-unary-laws
+ Configuring quickcheck-classes-base-0.6.2.0...
+ Preprocessing library for quickcheck-classes-base-0.6.2.0..
+ Building library for quickcheck-classes-base-0.6.2.0..
+ [ 1 of 30] Compiling Test.QuickCheck.Classes.Internal ( src/Test/QuickCheck/Classes/Internal.hs, dist/build/Test/QuickCheck/Classes/Internal.o, dist/build/Test/QuickCheck/Classes/Internal.dyn_o )
+
+ src/Test/QuickCheck/Classes/Internal.hs:79:5: error:
+ Not in scope: ‘eq1_2’
+ |
+ 79 | , eq1_2
+ | ^^^^^
+```
+
+In happens due to a mismatch between export and definition #ifdef guards.
+The change fised declaration to match definition.
+
+Reported-by: Toralf Förster
+Bug: https://bugs.gentoo.org/804870
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ quickcheck-classes-base/src/Test/QuickCheck/Classes/Internal.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/Test/QuickCheck/Classes/Internal.hs
++++ b/src/Test/QuickCheck/Classes/Internal.hs
+@@ -73,10 +73,10 @@ module Test.QuickCheck.Classes.Internal
+ , isTrue#
+ #if HAVE_UNARY_LAWS
+ , eq1
++ , eq1_2
+ #endif
+ #if HAVE_BINARY_LAWS
+ , eq2
+- , eq1_2
+ #endif
+ , readMaybe
+ ) where
+--
+2.32.0
+
diff --git a/dev-haskell/quickcheck-classes-base/metadata.xml b/dev-haskell/quickcheck-classes-base/metadata.xml
index 435de9480d90..26c36c8090b5 100644
--- a/dev-haskell/quickcheck-classes-base/metadata.xml
+++ b/dev-haskell/quickcheck-classes-base/metadata.xml
@@ -6,28 +6,7 @@
<name>Gentoo Haskell</name>
</maintainer>
<use>
+ <flag name="binary-laws">Include infrastructure for testing class laws of binary type constructors. Disabling `unary-laws` while keeping `binary-laws` enabled is an unsupported configuration.</flag>
<flag name="unary-laws">Include infrastructure for testing class laws of unary type constructors.</flag>
- <flag name="binary-laws">Include infrastructure for testing class laws of binary type constructors.
-Disabling `unary-laws` while keeping `binary-laws` enabled is an unsupported
-configuration.</flag>
</use>
- <longdescription>
- This libary is a minimal variant of `quickcheck-classes` that
- only provides laws for typeclasses from `base`. The main purpose
- of splitting this out is so that `primitive` can depend on
- `quickcheck-classes-base` in its test suite, avoiding the circular
- dependency that arises if `quickcheck-classes` is used instead.
-
- This library provides QuickCheck properties to ensure
- that typeclass instances adhere to the set of laws that
- they are supposed to. There are other libraries that do
- similar things, such as `genvalidity-hspec` and `checkers`.
- This library differs from other solutions by not introducing
- any new typeclasses that the user needs to learn.
-
- /Note:/ on GHC &lt; 8.5, this library uses the higher-kinded typeclasses
- ('Data.Functor.Classes.Show1', 'Data.Functor.Classes.Eq1', 'Data.Functor.Classes.Ord1', etc.),
- but on GHC &gt;= 8.5, it uses `-XQuantifiedConstraints` to express these
- constraints more cleanly.
- </longdescription>
</pkgmetadata>
diff --git a/dev-haskell/quickcheck-classes-base/quickcheck-classes-base-0.6.2.0.ebuild b/dev-haskell/quickcheck-classes-base/quickcheck-classes-base-0.6.2.0.ebuild
new file mode 100644
index 000000000000..7bd0238e1887
--- /dev/null
+++ b/dev-haskell/quickcheck-classes-base/quickcheck-classes-base-0.6.2.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# ebuild generated by hackport 0.6.7.9999
+
+CABAL_FEATURES="lib profile haddock hoogle hscolour"
+inherit haskell-cabal
+
+DESCRIPTION="QuickCheck common typeclasses from 'base'"
+HOMEPAGE="https://github.com/andrewthad/quickcheck-classes#readme"
+SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="+binary-laws +unary-laws"
+
+RDEPEND="dev-haskell/contravariant:=[profile?]
+ >=dev-lang/ghc-8.4.3:=
+ binary-laws? ( >=dev-haskell/quickcheck-2.10.0:2=[profile?] )
+ unary-laws? ( >=dev-haskell/quickcheck-2.10.0:2=[profile?] )
+ !unary-laws? ( !binary-laws? ( >=dev-haskell/quickcheck-2.7:2=[profile?] ) )
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-2.4
+"
+
+PATCHES=("${FILESDIR}"/${P}-laws.patch)
+
+src_configure() {
+ haskell-cabal_src_configure \
+ $(cabal_flag binary-laws binary-laws) \
+ $(cabal_flag unary-laws unary-laws)
+}