commit:     baad1564153376068bc6dbe9c3289c912640b172
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 31 18:27:35 2015 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Aug 31 18:27:35 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=baad1564

dev-haskell/asn1-encoding: workaround test failures on 32-bit systems

On 32-bit systems Hourglass silently breaks dates
out of range '1970 +- 68' years due to use of
'time_t' and 'gmtime_r' from installed libc.

Workaround test failures by not testing times out of this range.

Github-bug: https://github.com/vincenthz/hs-hourglass/issues/21
Github-bug: https://github.com/vincenthz/hs-asn1/issues/12

Package-Manager: portage-2.2.20

 .../asn1-encoding/asn1-encoding-0.9.0.ebuild       |  6 +++++-
 .../files/asn1-encoding-0.9.0-32bit-tests.patch    | 24 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild 
b/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild
index 48aeaf7..cc2e59c 100644
--- a/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild
+++ b/dev-haskell/asn1-encoding/asn1-encoding-0.9.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -29,3 +29,7 @@ DEPEND="${RDEPEND}
                dev-haskell/tasty-quickcheck
                dev-haskell/text )
 "
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-32bit-tests.patch
+}

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
new file mode 100644
index 0000000..2b45be9
--- /dev/null
+++ b/dev-haskell/asn1-encoding/files/asn1-encoding-0.9.0-32bit-tests.patch
@@ -0,0 +1,24 @@
+On 32-bit systems Hourglass silently breaks dates
+out of range '1970 +- 68' years due to use of
+'time_t' and 'gmtime_r' from installed libc.
+
+Workaround test failures by not testing times out of this range.
+
+Github-bug: https://github.com/vincenthz/hs-hourglass/issues/21
+Github-bug: https://github.com/vincenthz/hs-asn1/issues/12
+diff --git a/tests/Tests.hs b/tests/Tests.hs
+index 5a82ec9..525de82 100644
+--- a/tests/Tests.hs
++++ b/tests/Tests.hs
+@@ -88,7 +88,10 @@ instance Arbitrary BitArray where
+ 
+ instance Arbitrary Date where
+     arbitrary = do
+-        y <- choose (1951, 2050)
++        -- 2037 and not 2050
++        -- due to a limitation of 'timeConvert' on 32-bit systems:
++        --  https://github.com/vincenthz/hs-hourglass/issues/21
++        y <- choose (1951, 2037)
+         m <- elements [ January .. December]
+         d <- choose (1, 30)
+         return $ normalizeDate $ Date y m d

Reply via email to