1 |
commit: baad1564153376068bc6dbe9c3289c912640b172 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 31 18:27:35 2015 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 31 18:27:35 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=baad1564 |
7 |
|
8 |
dev-haskell/asn1-encoding: workaround test failures on 32-bit systems |
9 |
|
10 |
On 32-bit systems Hourglass silently breaks dates |
11 |
out of range '1970 +- 68' years due to use of |
12 |
'time_t' and 'gmtime_r' from installed libc. |
13 |
|
14 |
Workaround test failures by not testing times out of this range. |
15 |
|
16 |
Github-bug: https://github.com/vincenthz/hs-hourglass/issues/21 |
17 |
Github-bug: https://github.com/vincenthz/hs-asn1/issues/12 |
18 |
|
19 |
Package-Manager: portage-2.2.20 |
20 |
|
21 |
.../asn1-encoding/asn1-encoding-0.9.0.ebuild | 6 +++++- |
22 |
.../files/asn1-encoding-0.9.0-32bit-tests.patch | 24 ++++++++++++++++++++++ |
23 |
2 files changed, 29 insertions(+), 1 deletion(-) |
24 |
|
25 |
diff --git a/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild b/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild |
26 |
index 48aeaf7..cc2e59c 100644 |
27 |
--- a/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild |
28 |
+++ b/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild |
29 |
@@ -1,4 +1,4 @@ |
30 |
-# Copyright 1999-2014 Gentoo Foundation |
31 |
+# Copyright 1999-2015 Gentoo Foundation |
32 |
# Distributed under the terms of the GNU General Public License v2 |
33 |
# $Id$ |
34 |
|
35 |
@@ -29,3 +29,7 @@ DEPEND="${RDEPEND} |
36 |
dev-haskell/tasty-quickcheck |
37 |
dev-haskell/text ) |
38 |
" |
39 |
+ |
40 |
+src_prepare() { |
41 |
+ epatch "${FILESDIR}"/${P}-32bit-tests.patch |
42 |
+} |
43 |
|
44 |
diff --git a/dev-haskell/asn1-encoding/files/asn1-encoding-0.9.0-32bit-tests.patch b/dev-haskell/asn1-encoding/files/asn1-encoding-0.9.0-32bit-tests.patch |
45 |
new file mode 100644 |
46 |
index 0000000..2b45be9 |
47 |
--- /dev/null |
48 |
+++ b/dev-haskell/asn1-encoding/files/asn1-encoding-0.9.0-32bit-tests.patch |
49 |
@@ -0,0 +1,24 @@ |
50 |
+On 32-bit systems Hourglass silently breaks dates |
51 |
+out of range '1970 +- 68' years due to use of |
52 |
+'time_t' and 'gmtime_r' from installed libc. |
53 |
+ |
54 |
+Workaround test failures by not testing times out of this range. |
55 |
+ |
56 |
+Github-bug: https://github.com/vincenthz/hs-hourglass/issues/21 |
57 |
+Github-bug: https://github.com/vincenthz/hs-asn1/issues/12 |
58 |
+diff --git a/tests/Tests.hs b/tests/Tests.hs |
59 |
+index 5a82ec9..525de82 100644 |
60 |
+--- a/tests/Tests.hs |
61 |
++++ b/tests/Tests.hs |
62 |
+@@ -88,7 +88,10 @@ instance Arbitrary BitArray where |
63 |
+ |
64 |
+ instance Arbitrary Date where |
65 |
+ arbitrary = do |
66 |
+- y <- choose (1951, 2050) |
67 |
++ -- 2037 and not 2050 |
68 |
++ -- due to a limitation of 'timeConvert' on 32-bit systems: |
69 |
++ -- https://github.com/vincenthz/hs-hourglass/issues/21 |
70 |
++ y <- choose (1951, 2037) |
71 |
+ m <- elements [ January .. December] |
72 |
+ d <- choose (1, 30) |
73 |
+ return $ normalizeDate $ Date y m d |