1 |
commit: c16eca8aec2f8d32183a7c733377e84cf449a11d |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 30 22:30:08 2021 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 30 22:30:08 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c16eca8a |
7 |
|
8 |
dev-haskell/quickcheck-classes-base: fix USE="binary-laws -unary-laws" case |
9 |
|
10 |
Reported-by: Toralf Förster |
11 |
Closes: https://bugs.gentoo.org/804870 |
12 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
dev-haskell/quickcheck-classes-base/Manifest | 1 + |
16 |
.../quickcheck-classes-base-0.6.2.0-laws.patch | 51 ++++++++++++++++++++++ |
17 |
dev-haskell/quickcheck-classes-base/metadata.xml | 23 +--------- |
18 |
.../quickcheck-classes-base-0.6.2.0.ebuild | 36 +++++++++++++++ |
19 |
4 files changed, 89 insertions(+), 22 deletions(-) |
20 |
|
21 |
diff --git a/dev-haskell/quickcheck-classes-base/Manifest b/dev-haskell/quickcheck-classes-base/Manifest |
22 |
index 4aab9890f14..f2a44f23183 100644 |
23 |
--- a/dev-haskell/quickcheck-classes-base/Manifest |
24 |
+++ b/dev-haskell/quickcheck-classes-base/Manifest |
25 |
@@ -1 +1,2 @@ |
26 |
DIST quickcheck-classes-base-0.6.0.0.tar.gz 25760 BLAKE2B d09794c63da8311836e6422006d262fca21f7d71b473b69f57bd49b3ed2e39f29fcfd18b73fd311db4f6b1cca390cc579f2438481dbd680841c835d7d0d9f557 SHA512 3d0a7c68ab1cdaddbd272df633e0704f5ee3997b3a86fe79cb960f7c84f8546f3360b9d52ada45b9db6344135f0aab1093d5304935ae19f43d235790fba83216 |
27 |
+DIST quickcheck-classes-base-0.6.2.0.tar.gz 26732 BLAKE2B aa3b7be411c66b72eb07c81e9fe2c1accdde254ae8e510080d7b0ea93df0148317a61633f96fe459ab329af112eee3d8243fb728f5416d95d258b90a40d1d9cf SHA512 730255f74582081e65fa8c6b36ab8a2c26991a8e7d8140361151614e7a9619f178e50820cdfc3bf5771f1688dce369f9d71de683bc89481a20f8d2382ae4b58d |
28 |
|
29 |
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 |
30 |
new file mode 100644 |
31 |
index 00000000000..f806f226a06 |
32 |
--- /dev/null |
33 |
+++ b/dev-haskell/quickcheck-classes-base/files/quickcheck-classes-base-0.6.2.0-laws.patch |
34 |
@@ -0,0 +1,51 @@ |
35 |
+From b59ab822c261283004c2e87cffc653dc2b35c030 Mon Sep 17 00:00:00 2001 |
36 |
+From: Sergei Trofimovich <slyfox@g.o> |
37 |
+Date: Fri, 30 Jul 2021 23:23:19 +0100 |
38 |
+Subject: [PATCH] quickcheck-classes-base: move qe1_q under UNARY_LAWS define |
39 |
+MIME-Version: 1.0 |
40 |
+Content-Type: text/plain; charset=UTF-8 |
41 |
+Content-Transfer-Encoding: 8bit |
42 |
+ |
43 |
+In https://bugs.gentoo.org/804870 Toralf noticed a build failure: |
44 |
+ |
45 |
+``` |
46 |
+ $ cabal build --flags=binary-laws --flags=-unary-laws |
47 |
+ Configuring quickcheck-classes-base-0.6.2.0... |
48 |
+ Preprocessing library for quickcheck-classes-base-0.6.2.0.. |
49 |
+ Building library for quickcheck-classes-base-0.6.2.0.. |
50 |
+ [ 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 ) |
51 |
+ |
52 |
+ src/Test/QuickCheck/Classes/Internal.hs:79:5: error: |
53 |
+ Not in scope: ‘eq1_2’ |
54 |
+ | |
55 |
+ 79 | , eq1_2 |
56 |
+ | ^^^^^ |
57 |
+``` |
58 |
+ |
59 |
+In happens due to a mismatch between export and definition #ifdef guards. |
60 |
+The change fised declaration to match definition. |
61 |
+ |
62 |
+Reported-by: Toralf Förster |
63 |
+Bug: https://bugs.gentoo.org/804870 |
64 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
65 |
+--- |
66 |
+ quickcheck-classes-base/src/Test/QuickCheck/Classes/Internal.hs | 2 +- |
67 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
68 |
+ |
69 |
+--- a/src/Test/QuickCheck/Classes/Internal.hs |
70 |
++++ b/src/Test/QuickCheck/Classes/Internal.hs |
71 |
+@@ -73,10 +73,10 @@ module Test.QuickCheck.Classes.Internal |
72 |
+ , isTrue# |
73 |
+ #if HAVE_UNARY_LAWS |
74 |
+ , eq1 |
75 |
++ , eq1_2 |
76 |
+ #endif |
77 |
+ #if HAVE_BINARY_LAWS |
78 |
+ , eq2 |
79 |
+- , eq1_2 |
80 |
+ #endif |
81 |
+ , readMaybe |
82 |
+ ) where |
83 |
+-- |
84 |
+2.32.0 |
85 |
+ |
86 |
|
87 |
diff --git a/dev-haskell/quickcheck-classes-base/metadata.xml b/dev-haskell/quickcheck-classes-base/metadata.xml |
88 |
index 435de9480d9..26c36c8090b 100644 |
89 |
--- a/dev-haskell/quickcheck-classes-base/metadata.xml |
90 |
+++ b/dev-haskell/quickcheck-classes-base/metadata.xml |
91 |
@@ -6,28 +6,7 @@ |
92 |
<name>Gentoo Haskell</name> |
93 |
</maintainer> |
94 |
<use> |
95 |
+ <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> |
96 |
<flag name="unary-laws">Include infrastructure for testing class laws of unary type constructors.</flag> |
97 |
- <flag name="binary-laws">Include infrastructure for testing class laws of binary type constructors. |
98 |
-Disabling `unary-laws` while keeping `binary-laws` enabled is an unsupported |
99 |
-configuration.</flag> |
100 |
</use> |
101 |
- <longdescription> |
102 |
- This libary is a minimal variant of `quickcheck-classes` that |
103 |
- only provides laws for typeclasses from `base`. The main purpose |
104 |
- of splitting this out is so that `primitive` can depend on |
105 |
- `quickcheck-classes-base` in its test suite, avoiding the circular |
106 |
- dependency that arises if `quickcheck-classes` is used instead. |
107 |
- |
108 |
- This library provides QuickCheck properties to ensure |
109 |
- that typeclass instances adhere to the set of laws that |
110 |
- they are supposed to. There are other libraries that do |
111 |
- similar things, such as `genvalidity-hspec` and `checkers`. |
112 |
- This library differs from other solutions by not introducing |
113 |
- any new typeclasses that the user needs to learn. |
114 |
- |
115 |
- /Note:/ on GHC < 8.5, this library uses the higher-kinded typeclasses |
116 |
- ('Data.Functor.Classes.Show1', 'Data.Functor.Classes.Eq1', 'Data.Functor.Classes.Ord1', etc.), |
117 |
- but on GHC >= 8.5, it uses `-XQuantifiedConstraints` to express these |
118 |
- constraints more cleanly. |
119 |
- </longdescription> |
120 |
</pkgmetadata> |
121 |
|
122 |
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 |
123 |
new file mode 100644 |
124 |
index 00000000000..7bd0238e188 |
125 |
--- /dev/null |
126 |
+++ b/dev-haskell/quickcheck-classes-base/quickcheck-classes-base-0.6.2.0.ebuild |
127 |
@@ -0,0 +1,36 @@ |
128 |
+# Copyright 1999-2021 Gentoo Authors |
129 |
+# Distributed under the terms of the GNU General Public License v2 |
130 |
+ |
131 |
+EAPI=7 |
132 |
+ |
133 |
+# ebuild generated by hackport 0.6.7.9999 |
134 |
+ |
135 |
+CABAL_FEATURES="lib profile haddock hoogle hscolour" |
136 |
+inherit haskell-cabal |
137 |
+ |
138 |
+DESCRIPTION="QuickCheck common typeclasses from 'base'" |
139 |
+HOMEPAGE="https://github.com/andrewthad/quickcheck-classes#readme" |
140 |
+SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz" |
141 |
+ |
142 |
+LICENSE="BSD" |
143 |
+SLOT="0/${PV}" |
144 |
+KEYWORDS="~amd64 ~x86" |
145 |
+IUSE="+binary-laws +unary-laws" |
146 |
+ |
147 |
+RDEPEND="dev-haskell/contravariant:=[profile?] |
148 |
+ >=dev-lang/ghc-8.4.3:= |
149 |
+ binary-laws? ( >=dev-haskell/quickcheck-2.10.0:2=[profile?] ) |
150 |
+ unary-laws? ( >=dev-haskell/quickcheck-2.10.0:2=[profile?] ) |
151 |
+ !unary-laws? ( !binary-laws? ( >=dev-haskell/quickcheck-2.7:2=[profile?] ) ) |
152 |
+" |
153 |
+DEPEND="${RDEPEND} |
154 |
+ >=dev-haskell/cabal-2.4 |
155 |
+" |
156 |
+ |
157 |
+PATCHES=("${FILESDIR}"/${P}-laws.patch) |
158 |
+ |
159 |
+src_configure() { |
160 |
+ haskell-cabal_src_configure \ |
161 |
+ $(cabal_flag binary-laws binary-laws) \ |
162 |
+ $(cabal_flag unary-laws unary-laws) |
163 |
+} |