dev-libs/OpenNI: Fix building with GCC-6
authorPeter Levine <plevine457@gmail.com>
Sat, 24 Jun 2017 02:21:10 +0000 (22:21 -0400)
committerAlexis Ballier <aballier@gentoo.org>
Sun, 25 Jun 2017 15:09:44 +0000 (17:09 +0200)
Bug: https://bugs.gentoo.org/show_bug.cgi?id=594988
Package-Manager: Portage-2.3.6, Repoman-2.3.2

dev-libs/OpenNI/OpenNI-1.5.7.10.ebuild
dev-libs/OpenNI/OpenNI-9999.ebuild
dev-libs/OpenNI/files/OpenNI-1.5.7.10-gcc6.patch [new file with mode: 0644]

index d30b883c574ca32f453bb22f044411cb58396da1..af12cd1ce8755558f7c91e538f10f138a61927da 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -43,7 +43,8 @@ src_prepare() {
        epatch \
                "${FILESDIR}/tinyxml.patch" \
                "${FILESDIR}/jpeg.patch" \
-               "${FILESDIR}/soname.patch"
+               "${FILESDIR}/soname.patch" \
+               "${FILESDIR}/${P}-gcc6.patch"
 
        rm -rf External/{LibJPEG,TinyXml}
        for i in Platform/Linux/Build/Common/Platform.* Externals/PSCommon/Linux/Build/Platform.* ; do
index d30b883c574ca32f453bb22f044411cb58396da1..79a0be764ee33f645ff709963d2d4abaed93aa99 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -43,7 +43,8 @@ src_prepare() {
        epatch \
                "${FILESDIR}/tinyxml.patch" \
                "${FILESDIR}/jpeg.patch" \
-               "${FILESDIR}/soname.patch"
+               "${FILESDIR}/soname.patch" \
+               "${FILESDIR}/${PN}-1.5.7.10-gcc6.patch"
 
        rm -rf External/{LibJPEG,TinyXml}
        for i in Platform/Linux/Build/Common/Platform.* Externals/PSCommon/Linux/Build/Platform.* ; do
diff --git a/dev-libs/OpenNI/files/OpenNI-1.5.7.10-gcc6.patch b/dev-libs/OpenNI/files/OpenNI-1.5.7.10-gcc6.patch
new file mode 100644 (file)
index 0000000..2b93d8c
--- /dev/null
@@ -0,0 +1,145 @@
+Bug: https://bugs.gentoo.org/594988
+Upstream PR: https://github.com/OpenNI/OpenNI/pull/122
+
+diff -Naur a/Samples/NiUserSelection/glh/glh_linear.h b/Samples/NiUserSelection/glh/glh_linear.h
+--- a/Samples/NiUserSelection/glh/glh_linear.h 2013-11-12 11:30:03.000000000 -0500
++++ b/Samples/NiUserSelection/glh/glh_linear.h 2017-06-22 18:43:34.470107723 -0400
+@@ -77,7 +77,7 @@
+ #define     GLH_EPSILON         GLH_REAL(10e-6)\r
+ #define     GLH_PI              GLH_REAL(3.1415926535897932384626433832795)    \r
\r
+-#define     equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)\r
++#define     is_equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)\r
\r
+ namespace glh\r
+ {\r
+@@ -1093,7 +1093,7 @@
\r
+         real norm = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];\r
\r
+-        s = (equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );\r
++        s = (is_equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );\r
\r
+         xs = q[0] * s;\r
+         ys = q[1] * s;\r
+@@ -1194,7 +1194,7 @@
+             theta *= real(0.5);\r
+             real sin_theta = real(sin(theta));\r
\r
+-            if (!equivalent(sqnorm,GLH_ONE)) \r
++            if (!is_equivalent(sqnorm,GLH_ONE)) \r
+               sin_theta /= real(sqrt(sqnorm));\r
+             x = sin_theta * axis.v[0];\r
+             y = sin_theta * axis.v[1];\r
+@@ -1216,14 +1216,14 @@
\r
+         alpha = p1.dot(p2);\r
\r
+-        if(equivalent(alpha,GLH_ONE))\r
++        if(is_equivalent(alpha,GLH_ONE))\r
+         { \r
+             *this = identity(); \r
+             return *this; \r
+         }\r
\r
+         // ensures that the anti-parallel case leads to a positive dot\r
+-        if(equivalent(alpha,-GLH_ONE))\r
++        if(is_equivalent(alpha,-GLH_ONE))\r
+         {\r
+             vec3 v;\r
\r
+@@ -1280,7 +1280,7 @@
+     void normalize()\r
+     {\r
+         real rnorm = GLH_ONE / real(sqrt(w * w + x * x + y * y + z * z));\r
+-        if (equivalent(rnorm, GLH_ZERO))\r
++        if (is_equivalent(rnorm, GLH_ZERO))\r
+             return;\r
+         x *= rnorm;\r
+         y *= rnorm;\r
+@@ -1439,10 +1439,10 @@
+     inline\r
+     bool operator == ( const quaternion & q1, const quaternion & q2 )\r
+     {\r
+-        return (equivalent(q1.x, q2.x) &&\r
+-                      equivalent(q1.y, q2.y) &&\r
+-                      equivalent(q1.z, q2.z) &&\r
+-                      equivalent(q1.w, q2.w) );\r
++        return (is_equivalent(q1.x, q2.x) &&\r
++                      is_equivalent(q1.y, q2.y) &&\r
++                      is_equivalent(q1.z, q2.z) &&\r
++                      is_equivalent(q1.w, q2.w) );\r
+     }\r
\r
+     inline\r
+diff -Naur a/Samples/NiViewer/glh/glh_linear.h b/Samples/NiViewer/glh/glh_linear.h
+--- a/Samples/NiViewer/glh/glh_linear.h        2013-11-12 11:30:03.000000000 -0500
++++ b/Samples/NiViewer/glh/glh_linear.h        2017-06-22 18:43:34.470107723 -0400
+@@ -77,7 +77,7 @@
+ #define     GLH_EPSILON         GLH_REAL(10e-6)\r
+ #define     GLH_PI              GLH_REAL(3.1415926535897932384626433832795)    \r
\r
+-#define     equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)\r
++#define     is_equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)\r
\r
+ namespace glh\r
+ {\r
+@@ -1093,7 +1093,7 @@
\r
+         real norm = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];\r
\r
+-        s = (equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );\r
++        s = (is_equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );\r
\r
+         xs = q[0] * s;\r
+         ys = q[1] * s;\r
+@@ -1194,7 +1194,7 @@
+             theta *= real(0.5);\r
+             real sin_theta = real(sin(theta));\r
\r
+-            if (!equivalent(sqnorm,GLH_ONE)) \r
++            if (!is_equivalent(sqnorm,GLH_ONE)) \r
+               sin_theta /= real(sqrt(sqnorm));\r
+             x = sin_theta * axis.v[0];\r
+             y = sin_theta * axis.v[1];\r
+@@ -1216,14 +1216,14 @@
\r
+         alpha = p1.dot(p2);\r
\r
+-        if(equivalent(alpha,GLH_ONE))\r
++        if(is_equivalent(alpha,GLH_ONE))\r
+         { \r
+             *this = identity(); \r
+             return *this; \r
+         }\r
\r
+         // ensures that the anti-parallel case leads to a positive dot\r
+-        if(equivalent(alpha,-GLH_ONE))\r
++        if(is_equivalent(alpha,-GLH_ONE))\r
+         {\r
+             vec3 v;\r
\r
+@@ -1280,7 +1280,7 @@
+     void normalize()\r
+     {\r
+         real rnorm = GLH_ONE / real(sqrt(w * w + x * x + y * y + z * z));\r
+-        if (equivalent(rnorm, GLH_ZERO))\r
++        if (is_equivalent(rnorm, GLH_ZERO))\r
+             return;\r
+         x *= rnorm;\r
+         y *= rnorm;\r
+@@ -1439,10 +1439,10 @@
+     inline\r
+     bool operator == ( const quaternion & q1, const quaternion & q2 )\r
+     {\r
+-        return (equivalent(q1.x, q2.x) &&\r
+-                      equivalent(q1.y, q2.y) &&\r
+-                      equivalent(q1.z, q2.z) &&\r
+-                      equivalent(q1.w, q2.w) );\r
++        return (is_equivalent(q1.x, q2.x) &&\r
++                      is_equivalent(q1.y, q2.y) &&\r
++                      is_equivalent(q1.z, q2.z) &&\r
++                      is_equivalent(q1.w, q2.w) );\r
+     }\r
\r
+     inline\r