[packages/OpenNI] - added c++ patch (fix define conflict with C++ standard library) - added mono patch (use mcs instea

qboosh qboosh at pld-linux.org
Wed Nov 29 16:58:43 CET 2017


commit df2301948a0d2c1c4cb06c03fd315df50ba526ab
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Nov 29 16:59:47 2017 +0100

    - added c++ patch (fix define conflict with C++ standard library)
    - added mono patch (use mcs instead of gmcs as C# compiler)

 OpenNI-c++.patch  | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 OpenNI-mono.patch | 11 +++++++++
 OpenNI.spec       |  9 +++++--
 3 files changed, 88 insertions(+), 2 deletions(-)
---
diff --git a/OpenNI.spec b/OpenNI.spec
index 3577b1e..8397e85 100644
--- a/OpenNI.spec
+++ b/OpenNI.spec
@@ -25,7 +25,9 @@ Source0:	https://github.com/OpenNI/OpenNI/tarball/Stable-%{version}/%{name}-%{ve
 Source1:	libopenni.pc
 Patch0:		%{name}-system-libs.patch
 Patch1:		%{name}-nosse.patch
-URL:		http://openni.org/
+Patch2:		%{name}-c++.patch
+Patch3:		%{name}-mono.patch
+URL:		https://github.com/OpenNI/OpenNI/
 BuildRequires:	OpenGL-devel
 # for examples
 BuildRequires:	OpenGL-glut-devel >= 3
@@ -149,6 +151,8 @@ Interfejs .NET do OpenNI.
 %undos Platform/Linux/Build/Samples/NiUserTracker/Makefile
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 %{__make} -C Platform/Linux/Build clean
@@ -159,7 +163,8 @@ export CFLAGS="%{rpmcflags}"
 	HOSTPLATFORM=%{openni_platform} \
 	SSE_GENERATION=%{?with_sse3:3}%{!?with_sse3:%{?with_sse2:2}} \
 	%{?with_ssse3:SSSE3_ENABLED=1} \
-	%{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=}
+	%{!?with_java:ALL_JAVA_PROJS= JAVA_SAMPLES=} \
+	MONO_INSTALLED=%{?with_mono:1}
 
 %if %{with apidocs}
 cd Source/DoxyGen
diff --git a/OpenNI-c++.patch b/OpenNI-c++.patch
new file mode 100644
index 0000000..3f98f0e
--- /dev/null
+++ b/OpenNI-c++.patch
@@ -0,0 +1,70 @@
+--- OpenNI-OpenNI-1e9524f/Samples/NiViewer/glh/glh_linear.h.orig	2013-11-12 17:30:03.000000000 +0100
++++ OpenNI-OpenNI-1e9524f/Samples/NiViewer/glh/glh_linear.h	2017-11-29 16:09:12.957112371 +0100
+@@ -77,7 +77,7 @@
+ #define     GLH_EPSILON         GLH_REAL(10e-6)
+ #define     GLH_PI              GLH_REAL(3.1415926535897932384626433832795)    
+ 
+-#define     equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
++#define     glh_equivalent(a,b)     (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)
+ 
+ namespace glh
+ {
+@@ -1093,7 +1093,7 @@
+ 
+         real norm = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
+ 
+-        s = (equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
++        s = (glh_equivalent(norm,GLH_ZERO)) ? GLH_ZERO : ( GLH_TWO / norm );
+ 
+         xs = q[0] * s;
+         ys = q[1] * s;
+@@ -1194,7 +1194,7 @@
+             theta *= real(0.5);
+             real sin_theta = real(sin(theta));
+ 
+-            if (!equivalent(sqnorm,GLH_ONE)) 
++            if (!glh_equivalent(sqnorm,GLH_ONE)) 
+               sin_theta /= real(sqrt(sqnorm));
+             x = sin_theta * axis.v[0];
+             y = sin_theta * axis.v[1];
+@@ -1216,14 +1216,14 @@
+ 
+         alpha = p1.dot(p2);
+ 
+-        if(equivalent(alpha,GLH_ONE))
++        if(glh_equivalent(alpha,GLH_ONE))
+         { 
+             *this = identity(); 
+             return *this; 
+         }
+ 
+         // ensures that the anti-parallel case leads to a positive dot
+-        if(equivalent(alpha,-GLH_ONE))
++        if(glh_equivalent(alpha,-GLH_ONE))
+         {
+             vec3 v;
+ 
+@@ -1280,7 +1280,7 @@
+     void normalize()
+     {
+         real rnorm = GLH_ONE / real(sqrt(w * w + x * x + y * y + z * z));
+-        if (equivalent(rnorm, GLH_ZERO))
++        if (glh_equivalent(rnorm, GLH_ZERO))
+             return;
+         x *= rnorm;
+         y *= rnorm;
+@@ -1439,10 +1439,10 @@
+     inline
+     bool operator == ( const quaternion & q1, const quaternion & q2 )
+     {
+-        return (equivalent(q1.x, q2.x) &&
+-		        equivalent(q1.y, q2.y) &&
+-		        equivalent(q1.z, q2.z) &&
+-		        equivalent(q1.w, q2.w) );
++        return (glh_equivalent(q1.x, q2.x) &&
++		        glh_equivalent(q1.y, q2.y) &&
++		        glh_equivalent(q1.z, q2.z) &&
++		        glh_equivalent(q1.w, q2.w) );
+     }
+ 
+     inline
diff --git a/OpenNI-mono.patch b/OpenNI-mono.patch
new file mode 100644
index 0000000..901e53c
--- /dev/null
+++ b/OpenNI-mono.patch
@@ -0,0 +1,11 @@
+--- OpenNI-OpenNI-1e9524f/Platform/Linux/Build/Common/CommonCSMakefile.orig	2013-11-12 17:30:03.000000000 +0100
++++ OpenNI-OpenNI-1e9524f/Platform/Linux/Build/Common/CommonCSMakefile	2017-11-29 16:54:33.678880973 +0100
+@@ -45,7 +45,7 @@
+ 	TARGET = winexe
+ endif
+ 
+-OUTPUT_COMMAND = gmcs -out:$(OUTPUT_FILE) -target:$(TARGET) $(CSFLAGS) $(USED_NETLIBS_OPTION) $(SRC_FILES)
++OUTPUT_COMMAND = mcs -out:$(OUTPUT_FILE) -target:$(TARGET) $(CSFLAGS) $(USED_NETLIBS_OPTION) $(SRC_FILES)
+ 
+ #############################################################################
+ # Targets
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/OpenNI.git/commitdiff/df2301948a0d2c1c4cb06c03fd315df50ba526ab



More information about the pld-cvs-commit mailing list