guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: ilmbase: Add patch to fix build on i686.


From: Leo Famulari
Subject: 01/01: gnu: ilmbase: Add patch to fix build on i686.
Date: Wed, 02 Mar 2016 00:18:05 +0000

lfam pushed a commit to branch master
in repository guix.

commit 5e8276dcf4e3a05f69176dca816f00616e7f0593
Author: Leo Famulari <address@hidden>
Date:   Mon Feb 29 02:23:43 2016 -0500

    gnu: ilmbase: Add patch to fix build on i686.
    
    Fixes <http://bugs.gnu.org/22049>.
    
    * gnu/packages/patches/ilmbase-fix-tests.patch: New file.
    * gnu-system.am (dist_patch_DATA): Add it.
    * gnu/packages/graphics.scm (ilmbase)[source]: Add patch.
---
 gnu-system.am                                |    1 +
 gnu/packages/graphics.scm                    |    4 +-
 gnu/packages/patches/ilmbase-fix-tests.patch |  149 ++++++++++++++++++++++++++
 3 files changed, 153 insertions(+), 1 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 7cfc485..5e2be0b 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -529,6 +529,7 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/icu4c-CVE-2014-6585.patch               \
   gnu/packages/patches/icu4c-CVE-2015-1270.patch               \
   gnu/packages/patches/icu4c-CVE-2015-4760.patch               \
+  gnu/packages/patches/ilmbase-fix-texts.patch                 \
   gnu/packages/patches/imagemagick-test-segv.patch             \
   gnu/packages/patches/irrlicht-mesa-10.patch                  \
   gnu/packages/patches/jasper-CVE-2007-2721.patch              \
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 560febe..3fdf07d 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2015 Tomáš Čech <address@hidden>
+;;; Copyright © 2016 Leo Famulari <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -89,7 +90,8 @@ many more.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))))
+                "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c"))
+              (patches (map search-patch '("ilmbase-fix-tests.patch")))))
     (build-system gnu-build-system)
     (home-page "http://www.openexr.com/";)
     (synopsis "Utility C++ libraries for threads, maths, and exceptions")
diff --git a/gnu/packages/patches/ilmbase-fix-tests.patch 
b/gnu/packages/patches/ilmbase-fix-tests.patch
new file mode 100644
index 0000000..fcaa37d
--- /dev/null
+++ b/gnu/packages/patches/ilmbase-fix-tests.patch
@@ -0,0 +1,149 @@
+Fix FTBFS on i686-linux due to rounding issue (see references).
+
+Fixes Guix bug #22049 (see below).
+
+Copied from Debian.
+
+Source:
+https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBoxAlgo.patch/
+https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBox.patch/
+
+References:
+https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22049
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712
+https://anonscm.debian.org/cgit/pkg-phototools/ilmbase.git/commit/?id=ab28bb45cdad8adc32e345b777ab8e692b1d9a9c
+
+---
+
+Subject: testBoxAlgo: allow fuzzy match of b12 == b2
+From: Steven Chamberlain <address@hidden>
+Date: Wed, 24 Feb 2016 01:04:11 +0000
+
+Also fix a pre-existing typo.
+
+Index: ilmbase/ImathTest/testBoxAlgo.cpp
+===================================================================
+--- ilmbase.orig/ImathTest/testBoxAlgo.cpp
++++ ilmbase/ImathTest/testBoxAlgo.cpp
+@@ -886,10 +886,11 @@ boxMatrixTransform ()
+ 
+     assert (approximatelyEqual (b2.min, b4.min, e));
+     assert (approximatelyEqual (b2.max, b4.max, e));
+-    assert (approximatelyEqual (b3.max, b4.max, e));
++    assert (approximatelyEqual (b3.min, b4.min, e));
+     assert (approximatelyEqual (b3.max, b4.max, e));
+ 
+-    assert (b21 == b2);
++    assert (approximatelyEqual (b2.min, b21.min, e));
++    assert (approximatelyEqual (b2.max, b21.max, e));
+     assert (b31 == b3);
+ 
+     M[0][3] = 1;
+
+---
+
+Subject: testBox: allow fuzzy comparison of floats, doubles
+From: Steven Chamberlain <address@hidden>
+Date: Wed, 24 Feb 2016 01:10:11 +0000
+
+Allow for inexact values, as long as the error is smaller than the
+epsilon of the data type.
+
+On 32-bit x86, allow even greater discrepency at double
+precision, due to possible double-rounding.  See
+https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html
+
+Index: ilmbase/ImathTest/testBox.cpp
+===================================================================
+--- ilmbase.orig/ImathTest/testBox.cpp
++++ ilmbase/ImathTest/testBox.cpp
+@@ -47,6 +47,58 @@ using namespace IMATH_INTERNAL_NAMESPACE
+ 
+ namespace {
+ 
++template <class T>
++bool
++approximatelyEqual (const T &p1, const T &p2)
++{
++      /* int and short should be exact */
++      return (p1 == p2);
++}
++
++bool
++approximatelyEqual (const Vec2<float> &p1, const Vec2<float> &p2)
++{
++    float e = limits<float>::epsilon();
++    float m = 0;
++
++    for (int i = 0; i < 2; ++i)
++    {
++      m = max (m, abs (p1[i]));
++      m = max (m, abs (p2[i]));
++    }
++
++    for (int i = 0; i < 2; ++i)
++      if (!equalWithAbsError (p1[i], p2[i], m * e))
++          return false;
++
++    return true;
++}
++
++bool
++approximatelyEqual (const Vec2<double> &p1, const Vec2<double> &p2)
++{
++#if defined(__i386__) || defined(_M_IX86)
++    /* double-rounding on 32-bit x86 may cause larger error:
++       use epsilon of float rather than double */
++    double e = limits<float>::epsilon();
++#else
++    double e = limits<double>::epsilon();
++#endif
++    double m = 0;
++
++    for (int i = 0; i < 2; ++i)
++    {
++      m = max (m, abs (p1[i]));
++      m = max (m, abs (p2[i]));
++    }
++
++    for (int i = 0; i < 2; ++i)
++      if (!equalWithAbsError (p1[i], p2[i], m * e))
++          return false;
++
++    return true;
++}
++
+ //
+ // Test case generation utility - create a vector of 
IMATH_INTERNAL_NAMESPACE::Vec{2,3,4}
+ // with all permutations of integers 1..T::dimensions().
+@@ -250,7 +302,8 @@ testExtendByPoint(const char *type)
+                               
+         IMATH_INTERNAL_NAMESPACE::Box<T> b;
+         b.extendBy(p);
+-        assert(b.min == p && b.max == p);
++        assert (approximatelyEqual (b.min, p));
++        assert (approximatelyEqual (b.max, p));
+     }
+ 
+     //
+@@ -283,7 +336,8 @@ testExtendByPoint(const char *type)
+ 
+             b.extendBy(p);
+ 
+-            assert(b.min == min && b.max == max);
++            assert (approximatelyEqual (b.min, min));
++            assert (approximatelyEqual (b.max, max));
+         }
+     }
+ }
+@@ -358,7 +412,8 @@ testExtendByBox(const char *type)
+             }
+             b.extendBy(IMATH_INTERNAL_NAMESPACE::Box<T>(p0, p1));
+ 
+-            assert(b.min == min && b.max == max);
++            assert (approximatelyEqual (b.min, min));
++            assert (approximatelyEqual (b.max, max));
+         }
+     }
+ }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]