commit f883f1935b6fcb28a7e301c203134155c848c868 Author: tigro Date: Wed Dec 25 18:30:01 2024 +0300 import openni-1.5.7.10-35.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8aab38 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/openni-1.5.7.10-1e9524f-fedora.tar.gz diff --git a/.openni.metadata b/.openni.metadata new file mode 100644 index 0000000..59c5ab6 --- /dev/null +++ b/.openni.metadata @@ -0,0 +1 @@ +015e6224c0c0f43c864e5ec5db463c8b4061f958 SOURCES/openni-1.5.7.10-1e9524f-fedora.tar.gz diff --git a/SOURCES/libopenni.pc b/SOURCES/libopenni.pc new file mode 100644 index 0000000..418c374 --- /dev/null +++ b/SOURCES/libopenni.pc @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/ni + +Name: OpenNI +Description: A general purpose driver for all OpenNI cameras. +Version: @version@ +Cflags: -I${includedir} +Libs: -L${libdir} -lOpenNI diff --git a/SOURCES/openni-1.3.2.1-fedora-java.patch b/SOURCES/openni-1.3.2.1-fedora-java.patch new file mode 100644 index 0000000..0712ea4 --- /dev/null +++ b/SOURCES/openni-1.3.2.1-fedora-java.patch @@ -0,0 +1,16 @@ +diff -urN openni-1.3.2.1-gitf8467404/Wrappers/OpenNI.java/src/org/openni/NativeMethods.java openni-1.3.2.1-gitf8467404.fedora-java/Wrappers/OpenNI.java/src/org/openni/NativeMethods.java +--- openni-1.3.2.1-gitf8467404/Wrappers/OpenNI.java/src/org/openni/NativeMethods.java 2011-07-13 21:35:20.000000000 +0200 ++++ openni-1.3.2.1-gitf8467404.fedora-java/Wrappers/OpenNI.java/src/org/openni/NativeMethods.java 2011-08-30 15:00:59.107807852 +0200 +@@ -6,11 +6,7 @@ + { + static + { +- String arch = System.getenv("PROCESSOR_ARCHITECTURE"); +- if ((arch != null) && ((arch.equals("AMD64")) || (arch.equals("IA64")))) +- System.loadLibrary("OpenNI.jni64"); +- else +- System.loadLibrary("OpenNI.jni"); ++ System.load("@LIBDIR@/OpenNI.jni.so"); + } + + // Marshaling diff --git a/SOURCES/openni-1.3.2.1-silence-assert.patch b/SOURCES/openni-1.3.2.1-silence-assert.patch new file mode 100644 index 0000000..a89c1d1 --- /dev/null +++ b/SOURCES/openni-1.3.2.1-silence-assert.patch @@ -0,0 +1,11 @@ +--- a/Include/Linux-x86/XnPlatformLinux-x86.h ++++ b/Include/Linux-x86/XnPlatformLinux-x86.h +@@ -163,7 +163,7 @@ + #define XN_STRINGIFY_HELPER(n) #n + + /** Asserts an expression, only on Debug build. */ +-#define XN_ASSERT(x) ++#define XN_ASSERT(x) ((void)(x)) + + //--------------------------------------------------------------------------- + // API Export/Import Macros diff --git a/SOURCES/openni-1.5.2.23-armsamples.patch b/SOURCES/openni-1.5.2.23-armsamples.patch new file mode 100644 index 0000000..70351b9 --- /dev/null +++ b/SOURCES/openni-1.5.2.23-armsamples.patch @@ -0,0 +1,22 @@ +diff -up ./Platform/Linux/CreateRedist/Redist_OpenNi.py.armsamples ./Platform/Linux/CreateRedist/Redist_OpenNi.py +--- ./Platform/Linux/CreateRedist/Redist_OpenNi.py.armsamples 2013-09-15 00:09:24.809941045 -0400 ++++ ./Platform/Linux/CreateRedist/Redist_OpenNi.py 2013-09-15 00:09:43.265631930 -0400 +@@ -346,12 +346,12 @@ if PLATFORM == 'CE4100': + samples_list.remove('NiViewer') + samples_list.remove('NiSimpleViewer') + +-if PLATFORM == 'Arm': +- samples_list.remove('NiUserTracker') +- samples_list.remove('NiViewer') +- samples_list.remove('NiSimpleViewer') +- samples_list.remove('NiHandTracker') +- samples_list.remove('NiUserSelection') ++#if PLATFORM == 'Arm': ++# samples_list.remove('NiUserTracker') ++# samples_list.remove('NiViewer') ++# samples_list.remove('NiSimpleViewer') ++# samples_list.remove('NiHandTracker') ++# samples_list.remove('NiUserSelection') + + if (MonoDetected == 0): + samples_list.remove("SimpleRead.net") diff --git a/SOURCES/openni-1.5.2.23-disable-softfloat.patch b/SOURCES/openni-1.5.2.23-disable-softfloat.patch new file mode 100644 index 0000000..e0b7d8d --- /dev/null +++ b/SOURCES/openni-1.5.2.23-disable-softfloat.patch @@ -0,0 +1,23 @@ +diff -up ./Platform/Linux/Build/Common/Platform.Arm.disable-softfloat ./Platform/Linux/Build/Common/Platform.Arm +--- ./Platform/Linux/Build/Common/Platform.Arm.disable-softfloat 2012-01-04 06:35:46.000000000 -0500 ++++ ./Platform/Linux/Build/Common/Platform.Arm 2014-06-01 13:46:34.871518256 -0400 +@@ -1,12 +1,16 @@ ++# Fedora: glut is available on ARM ++export GLUT_SUPPORTED=1 ++ + ifeq "$(CFG)" "Release" + + # Hardware specifying flags +- CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 ++ #CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8 + + # Optimization level, minus currently buggy optimizing methods (which break bit-exact) +- CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing ++ CFLAGS += -fno-tree-pre -fno-strict-aliasing + + # More optimization flags +- CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant ++ CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations ++ #-fsingle-precision-constant + + endif diff --git a/SOURCES/openni-1.5.2.23-disable-sse.patch b/SOURCES/openni-1.5.2.23-disable-sse.patch new file mode 100644 index 0000000..402d7c0 --- /dev/null +++ b/SOURCES/openni-1.5.2.23-disable-sse.patch @@ -0,0 +1,20 @@ +diff -up ./Platform/Linux/Build/Common/Platform.x86.disable-sse ./Platform/Linux/Build/Common/Platform.x86 +--- ./Platform/Linux/Build/Common/Platform.x86.disable-sse 2013-09-13 20:34:18.023985897 -0400 ++++ ./Platform/Linux/Build/Common/Platform.x86 2013-09-13 20:34:48.556164983 -0400 +@@ -2,7 +2,7 @@ + export GLUT_SUPPORTED=1 + + ifndef SSE_GENERATION +- SSE_GENERATION = 3 ++ SSE_GENERATION = 0 + endif + + ifeq ("$(OSTYPE)","Darwin") +@@ -19,7 +19,5 @@ else + ifeq ($(SSSE3_ENABLED), 1) + CFLAGS += -mssse3 + endif +- else +- DUMMY:=($error "Only SSE2 and SSE3 are supported") + endif + endif diff --git a/SOURCES/openni-1.5.7.10-fedora.patch b/SOURCES/openni-1.5.7.10-fedora.patch new file mode 100644 index 0000000..d9c53ad --- /dev/null +++ b/SOURCES/openni-1.5.7.10-fedora.patch @@ -0,0 +1,257 @@ +diff -up ./.gitignore.fedora ./.gitignore +--- ./.gitignore.fedora 2013-11-12 11:30:03.000000000 -0500 ++++ ./.gitignore 2014-06-01 18:21:35.911632579 -0400 +@@ -1,3 +1,11 @@ ++*~ ++Release/ ++/Source/DoxyGen/html ++/Platform/Linux/Bin ++/Platform/Linux/CreateRedist/Final ++/Platform/Linux/CreateRedist/Output ++/Platform/Linux/Redist ++/Platform/Linux/Build + x64-Release + Manifest.txt + Platform/Linux/CreateRedist/Final +diff -up ./Platform/Linux/Build/Modules/nimCodecs/Makefile.fedora ./Platform/Linux/Build/Modules/nimCodecs/Makefile +--- ./Platform/Linux/Build/Modules/nimCodecs/Makefile.fedora 2014-06-01 18:21:35.912632616 -0400 ++++ ./Platform/Linux/Build/Modules/nimCodecs/Makefile 2014-06-01 18:23:56.634016624 -0400 +@@ -2,16 +2,22 @@ BIN_DIR = ../../../Bin + + INC_DIRS = \ + ../../../../../Include \ +- ../../../../../Source \ +- ../../../../../Externals/LibJPEG ++ ../../../../../Source + + SRC_FILES = \ +- ../../../../../Source/Modules/nimCodecs/*.cpp \ +- ../../../../../Externals/LibJPEG/*.c ++ ../../../../../Source/Modules/nimCodecs/*.cpp + + LIB_NAME = nimCodecs + USED_LIBS = OpenNI + ++ifneq ($(wildcard /usr/lib/libjpeg.so /usr/lib32/libjpeg.so /usr/lib64/libjpeg.so /usr/local/lib/libjpeg.so /usr/local/lib32/libjpeg.so /usr/local/lib64/libjpeg.so),) ++ USED_LIBS += jpeg ++else ++ INC_DIRS += ../../../../../Source/External/LibJPEG ++ SRC_FILES += ../../../../../Source/External/LibJPEG/*.c ++endif ++ ++ + include ../../Common/CommonCppMakefile + + +diff -up ./Platform/Linux/Build/OpenNI/Makefile.fedora ./Platform/Linux/Build/OpenNI/Makefile +--- ./Platform/Linux/Build/OpenNI/Makefile.fedora 2013-11-12 11:30:03.000000000 -0500 ++++ ./Platform/Linux/Build/OpenNI/Makefile 2014-06-01 18:24:57.078466204 -0400 +@@ -4,13 +4,11 @@ BIN_DIR = ../../Bin + + INC_DIRS = \ + ../../../../Include \ +- ../../../../Source \ +- ../../../../Externals/TinyXml ++ ../../../../Source + + SRC_FILES = \ + ../../../../Source/OpenNI/*.cpp \ +- ../../../../Source/OpenNI/Linux/*.cpp \ +- ../../../../Externals/TinyXml/*.cpp ++ ../../../../Source/OpenNI/Linux/*.cpp + + ifeq ("$(OSTYPE)","Darwin") + INC_DIRS += /opt/local/include +@@ -25,6 +23,14 @@ ifneq ("$(OSTYPE)","Darwin") + endif + DEFINES = XN_EXPORTS + ++ifneq ($(wildcard /usr/include/tinyxml.h /usr/local/include/tinyxml.h),) ++ USED_LIBS += tinyxml ++else ++ INC_DIRS += ../../../../Source/External/TinyXml ++ SRC_FILES += ../../../../Source/External/TinyXml/*.cpp ++endif ++ ++ + include ../Common/CommonCppMakefile + + +diff -up ./Platform/Linux/CreateRedist/install.sh.fedora ./Platform/Linux/CreateRedist/install.sh +--- ./Platform/Linux/CreateRedist/install.sh.fedora 2013-11-12 11:30:03.000000000 -0500 ++++ ./Platform/Linux/CreateRedist/install.sh 2014-06-01 18:21:51.388203971 -0400 +@@ -8,6 +8,8 @@ Installs OpenNI to current machine. + Installs OpenNI (default mode) + -u,--uninstall + Uninstalls OpenNI. ++-n,--noregister ++ Do not (un)register the modules + -c,--cross-compile-rootfs + Used for cross-compiling. Installs OpenNI to instead of '/'. + -h,--help +@@ -45,6 +47,9 @@ while [ "$1" ]; do + -u|--uninstall) + uninstall=yes + ;; ++ -n|--noregister) ++ register=no ++ ;; + -c|--cross-staging-dir) + shift + rootfs=$1 +@@ -71,11 +76,22 @@ if [ "$install" = yes ] && [ "$uninstall + exit 1 + fi + +-INSTALL_LIB=$rootfs/usr/lib +-INSTALL_BIN=$rootfs/usr/bin +-INSTALL_INC=$rootfs/usr/include/ni +-INSTALL_VAR=$rootfs/var/lib/ni +-INSTALL_JAR=$rootfs/usr/share/java ++ ++if [ -z "$INSTALL_LIB" ]; then ++ INSTALL_LIB=$rootfs/usr/lib ++fi ++if [ -z "$INSTALL_BIN" ]; then ++ INSTALL_BIN=$rootfs/usr/bin ++fi ++if [ -z "$INSTALL_INC" ]; then ++ INSTALL_INC=$rootfs/usr/include/ni ++fi ++if [ -z "$INSTALL_VAR" ]; then ++ INSTALL_VAR=$rootfs/usr/etc/ni ++fi ++if [ -z "$INSTALL_JAR" ]; then ++ INSTALL_JAR=$rootfs/usr/share/java ++fi + + # make all calls into OpenNI run in this filesystem + export OPEN_NI_INSTALL_PATH=$rootfs +@@ -86,6 +102,12 @@ if [ "$install" = yes ]; then + printf "Installing OpenNI\n" + printf "****************************\n\n" + ++ mkdir -p $INSTALL_LIB ++ mkdir -p $INSTALL_BIN ++ mkdir -p $INSTALL_INC ++ mkdir -p $INSTALL_VAR ++ mkdir -p $INSTALL_JAR ++ + # copy libraries + printf "copying shared libraries..." + cp $LIB_FILES $INSTALL_LIB +@@ -107,17 +129,21 @@ if [ "$install" = yes ]; then + mkdir -p $INSTALL_VAR + printf "OK\n" + +- # register modules +- for module in $MODULES; do +- printf "registering module '$module'..." +- $INSTALL_BIN/niReg -r $INSTALL_LIB/$module +- printf "OK\n" +- done ++ if [ "$register" = yes ]; then ++ # register modules ++ for module in $MODULES; do ++ printf "registering module '$module'..." ++ $INSTALL_BIN/niReg -r $INSTALL_LIB/$module ++ printf "OK\n" ++ done ++ fi + +- # mono +- if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then +- printf "Installing .Net wrappers...\n" +- gacutil -i Bin/OpenNI.net.dll -package 2.0 $GACDIR ++ if [ "$register" = yes ]; then ++ # mono ++ if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then ++ printf "Installing .Net wrappers...\n" ++ gacutil -i Bin/OpenNI.net.dll -package 2.0 $GACDIR ++ fi + fi + + # java wrappers +@@ -135,13 +161,15 @@ elif [ "$uninstall" = yes ]; then + printf "Uninstalling OpenNI\n" + printf "****************************\n\n" + +- # unregister modules +- for module in $MODULES; do +- printf "unregistering module '$module'..." +- if $INSTALL_BIN/niReg -u $INSTALL_LIB/$module; then +- printf "OK\n" +- fi +- done ++ if [ "$register" = yes ]; then ++ # unregister modules ++ for module in $MODULES; do ++ printf "unregistering module '$module'..." ++ if $INSTALL_BIN/niReg -u $INSTALL_LIB/$module; then ++ printf "OK\n" ++ fi ++ done ++ fi + + # include files + printf "removing include files..." +@@ -162,12 +190,13 @@ elif [ "$uninstall" = yes ]; then + done + printf "OK\n" + +- # mono +- if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then +- printf "Removing .Net wrappers...\n" +- gacutil -u OpenNI.net $GACDIR ++ if [ "$register" = yes ]; then ++ # mono ++ if [ -f $rootfs/usr/bin/gmcs -a -f Bin/OpenNI.net.dll ]; then ++ printf "Removing .Net wrappers...\n" ++ gacutil -u OpenNI.net $GACDIR ++ fi + fi +- + # java + printf "removing java bindings..." + for filename in $JAR_FILES; do +diff -up ./Source/OpenNI/Linux/XnUSBLinux.cpp.fedora ./Source/OpenNI/Linux/XnUSBLinux.cpp +--- ./Source/OpenNI/Linux/XnUSBLinux.cpp.fedora 2013-11-12 11:30:03.000000000 -0500 ++++ ./Source/OpenNI/Linux/XnUSBLinux.cpp 2014-06-01 18:21:51.389204009 -0400 +@@ -398,6 +398,16 @@ XN_C_API XnStatus xnUSBOpenDeviceImpl(li + return (XN_STATUS_USB_SET_CONFIG_FAILED); + } + */ ++ // detach any active kernel driver, code extracted from libfreenect ++ rc = libusb_kernel_driver_active(handle, 0); ++ if (rc == 1) { ++ rc = libusb_detach_kernel_driver(handle, 0); ++ if (rc != 0) ++ { ++ libusb_close(handle); ++ return (XN_STATUS_USB_SET_INTERFACE_FAILED); ++ } ++ } + // claim the interface (you cannot open any end point before claiming the interface) + rc = libusb_claim_interface(handle, 0); + if (rc != 0) +@@ -518,7 +528,7 @@ XN_C_API XnStatus xnUSBCloseDevice(XN_US + { + return (XN_STATUS_USB_DEVICE_CLOSE_FAILED); + } +- ++ rc = libusb_attach_kernel_driver(pDevHandle->hDevice, 0); + libusb_close(pDevHandle->hDevice); + + XN_FREE_AND_NULL(pDevHandle); +diff -up ./Wrappers/OpenNI.jni/jni.h.fedora ./Wrappers/OpenNI.jni/jni.h +--- ./Wrappers/OpenNI.jni/jni.h.fedora 2013-11-12 11:30:03.000000000 -0500 ++++ ./Wrappers/OpenNI.jni/jni.h 2014-06-01 18:21:51.390204045 -0400 +@@ -182,7 +182,7 @@ typedef enum _jobjectType { + typedef struct { + const char *name; + const char *signature; +- void *fnPtr; ++ const void *fnPtr; + } JNINativeMethod; + + /* diff --git a/SOURCES/openni-1.5.7.10-rename-equivalent-for-gcc6.patch b/SOURCES/openni-1.5.7.10-rename-equivalent-for-gcc6.patch new file mode 100644 index 0000000..175d770 --- /dev/null +++ b/SOURCES/openni-1.5.7.10-rename-equivalent-for-gcc6.patch @@ -0,0 +1,81 @@ +From: Jochen Sprickerhof +Date: Sat, 23 Jan 2016 15:22:26 +0100 +Subject: Rename equivalent to fix compilation on gcc6 + +Closes: #811848 +--- + Samples/NiViewer/glh/glh_linear.h | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Samples/NiViewer/glh/glh_linear.h b/Samples/NiViewer/glh/glh_linear.h +index 422c05f..207adc5 100644 +--- a/Samples/NiViewer/glh/glh_linear.h ++++ b/Samples/NiViewer/glh/glh_linear.h +@@ -77,7 +77,7 @@ glh_linear.h + #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 @@ namespace glh + + 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 @@ namespace glh + 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 @@ namespace glh + + 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 @@ namespace glh + 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 @@ namespace glh + 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/SOURCES/openni-1.5.7.10-willow.patch b/SOURCES/openni-1.5.7.10-willow.patch new file mode 100644 index 0000000..02a1f0e --- /dev/null +++ b/SOURCES/openni-1.5.7.10-willow.patch @@ -0,0 +1,214 @@ +diff -up ./Include/XnCppWrapper.h.willow ./Include/XnCppWrapper.h +--- ./Include/XnCppWrapper.h.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Include/XnCppWrapper.h 2015-01-05 20:00:00.962545722 -0500 +@@ -202,7 +202,7 @@ namespace xn + * + * @param [in] ppData A pointer to the data member of the meta data object. + */ +- inline OutputMetaData(const XnUInt8** ppData) : m_ppData(ppData), m_nAllocatedSize(0), m_pAllocatedData(NULL) ++ inline OutputMetaData(const XnUInt8** ppData) : m_pAllocatedData(NULL), m_ppData(ppData), m_nAllocatedSize(0) + { + xnOSMemSet(&m_output, 0, sizeof(XnOutputMetaData)); + } +@@ -1980,7 +1980,7 @@ namespace xn + xnNodeQueryAllocate(&m_pQuery); + } + +- inline Query(XnNodeQuery* pNodeQuery) : m_bAllocated(FALSE), m_pQuery(pNodeQuery) ++ inline Query(XnNodeQuery* pNodeQuery) : m_pQuery(pNodeQuery), m_bAllocated(FALSE) + { + } + +@@ -6614,6 +6614,7 @@ namespace xn + */ + inline XnBool IsCalibrated(XnUserID user) const + { ++ + return xnIsSkeletonCalibrated(GetHandle(), user); + } + +@@ -8435,7 +8436,7 @@ private: + /** + * Ctor + */ +- inline EnumerationErrors() : m_bAllocated(TRUE), m_pErrors(NULL) { xnEnumerationErrorsAllocate(&m_pErrors); } ++ inline EnumerationErrors() : m_bAllocated(TRUE) { xnEnumerationErrorsAllocate(&m_pErrors); } + + /** + * Ctor +@@ -8444,7 +8445,7 @@ private: + * @param [in] bOwn TRUE to own the object (i.e. free it upon destruction), FALSE + * otherwise. + */ +- inline EnumerationErrors(XnEnumerationErrors* pErrors, XnBool bOwn = FALSE) : m_bAllocated(bOwn), m_pErrors(pErrors) {} ++ inline EnumerationErrors(XnEnumerationErrors* pErrors, XnBool bOwn = FALSE) : m_pErrors(pErrors), m_bAllocated(bOwn) {} + + /** + * Dtor +diff -up ./Include/XnOS.h.willow ./Include/XnOS.h +--- ./Include/XnOS.h.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Include/XnOS.h 2015-01-05 20:00:00.963545761 -0500 +@@ -48,7 +48,11 @@ + #elif defined(_ARC) + #include "ARC/XnOSARC.h" + #else +- #error OpenNI OS Abstraction Layer - Unsupported Platform! ++ #if defined __INTEL_COMPILER ++ #include "Linux-x86/XnOSLinux.h" ++ #else ++ #error OpenNI OS Abstraction Layer - Unsupported Platform! ++ #endif + #endif + + //--------------------------------------------------------------------------- +diff -up ./Include/XnPlatform.h.willow ./Include/XnPlatform.h +--- ./Include/XnPlatform.h.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Include/XnPlatform.h 2015-01-05 20:00:00.963545761 -0500 +@@ -68,11 +68,16 @@ + #elif _ARC + #include "ARC/XnPlatformARC.h" + #elif (__APPLE__) +- #include "MacOSX/XnPlatformMacOSX.h" ++ #include "MacOSX/XnPlatformMacOSX.h" + #else +- #error OpenNI Platform Abstraction Layer - Unsupported Platform! ++ #if defined __INTEL_COMPILER ++ #include "Linux/XnPlatformLinux.h" ++ #else ++ #error OpenNI Platform Abstraction Layer - Unsupported Platform! ++ #endif + #endif + ++ + //--------------------------------------------------------------------------- + // Basic Common Macros + //--------------------------------------------------------------------------- +diff -up ./Include/XnTypes.h.willow ./Include/XnTypes.h +--- ./Include/XnTypes.h.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Include/XnTypes.h 2015-01-05 20:00:00.964545799 -0500 +@@ -349,7 +349,7 @@ typedef XnUInt16 XnLabel; + + // deprecated pragma is only supported in Visual Studio + #if (XN_PLATFORM == XN_PLATFORM_WIN32) +-#pragma deprecated("XN_CAPABILITY_ANTI_FILCKER") ++//#pragma deprecated("XN_CAPABILITY_ANTI_FILCKER") + #endif + + //--------------------------------------------------------------------------- +diff -up ./Samples/NiAudioSample/NiAudioSample.cpp.willow ./Samples/NiAudioSample/NiAudioSample.cpp +--- ./Samples/NiAudioSample/NiAudioSample.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiAudioSample/NiAudioSample.cpp 2015-01-05 20:00:00.964545799 -0500 +@@ -32,7 +32,7 @@ + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + + #define NUMBER_OF_AUDIO_BUFFERS 100 + +diff -up ./Samples/NiCRead/NiCRead.c.willow ./Samples/NiCRead/NiCRead.c +--- ./Samples/NiCRead/NiCRead.c.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiCRead/NiCRead.c 2015-01-05 20:00:00.964545799 -0500 +@@ -26,7 +26,7 @@ + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + #define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml" + + //--------------------------------------------------------------------------- +diff -up ./Samples/NiRecordRaw/NiRecordRaw.cpp.willow ./Samples/NiRecordRaw/NiRecordRaw.cpp +--- ./Samples/NiRecordRaw/NiRecordRaw.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiRecordRaw/NiRecordRaw.cpp 2015-01-05 20:00:00.965545837 -0500 +@@ -29,7 +29,7 @@ + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + #define RECORDING_FILE_NAME "recordingWithRaw.oni" + #define RAW_NODE_NAME "Raw1" + +diff -up ./Samples/NiRecordSynthetic/NiRecordSynthetic.cpp.willow ./Samples/NiRecordSynthetic/NiRecordSynthetic.cpp +--- ./Samples/NiRecordSynthetic/NiRecordSynthetic.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiRecordSynthetic/NiRecordSynthetic.cpp 2015-01-05 20:00:00.965545837 -0500 +@@ -29,7 +29,7 @@ + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + + //--------------------------------------------------------------------------- + // Macros +diff -up ./Samples/NiSimpleRead/NiSimpleRead.cpp.willow ./Samples/NiSimpleRead/NiSimpleRead.cpp +--- ./Samples/NiSimpleRead/NiSimpleRead.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiSimpleRead/NiSimpleRead.cpp 2015-01-05 20:00:00.965545837 -0500 +@@ -29,7 +29,7 @@ + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + #define SAMPLE_XML_PATH_LOCAL "SamplesConfig.xml" + + //--------------------------------------------------------------------------- +diff -up ./Samples/NiSimpleViewer/NiSimpleViewer.cpp.willow ./Samples/NiSimpleViewer/NiSimpleViewer.cpp +--- ./Samples/NiSimpleViewer/NiSimpleViewer.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiSimpleViewer/NiSimpleViewer.cpp 2015-01-05 20:00:00.965545837 -0500 +@@ -35,7 +35,7 @@ using namespace xn; + //--------------------------------------------------------------------------- + // Defines + //--------------------------------------------------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + + #define GL_WIN_SIZE_X 1280 + #define GL_WIN_SIZE_Y 1024 +diff -up ./Samples/NiUserTracker/main.cpp.willow ./Samples/NiUserTracker/main.cpp +--- ./Samples/NiUserTracker/main.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiUserTracker/main.cpp 2015-01-05 20:00:00.965545837 -0500 +@@ -314,7 +314,7 @@ void glInit (int * pargc, char ** argv) + } + #endif // USE_GLES + +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + + #define CHECK_RC(nRetVal, what) \ + if (nRetVal != XN_STATUS_OK) \ +diff -up ./Samples/NiViewer/NiViewer.cpp.willow ./Samples/NiViewer/NiViewer.cpp +--- ./Samples/NiViewer/NiViewer.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Samples/NiViewer/NiViewer.cpp 2015-01-05 20:00:00.966545875 -0500 +@@ -85,7 +85,7 @@ using namespace glh; + // -------------------------------- + // Defines + // -------------------------------- +-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml" ++#define SAMPLE_XML_PATH "/etc/openni/SamplesConfig.xml" + + // -------------------------------- + // Types +diff -up ./Source/OpenNI/XnOpenNI.cpp.willow ./Source/OpenNI/XnOpenNI.cpp +--- ./Source/OpenNI/XnOpenNI.cpp.willow 2013-11-12 11:30:03.000000000 -0500 ++++ ./Source/OpenNI/XnOpenNI.cpp 2015-01-05 20:00:26.612524757 -0500 +@@ -7070,7 +7070,7 @@ XN_C_API XnStatus xnScriptNodeRun(XnNode + #if (XN_PLATFORM == XN_PLATFORM_WIN32) + #define XN_OPEN_NI_FILES_LOCATION "\\Data\\" + #elif (CE4100) +- #define XN_OPEN_NI_FILES_LOCATION "/usr/etc/ni/" ++ #define XN_OPEN_NI_FILES_LOCATION "/etc/ni/" + #elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX) + #define XN_OPEN_NI_FILES_LOCATION "/var/lib/ni/" + #elif (XN_PLATFORM == XN_PLATFORM_ANDROID_ARM) +@@ -7096,7 +7096,7 @@ XnStatus xnGetOpenNIConfFilesPath(XnChar + return nRetVal; + #else + // use root FS +- strDest[0] = '\0'; ++ strcpy (strDest, ""); + #endif + } + else diff --git a/SOURCES/openni-ansi.patch b/SOURCES/openni-ansi.patch new file mode 100644 index 0000000..b807fbb --- /dev/null +++ b/SOURCES/openni-ansi.patch @@ -0,0 +1,15 @@ +diff -up OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Include/XnPlatform.h.ansi OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Include/XnPlatform.h +--- OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Include/XnPlatform.h.ansi 2020-05-31 22:00:31.217318220 -0600 ++++ OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Include/XnPlatform.h 2020-05-31 22:01:12.855676231 -0600 +@@ -61,9 +61,9 @@ + #include "Win32/XnPlatformWin32.h" + #elif defined(ANDROID) && defined(__arm__) + #include "Android-Arm/XnPlatformAndroid-Arm.h" +-#elif (linux && (i386 || __x86_64__)) ++#elif (__linux__ && (__i386__ || __x86_64__)) + #include "Linux-x86/XnPlatformLinux-x86.h" +-#elif (linux && __arm__) ++#elif (__linux__ && __arm__) + #include "Linux-Arm/XnPlatformLinux-Arm.h" + #elif _ARC + #include "ARC/XnPlatformARC.h" diff --git a/SOURCES/openni-freeglut.patch b/SOURCES/openni-freeglut.patch new file mode 100644 index 0000000..648c8ab --- /dev/null +++ b/SOURCES/openni-freeglut.patch @@ -0,0 +1,121 @@ +--- Samples/NiSimpleViewer/NiSimpleViewer.cpp~ 2019-09-18 18:07:26.000000000 -0500 ++++ Samples/NiSimpleViewer/NiSimpleViewer.cpp 2019-09-19 08:01:28.843106221 -0500 +@@ -25,7 +25,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +- #include ++ #include + #endif + #include + +--- Samples/NiViewer/MouseInput.cpp~ 2019-09-18 18:07:26.000000000 -0500 ++++ Samples/NiViewer/MouseInput.cpp 2019-09-19 08:02:37.626044533 -0500 +@@ -26,7 +26,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +- #include ++ #include + #endif + + // -------------------------------- +--- Samples/NiViewer/Draw.cpp~ 2019-09-19 08:04:03.000000000 -0500 ++++ Samples/NiViewer/Draw.cpp 2019-09-19 08:20:54.533057100 -0500 +@@ -30,7 +30,7 @@ + #include + #else + #include +- #include ++ #include + #endif + #include "Statistics.h" + #include "MouseInput.h" +--- Samples/NiViewer/Menu.cpp~ 2019-09-19 08:21:14.000000000 -0500 ++++ Samples/NiViewer/Menu.cpp 2019-09-19 08:43:19.731785315 -0500 +@@ -26,7 +26,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +- #include ++ #include + #endif + #include + #include +--- Samples/NiUserTracker/SceneDrawer.cpp~ 2019-09-19 08:43:41.000000000 -0500 ++++ Samples/NiUserTracker/SceneDrawer.cpp 2019-09-19 08:55:28.057097409 -0500 +@@ -28,7 +28,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +- #include ++ #include + #endif + #else + #include "opengles.h" +--- Samples/NiUserSelection/SceneDrawer.h~ 2013-11-12 10:30:03.000000000 -0600 ++++ Samples/NiUserSelection/SceneDrawer.h 2019-09-19 09:07:09.659424865 -0500 +@@ -28,7 +28,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +-#include ++#include + #endif + #else + #include "opengles.h" +--- Samples/NiViewer/glh/glh_glut.h~ 2013-11-12 10:30:03.000000000 -0600 ++++ Samples/NiViewer/glh/glh_glut.h 2019-09-19 09:07:55.501380924 -0500 +@@ -49,7 +49,7 @@ + #ifdef MACOS + #include + #else +-#include ++#include + #endif + + #include +--- Samples/NiUserTracker/main.cpp~ 2019-09-19 09:08:41.000000000 -0500 ++++ Samples/NiUserTracker/main.cpp 2019-09-19 09:16:35.518870848 -0500 +@@ -51,7 +51,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +- #include ++ #include + #endif + #else + #include "opengles.h" +--- Samples/NiHandTracker/NiSimpleViewer.cpp~ 2019-09-19 09:17:11.000000000 -0500 ++++ Samples/NiHandTracker/NiSimpleViewer.cpp 2019-09-19 09:27:18.518229261 -0500 +@@ -26,7 +26,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +-#include ++#include + #endif + #include + #include +--- Samples/NiViewer/glh/glh_glut2.h~ 2013-11-12 10:30:03.000000000 -0600 ++++ Samples/NiViewer/glh/glh_glut2.h 2019-09-19 09:38:36.010422609 -0500 +@@ -54,7 +54,7 @@ + #ifdef MACOS + #include + #else +-#include ++#include + #endif + + #include +--- Samples/NiHandTracker/NiHandViewer.cpp~ 2019-09-19 09:39:04.000000000 -0500 ++++ Samples/NiHandTracker/NiHandViewer.cpp 2019-09-19 09:47:16.374748919 -0500 +@@ -25,7 +25,7 @@ + #if (XN_PLATFORM == XN_PLATFORM_MACOSX) + #include + #else +-#include ++#include + #endif + + //--------------------------------------------------------------------------- diff --git a/SOURCES/python3.patch b/SOURCES/python3.patch new file mode 100644 index 0000000..b13d23a --- /dev/null +++ b/SOURCES/python3.patch @@ -0,0 +1,202 @@ +diff -rU3 OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7.orig/Platform/Linux/CreateRedist/Redist_OpenNi.py OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Platform/Linux/CreateRedist/Redist_OpenNi.py +--- OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7.orig/Platform/Linux/CreateRedist/Redist_OpenNi.py 2021-01-14 19:39:30.193759462 +0100 ++++ OpenNI-1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Platform/Linux/CreateRedist/Redist_OpenNi.py 2021-01-14 21:11:55.909525074 +0100 +@@ -31,7 +31,8 @@ + import sys + import shutil + import stat +-from commands import getoutput as gop ++from subprocess import check_output as gop ++from pathlib import Path + + #-------------Functions--------------------------------------------------------# + +@@ -102,19 +103,17 @@ + redistFile.close() + return rc + +-def fix_file(arg,dirname,fname): ++def fix_file(filePath): + "Fixes paths for all the files in fname" +- for filename in fname: +- filePath = dirname + "/" + filename +- if os.path.isdir(filePath): +- continue ++ if not os.path.isdir(filePath): ++ filename = filePath.name + + ext = ['c','cpp','h','ini','cs','java'] + if filename == "Makefile" or filename.partition(".")[2] in ext: +- #print "Fixing: " + filePath +- tempName=filePath+'~~~' +- input = open(filePath) +- output = open(tempName,'w') ++ print("Fixing: ", filePath) ++ tempName = str(filePath) + '~~~' ++ input = open(filePath, encoding='latin-1') ++ output = open(tempName, 'w', encoding='latin-1') + for s in input: + olds = s + s = re.sub(r"../../../Bin",r"../Bin",s) +@@ -158,8 +157,8 @@ + "Executes command and checks the return code. If it's not 0, stops redist." + ret = os.system(cmd) + if ret != 0: +- print "failed to execute: " + cmd +- print name + " Failed!" ++ print("failed to execute: " + cmd) ++ print(name + " Failed!") + logger.critical(name + " Failed!") + finish_script(1) + +@@ -186,7 +185,7 @@ + elif machinetype[:3] == "arm": + PLATFORM = "Arm" + else: +- print "Unknown platform:", machinetype ++ print("Unknown platform:", machinetype) + finish_script(1) + + MAKE_ARGS = '' +@@ -214,15 +213,15 @@ + logger.setLevel(logging.INFO) + + #------------Welcome Messege--------=------------------------------------------# +-print "\n"; +-print "*********************************" +-print "* PrimeSense OpenNI Redist *" +-print "* " + DateTimeSTR + " *" +-print "*********************************" +-print ++print("\n"); ++print("*********************************") ++print("* PrimeSense OpenNI Redist *") ++print("* " + DateTimeSTR + " *") ++print("*********************************") ++print() + logger.info("PrimeSense OpenNI Redist Started") + +-print "Target:", TARGET ++print("Target:", TARGET) + + #--------------Take Version----------------------------------------------------# + version_file = open("../../../Include/XnVersion.h").read() +@@ -232,14 +231,14 @@ + build = re.search(r"define XN_BUILD_VERSION (\d+)", version_file).groups()[0] + + version = major + "." + minor + "." + maintenance + "." + build +-print "Version:", version ++print("Version:", version) + +-print "Num of compile jobs:", calc_jobs_number() ++print("Num of compile jobs:", calc_jobs_number()) + +-print ++print() + + #--------------Build Project---------------------------------------------------# +-print "* Building OpenNI..." ++print("* Building OpenNI...") + logger.info("Building OpenNI...") + + # Build +@@ -248,7 +247,7 @@ + execute_check('make ' + MAKE_ARGS + ' -C ' + SCRIPT_DIR + '/../Build > ' + SCRIPT_DIR + '/Output/Build' + PROJECT_NAME + '.txt', 'Building') + + #--------------Doxygen---------------------------------------------------------# +-print "* Creating Doxygen..." ++print("* Creating Doxygen...") + logger.info("Creating DoxyGen...") + os.chdir("../../../Source/DoxyGen"); + if os.path.exists("html"): +@@ -261,7 +260,7 @@ + os.system("rm -rf html/*.map html/*.md5 html/*.hhc html/*.hhk html/*.hhp") + + #-------------Create Redist Dir------------------------------------------------# +-print "* Creating Redist Dir..." ++print("* Creating Redist Dir...") + logger.info("Creating Redist Dir...") + os.chdir(SCRIPT_DIR + "/..") + +@@ -289,7 +288,7 @@ + os.makedirs(REDIST_DIR + "/Samples/Res") + + #-------------Copy files to redist---------------------------------------------# +-print "* Copying files to redist dir..." ++print("* Copying files to redist dir...") + logger.info("Copying files to redist dir...") + + #license +@@ -358,7 +357,7 @@ + samples_list.remove("SimpleViewer.net") + samples_list.remove("UserTracker.net") + +-print "Samples:", samples_list ++print("Samples:", samples_list) + + for sample in samples_list: + shutil.copytree("../../Samples/" + sample, REDIST_DIR + "/Samples/" + sample) +@@ -381,17 +380,18 @@ + os.system("find " + REDIST_DIR + "/Samples/. | grep .svn | xargs rm -rf") + + #-----Remove Read Only Attrib--------------------------------------------------# +-print "* Removing Read Only Attributes..." ++print("* Removing Read Only Attributes...") + logger.info("Removing Read Only Attributes...") + os.system ("chmod -R +r " + REDIST_DIR + "/*") + + #--------Fixing Files----------------------------------------------------------# +-print "* Fixing Files..." ++print("* Fixing Files...") + logger.info("Fixing Files...") +-os.path.walk(REDIST_DIR + "/Samples",fix_file,'') ++for path in Path(REDIST_DIR + "/Samples").rglob('*'): ++ fix_file(path) + + #-------Creating project and solutions-----------------------------------------# +-print "* Creating Makefile..." ++print("* Creating Makefile...") + logger.info("Creating Makefile...") + + MAKEFILE = open(REDIST_DIR + "/Samples/Build/Makefile", 'w') +@@ -421,19 +421,19 @@ + MAKEFILE.close() + + #-------Copy install script---------------------------------------------------# +-print "* Copying install script..." ++print("* Copying install script...") + logger.info("Copying install script...") + + copy_install_script(PLATFORM, "CreateRedist/install.sh", REDIST_DIR) + + #-------------Build Samples---------------------------------------------------# +-print "* Building Samples in release configuration......" ++print("* Building Samples in release configuration......") + logger.info("Building Samples in release configuration...") + + # Build project solution + execute_check("make " + MAKE_ARGS + " -C " + REDIST_DIR + "/Samples/Build " + " > "+SCRIPT_DIR+"/Output/BuildSmpRelease.txt", "Build samples in release") + +-print "* Building Samples in debug configuration......" ++print("* Building Samples in debug configuration......") + logger.info("Building Samples in debug configuration...") + + # Build project solution +@@ -445,7 +445,7 @@ + os.system("rm -rf " + REDIST_DIR + "/Samples/"+sample+"/" + PLATFORM + "/Release") + + #-------------Create TAR-------------------------------------------------------# +-print "* Creating tar......" ++print("* Creating tar......") + logger.info("Creating tar...") + + os.makedirs(SCRIPT_DIR+"/Final") +@@ -456,7 +456,7 @@ + os.chdir(SCRIPT_DIR) + + #-------------CleanUP----------------------------------------------------------# +-print "* Redist OpenNi Ended. !!" ++print("* Redist OpenNi Ended. !!") + logger.info("Redist OpenNi Ended.") + finish_script(0) + diff --git a/SPECS/openni.spec b/SPECS/openni.spec new file mode 100644 index 0000000..e42de85 --- /dev/null +++ b/SPECS/openni.spec @@ -0,0 +1,408 @@ +%global commit 1e9524ffd759841789dadb4ca19fb5d4ac5820e7 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%ifarch x86_64 +%global niarch x64 +%endif +%ifarch %{ix86} +%global niarch x86 +%endif +%ifarch %arm +%global niarch Arm +%endif + + +Name: openni +Version: 1.5.7.10 +Release: 35%{?dist} +Summary: Library for human-machine Natural Interaction + +# Automatically converted from old format: ASL 2.0 and BSD - review is highly recommended. +License: Apache-2.0 AND LicenseRef-Callaway-BSD +URL: http://www.openni.org +# To reproduce tarball (adapt version and shortcommit): +# wget https://github.com/OpenNI/OpenNI/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz +# tar xvf openni-%{version}-%{shortcommit}.tar.gz +# cd OpenNI-%{commit} +# rm -rf Platform/Win32 Platform/Android Platform/ARC +# cd .. +# tar czf openni-%{version}-%{shortcommit}-fedora.tar.gz OpenNI-%{commit} +Source0: openni-%{version}-%{shortcommit}-fedora.tar.gz +Source1: libopenni.pc +Patch0: openni-1.5.7.10-willow.patch +Patch1: openni-1.5.7.10-fedora.patch +Patch2: openni-1.5.2.23-disable-sse.patch +Patch3: openni-1.3.2.1-silence-assert.patch +Patch4: openni-1.3.2.1-fedora-java.patch +Patch5: openni-1.5.2.23-disable-softfloat.patch +Patch6: openni-1.5.2.23-armsamples.patch +Patch7: openni-1.5.7.10-rename-equivalent-for-gcc6.patch +Patch8: openni-freeglut.patch +# Fix compilation with -ansi or -std options +# https://github.com/OpenNI/OpenNI/commit/ca99f6181234c682bba42a6ba988cc10cee894d7 +Patch9: openni-ansi.patch + +Patch10: python3.patch + +ExclusiveArch: x86_64 %{arm} + +BuildRequires: gcc-c++, make +BuildRequires: freeglut-devel, tinyxml-devel, libjpeg-devel, dos2unix, libusb1-devel +BuildRequires: python3, doxygen, graphviz + +%description +OpenNI (Open Natural Interaction) is a multi-language, cross-platform +framework that defines APIs for writing applications utilizing Natural +Interaction. OpenNI APIs are composed of a set of interfaces for writing NI +applications. The main purpose of OpenNI is to form a standard API that +enables communication with both: + * Vision and audio sensors + * Vision and audio perception middleware + + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%package java +Summary: %{name} Java library +Requires: %{name} = %{version}-%{release} +BuildRequires: java-devel +BuildRequires: jpackage-utils +Requires: java-headless +Requires: jpackage-utils + +%description java +The %{name}-java package contains a Java JNI library for +developing applications that use %{name} in Java. + + +%package doc +Summary: API documentation for %{name} +BuildArch: noarch + +%description doc +The %{name}-doc package contains the automatically generated API documentation +for OpenNI. + + +%package examples +Summary: Sample programs for %{name} +Requires: %{name} = %{version}-%{release} + +%description examples +The %{name}-examples package contains example programs for OpenNI. + +%prep +%setup -q -n OpenNI-%{commit} +%patch -P0 -p1 -b .willow +%patch -P1 -p1 -b .fedora +%patch -P2 -p1 -b .disable-sse +%patch -P3 -p1 -b .silence-assert +%patch -P4 -p1 -b .fedora-java +%patch -P5 -p1 -b .disable-softfloat +%patch -P6 -p1 -b .armsamples +%patch -P7 -p1 -b .rename-equivalent-for-gcc6 +%patch -P8 -p0 -b .freeglut +%patch -P9 -p1 -b .ansi +dos2unix Platform/Linux/CreateRedist/Redist_OpenNi.py +%patch -P10 -p1 -b python3 +rm -rf Source/External +rm -rf Platform/Linux/Build/Prerequisites/* +find Samples -name GL -prune -exec rm -rf {} \; +find Samples -name Libs -prune -exec rm -rf {} \; + +for ext in c cpp; do + find Samples -name "*.$ext" -exec \ + sed -i -e 's|#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"|#define SAMPLE_XML_PATH "%{_sysconfdir}/%{name}/SamplesConfig.xml"|' {} \; +done + +sed -i 's|python|python3|' Platform/Linux/CreateRedist/RedistMaker +sed -i 's|if (os.path.exists("/usr/bin/gmcs"))|if (0)|' Platform/Linux/CreateRedist/Redist_OpenNi.py + +dos2unix README +dos2unix LICENSE + +%build +cd Platform/Linux/CreateRedist +# {?_smp_mflags} omitted, not supported by OpenNI Makefiles +chmod +x RedistMaker RedistMaker.Arm + +CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" DEBUG=1 \ +%ifarch %arm +./RedistMaker.Arm || cat Output/BuildOpenNI.txt +%else +./RedistMaker +%endif +cat Output/BuildOpenNI.txt + + +%install +rm -rf $RPM_BUILD_ROOT +pushd Platform/Linux/Redist/OpenNI-Bin-Dev-Linux-%{niarch}-v%{version} +INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \ +INSTALL_BIN=$RPM_BUILD_ROOT%{_bindir} \ +INSTALL_INC=$RPM_BUILD_ROOT%{_includedir}/ni \ +INSTALL_VAR=$RPM_BUILD_ROOT%{_var}/lib/ni \ +INSTALL_JAR=$RPM_BUILD_ROOT%{_libdir}/%{name} \ +./install.sh -n + +install -m 0755 Samples/Bin/%{niarch}-Release/libSample-NiSampleModule.so $RPM_BUILD_ROOT%{_libdir}/libNiSampleModule.so +install -m 0755 Samples/Bin/%{niarch}-Release/NiViewer $RPM_BUILD_ROOT%{_bindir} +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiAudioSample $RPM_BUILD_ROOT%{_bindir}/NiAudioSample +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiBackRecorder $RPM_BUILD_ROOT%{_bindir}/NiBackRecorder +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiConvertXToONI $RPM_BUILD_ROOT%{_bindir}/NiConvertXToONI +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiCRead $RPM_BUILD_ROOT%{_bindir}/NiCRead +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiRecordSynthetic $RPM_BUILD_ROOT%{_bindir}/NiRecordSynthetic +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiSimpleCreate $RPM_BUILD_ROOT%{_bindir}/NiSimpleCreate +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiSimpleRead $RPM_BUILD_ROOT%{_bindir}/NiSimpleRead +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiSimpleViewer $RPM_BUILD_ROOT%{_bindir}/NiSimpleViewer +install -m 0755 Samples/Bin/%{niarch}-Release/Sample-NiUserTracker $RPM_BUILD_ROOT%{_bindir}/NiUserTracker + +popd + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name} +install -p -m 0644 Data/SamplesConfig.xml $RPM_BUILD_ROOT%{_sysconfdir}/%{name} + +mkdir -p $RPM_BUILD_ROOT%{_var}/lib/ni +touch $RPM_BUILD_ROOT%{_var}/lib/ni/modules.xml + +mkdir -p %{buildroot}%{_libdir}/pkgconfig +sed -e 's![@]prefix[@]!%{_prefix}!g' \ + -e 's![@]exec_prefix[@]!%{_exec_prefix}!g' \ + -e 's![@]libdir[@]!%{_libdir}!g' \ + -e 's![@]includedir[@]!%{_includedir}!g' \ + -e 's![@]version[@]!%{version}!g' \ + %{SOURCE1} > %{buildroot}%{_libdir}/pkgconfig/libopenni.pc + + + +%post +%{?ldconfig} +if [ $1 == 1 ]; then + niReg -r %{_libdir}/libnimMockNodes.so + niReg -r %{_libdir}/libnimCodecs.so + niReg -r %{_libdir}/libnimRecorder.so +fi + + +%preun +if [ $1 == 0 ]; then + niReg -u %{_libdir}/libnimMockNodes.so + niReg -u %{_libdir}/libnimCodecs.so + niReg -u %{_libdir}/libnimRecorder.so +fi + + +%ldconfig_postun + + +%files +%doc LICENSE README NOTICE CHANGES +%dir %{_sysconfdir}/%{name} +%dir %{_var}/lib/ni +%ghost %{_var}/lib/ni/modules.xml +%{_libdir}/*.so +%{_bindir}/ni* + +%files devel +%doc Documentation/OpenNI_UserGuide.pdf +%{_includedir}/* +%{_libdir}/pkgconfig/libopenni.pc + +%files java +%{_libdir}/%{name} + +%files examples +%config(noreplace) %{_sysconfdir}/%{name}/SamplesConfig.xml +%{_bindir}/Ni* +# not packaging any .desktop files for the sample applications. The +# applications will print relevant to the console and hence they are +# intended to be run on the console, not from the menu + +%files doc +%doc Source/DoxyGen/html + + +%changelog +* Wed Dec 25 2024 Arkady L. Shane - 1.5.7.10-35 +- Rebuilt for MSVSphere 10 + +* Mon Sep 02 2024 Miroslav Suchý - 1.5.7.10-35 +- convert license to SPDX + +* Thu Jul 18 2024 Fedora Release Engineering - 1.5.7.10-34 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Feb 27 2024 Jiri Vanek - 1.5.7.10-33 +- Rebuilt for java-21-openjdk as system jdk + +* Thu Jan 25 2024 Fedora Release Engineering - 1.5.7.10-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 1.5.7.10-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 1.5.7.10-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sun Jul 02 2023 Till Hofmann - 1.5.7.10-29 +- Do not build on i686 + +* Thu Jan 19 2023 Fedora Release Engineering - 1.5.7.10-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 1.5.7.10-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Feb 05 2022 Jiri Vanek - 1.5.7.10-26 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 20 2022 Fedora Release Engineering - 1.5.7.10-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 1.5.7.10-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jan 14 21:22:42 CET 2021 Petr Viktorin - 1.5.7.10-23 +- Build with Python 3 + +* Tue Jan 26 2021 Fedora Release Engineering - 1.5.7.10-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.5.7.10-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat Jul 11 2020 Jiri Vanek - 1.5.7.10-20 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Mon Jun 01 2020 Orion Poplawski - 1.5.7.10-19 +- Add upstream patch to fix compilation with -ansi or -std + +* Wed Jan 29 2020 Fedora Release Engineering - 1.5.7.10-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Sep 17 2019 Gwyn Ciesla - 1.5.7.10-17 +- Rebuilt for new freeglut + +* Thu Jul 25 2019 Fedora Release Engineering - 1.5.7.10-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 1.5.7.10-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.5.7.10-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Mar 19 2018 Iryna Shcherbina - 1.5.7.10-13 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Thu Feb 08 2018 Fedora Release Engineering - 1.5.7.10-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 1.5.7.10-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.5.7.10-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.5.7.10-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sun Apr 17 2016 Scott K Logan - 1.5.7.10-8 +- Add patch for building with gcc6 + +* Thu Feb 04 2016 Fedora Release Engineering - 1.5.7.10-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 1.5.7.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Apr 14 2015 Ralf Corsépius - 1.5.7.10-5 +- Rebuild for gcc-5.0 (RHBZ#1211467). + +* Mon Jan 05 2015 Rich Mattes - 1.5.7.10-4 +- Fix ownership of modules.xml + +* Mon Jan 05 2015 Ralf Corsépius - 1.5.7.10-4 +- Rework openni-1.5.7.10-willow.patch (RHBZ#1178545). + +* Sun Aug 17 2014 Fedora Release Engineering - 1.5.7.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.5.7.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Jun 01 2014 Rich Mattes - 1.5.7.10-1 +- Update to release 1.5.7.10 + +* Sun Jun 01 2014 Rich Mattes - 1.5.2.23-1 +- Update to release 1.5.2.23 + +* Fri Apr 04 2014 Scott K Logan - 1.3.2.1-11 +- Fix wrong pkgconfig path + +* Fri Mar 28 2014 Michael Simacek - 1.3.2.1-10 +- Use Requires: java-headless rebuild (#1067528) + +* Wed Feb 26 2014 Scott K Logan - 1.3.2.1-9 +- Added patch and changed spec for arm support +- Added a simple pkgconfig + +* Sat Aug 03 2013 Fedora Release Engineering - 1.3.2.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.3.2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 21 2013 Adam Tkac - 1.3.2.1-6 +- rebuild due to "jpeg8-ABI" feature drop + +* Fri Dec 21 2012 Adam Tkac - 1.3.2.1-5 +- rebuild against new libjpeg + +* Fri Jul 20 2012 Fedora Release Engineering - 1.3.2.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.3.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Dec 23 2011 Tim Niemueller 1.3.2.1-2 +- Add BR graphviz + +* Thu Dec 22 2011 Tim Niemueller 1.3.2.1-1 +- Remove git suffix, we package the stable version +- Add Willow Garage and assertion silencing patches + +* Sun Dec 04 2011 Tim Niemueller 1.3.2.1-0.3.gitf8467404 +- Mark modules.xml as config file, fixes deregistering of modules on upgrade + +* Wed Oct 12 2011 Tim Niemueller 1.3.2.1-0.2.gitf8467404 +- Fix passing of opt cflags, fixes bz #735594 + +* Tue Aug 30 2011 Tim Niemueller 1.3.2.1-0.1.gitf8467404 +- Update to stable 1.3.2.1 based on patch by Anders Blomdell + +* Mon Jun 27 2011 Rex Dieter 1.0.0.25-0.5.git4c9ff978 +- ExclusiveArch: %%ix86 x86_64 (#709718) + +* Fri Feb 11 2011 Tim Niemueller - 1.0.0.25-0.4.git4c9ff978 +- Exclude ppc64, it is not supported by OpenNI + +* Tue Feb 08 2011 Tim Niemueller - 1.0.0.25-0.3.git4c9ff978 +- Rename samples subpackage to examples +- Remove bundled libraries and headers in prep stage +- Create empty modules.xml in install stage +- Do not package GPL.txt, all code is LGPL + +* Tue Feb 01 2011 Tim Niemueller - 1.0.0.25-0.2.git4c9ff978 +- Incorporate review suggestions + +* Thu Jan 20 2011 Tim Niemueller - 1.0.0.25-0.1.git4c9ff978 +- Initial revision +