summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoracxz2019-09-29 01:40:09 -0400
committeracxz2019-09-29 01:40:09 -0400
commit0e8f08494fdc46f08600ea1bbd860bb5f798be4e (patch)
tree2359ec742292304b4086a6d7b28cdcac8a0b7d40
parent7ee6e9641e89fe4e8b9ef6d6f5396961082f92c6 (diff)
downloadaur-0e8f08494fdc46f08600ea1bbd860bb5f798be4e.tar.gz
update and add patches from git version
-rw-r--r--.SRCINFO38
-rw-r--r--0002-Change-path-of-config-files-to-etc-openni2.patch31
-rw-r--r--0003-Use-system-wide-libjpeg.patch97
-rw-r--r--0005-change-default-ni-drivers-path.patch11
-rw-r--r--0013-Fix-GCC6-compilation.patch190
-rw-r--r--0014-fix-format-overflow-for-GCC7.patch37
-rw-r--r--0015-Initialize-variable-for-gcc7.patch21
-rw-r--r--PKGBUILD141
-rw-r--r--libopenni2.pc4
9 files changed, 503 insertions, 67 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 55efaec82d74..93689401af77 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,35 @@
-# Generated by mksrcinfo v8
-# Sun Jul 17 19:08:05 UTC 2016
pkgbase = openni2
- pkgdesc = Open source SDK used for the development of 3D sensing middleware libraries and applications
- pkgver = 2.2beta2
- pkgrel = 6
- url = https://github.com/occipital/OpenNI2
+ pkgdesc = Framework for sensor-based Natural Interaction
+ pkgver = 2.2.0
+ pkgrel = 1
+ url = https://github.com/occipital/OpenNI2/
arch = i686
arch = x86_64
- license = Apache
+ license = Apache-2.0
+ makedepends = python
makedepends = doxygen
- makedepends = java-environment
- makedepends = freeglut
+ makedepends = graphviz
+ depends = freeglut
depends = glu
- source = https://github.com/occipital/OpenNI2/archive/2.2-beta2.tar.gz
+ depends = libusb
+ depends = java-environment
+ depends = libjpeg-turbo
+ source = https://github.com/occipital/OpenNI2/archive/v2.2.0-debian.tar.gz
+ source = 0002-Change-path-of-config-files-to-etc-openni2.patch
+ source = 0003-Use-system-wide-libjpeg.patch
+ source = 0005-change-default-ni-drivers-path.patch
+ source = 0013-Fix-GCC6-compilation.patch
+ source = 0014-fix-format-overflow-for-GCC7.patch
+ source = 0015-Initialize-variable-for-gcc7.patch
source = libopenni2.pc
- md5sums = 3f2cd6a64776821fb2837c442539f65b
- md5sums = 37b0b6a6932f94269fdff88ace4d8844
+ sha256sums = 08f6842f20d1098ab2ebafadaac0130ffae5abd34cdf464bb6100cbe01ed95a8
+ sha256sums = 368c0b41a26a65377359ce22a914cb8b6f4020e2972f67f151f2b9bdbf1a5a50
+ sha256sums = 1ca20e60ac10a193cbf0ca4759230ba7930479baa7d237476583359e7b62f604
+ sha256sums = 635c762230a2dc57977c7f42cc7d1c25438d3864baca7632360466e8c031e3b5
+ sha256sums = 0fd53b2c41a48cb4b28e67c6cfcedf4d17ffbe675bd2eb21793a683bbb0d85bb
+ sha256sums = 05e95ab2375294a37354dab5ed746ff5c6de6e5ed1792ad398f489d6d35af93e
+ sha256sums = 196128c92803cbfaa67643703e043247475b6c718af8cd9b4333806d2e04d762
+ sha256sums = 57c9236c77133437a533d3cac6775da4749a070dd468e88e29b07d7a83aaaab1
pkgname = openni2
diff --git a/0002-Change-path-of-config-files-to-etc-openni2.patch b/0002-Change-path-of-config-files-to-etc-openni2.patch
new file mode 100644
index 000000000000..e624f75ad030
--- /dev/null
+++ b/0002-Change-path-of-config-files-to-etc-openni2.patch
@@ -0,0 +1,31 @@
+From: Hauke Wintjen <hwintjen@rimpl-consulting.de>
+Date: Fri, 29 Mar 2013 21:16:28 +0100
+Subject: Change path of config files to /etc/openni2
+
+---
+ Source/Drivers/PS1080/Sensor/XnSensor.cpp | 2 +-
+ Source/Tools/NiViewer/NiViewer.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Source/Tools/NiViewer/NiViewer.cpp
++++ b/Source/Tools/NiViewer/NiViewer.cpp
+@@ -96,7 +96,7 @@
+ // --------------------------------
+ // Defines
+ // --------------------------------
+-#define SAMPLE_XML_PATH "../../../../Data/SamplesConfig.xml"
++#define SAMPLE_XML_PATH "/etc/openni2/SamplesConfig.xml"
+
+ // --------------------------------
+ // Types
+--- a/Source/Core/OniContext.cpp
++++ b/Source/Core/OniContext.cpp
+@@ -23,7 +23,7 @@
+ #include <XnLog.h>
+ #include <XnOSCpp.h>
+
+-static const char* ONI_CONFIGURATION_FILE = "OpenNI.ini";
++static const char* ONI_CONFIGURATION_FILE = "/etc/openni2/OpenNI.ini";
+ static const char* ONI_DEFAULT_DRIVERS_REPOSITORY = "OpenNI2" XN_FILE_DIR_SEP "Drivers";
+
+ #define XN_MASK_ONI_CONTEXT "OniContext"
diff --git a/0003-Use-system-wide-libjpeg.patch b/0003-Use-system-wide-libjpeg.patch
new file mode 100644
index 000000000000..37b3d118891f
--- /dev/null
+++ b/0003-Use-system-wide-libjpeg.patch
@@ -0,0 +1,97 @@
+From: Hauke Wintjen <hwintjen@rimpl-consulting.de>
+Date: Fri, 29 Mar 2013 22:21:36 +0100
+Subject: Use system wide libjpeg
+
+---
+ Source/Core/Makefile | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/Source/Core/Makefile
++++ b/Source/Core/Makefile
+@@ -5,14 +5,12 @@
+ INC_DIRS = \
+ ../../Include \
+ ../../ThirdParty/PSCommon/XnLib/Include \
+- ../Drivers/OniFile/Formats \
+- ../../ThirdParty/LibJPEG
++ ../Drivers/OniFile/Formats
+
+ SRC_FILES = \
+ *.cpp \
+ ../Drivers/OniFile/Formats/XnCodec.cpp \
+- ../Drivers/OniFile/Formats/XnStreamCompression.cpp \
+- ../../ThirdParty/LibJPEG/*.c \
++ ../Drivers/OniFile/Formats/XnStreamCompression.cpp
+
+ ifeq ("$(OSTYPE)","Darwin")
+ INC_DIRS += /opt/local/include
+@@ -23,7 +21,7 @@
+ LIB_NAME = OpenNI2
+
+ LIB_DIRS = ../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
+-USED_LIBS = XnLib dl pthread
++USED_LIBS = XnLib dl pthread jpeg
+ ifneq ("$(OSTYPE)","Darwin")
+ USED_LIBS += rt
+ endif
+@@ -32,4 +30,11 @@
+
+ CFLAGS += -Wall
+
++ifeq ($(shell ld -ljpeg -o /dev/null 1>&2 2> /dev/null; echo $$?), 0)
++ USED_LIBS += jpeg
++else
++ INC_DIRS += ../../ThirdParty/LibJPEG
++ SRC_FILES += ../../ThirdParty/LibJPEG/*.c
++endif
++
+ include ../../ThirdParty/PSCommon/BuildSystem/CommonCppMakefile
+--- a/Source/Drivers/OniFile/Makefile
++++ b/Source/Drivers/OniFile/Makefile
+@@ -6,15 +6,12 @@
+ . \
+ ../../../Include \
+ ../../../ThirdParty/PSCommon/XnLib/Include \
+- ../../../ThirdParty/LibJPEG \
+ Formats
+
+ SRC_FILES = \
+ *.cpp \
+ Formats/*.cpp \
+- XnLibExtensions/*.cpp \
+- ../../../ThirdParty/LibJPEG/*.c
+-
++ XnLibExtensions/*.cpp
+
+ ifeq ("$(OSTYPE)","Darwin")
+ INC_DIRS += /opt/local/include
+@@ -25,7 +22,7 @@
+ LIB_NAME = OniFile
+
+ LIB_DIRS = ../../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
+-USED_LIBS = XnLib pthread
++USED_LIBS = XnLib pthread jpeg
+ ifneq ("$(OSTYPE)","Darwin")
+ USED_LIBS += rt
+ endif
+--- a/Source/Drivers/PS1080/Makefile
++++ b/Source/Drivers/PS1080/Makefile
+@@ -16,8 +16,7 @@
+ DriverImpl/*.cpp\
+ Formats/*.cpp \
+ Include/*.cpp \
+- Sensor/*.cpp \
+- ../../../ThirdParty/LibJPEG/*.c
++ Sensor/*.cpp
+
+
+ ifeq ("$(OSTYPE)","Darwin")
+@@ -30,7 +29,7 @@
+
+ LIB_DIRS += ../../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
+ LIB_DIRS += $(BIN_DIR)/$(PLATFORM)-$(CFG)
+-USED_LIBS = XnLib dl pthread DepthUtils
++USED_LIBS = XnLib dl pthread DepthUtils jpeg
+ ifneq ("$(OSTYPE)","Darwin")
+ USED_LIBS += rt usb-1.0 udev
+ else
diff --git a/0005-change-default-ni-drivers-path.patch b/0005-change-default-ni-drivers-path.patch
new file mode 100644
index 000000000000..63008d33246c
--- /dev/null
+++ b/0005-change-default-ni-drivers-path.patch
@@ -0,0 +1,11 @@
+--- a/Source/Core/OniContext.cpp
++++ b/Source/Core/OniContext.cpp
+@@ -24,7 +24,7 @@
+ #include <XnOSCpp.h>
+
+ static const char* ONI_CONFIGURATION_FILE = "/etc/openni2/OpenNI.ini";
+-static const char* ONI_DEFAULT_DRIVERS_REPOSITORY = "OpenNI2" XN_FILE_DIR_SEP "Drivers";
++static const char* ONI_DEFAULT_DRIVERS_REPOSITORY = "/usr/lib/" "OpenNI2" XN_FILE_DIR_SEP "Drivers";
+
+ #define XN_MASK_ONI_CONTEXT "OniContext"
+
diff --git a/0013-Fix-GCC6-compilation.patch b/0013-Fix-GCC6-compilation.patch
new file mode 100644
index 000000000000..8227c97fd89b
--- /dev/null
+++ b/0013-Fix-GCC6-compilation.patch
@@ -0,0 +1,190 @@
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+Date: Sat, 23 Jan 2016 15:56:22 +0100
+Subject: Fix GCC6 compilation
+
+* Ignore Warray-bounds
+* Rename equivalent to fix compilation on gcc6
+* Fix -Werror=misleading-indentation
+---
+ Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp | 3 ++
+ ThirdParty/GL/glh/glh_glut2.h | 2 +-
+ ThirdParty/GL/glh/glh_linear.h | 66 +++++++++++------------
+ 3 files changed, 37 insertions(+), 34 deletions(-)
+
+diff --git a/Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp b/Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp
+index 120534c..7759333 100644
+--- a/Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp
++++ b/Source/Drivers/PS1080/Formats/XnFormatsMirror.cpp
+@@ -26,6 +26,8 @@
+ #include "XnFormats.h"
+ #include <XnOS.h>
+ #include <XnLog.h>
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Warray-bounds"
+
+ //---------------------------------------------------------------------------
+ // Defines
+@@ -240,3 +242,4 @@ XnStatus XnFormatsMirrorPixelData(OniPixelFormat nOutputFormat, XnUChar* pBuffer
+ return XN_STATUS_ERROR;
+ }
+ }
++#pragma GCC diagnostic pop
+diff --git a/ThirdParty/GL/glh/glh_glut2.h b/ThirdParty/GL/glh/glh_glut2.h
+index 908a0fc..0430698 100644
+--- a/ThirdParty/GL/glh/glh_glut2.h
++++ b/ThirdParty/GL/glh/glh_glut2.h
+@@ -190,7 +190,7 @@ namespace glh
+ {
+ if (interactors.empty())
+ return;
+- std::list<glut_interactor *>::iterator it =
++ std::list<glut_interactor *>::iterator it =
+ std::find(interactors.begin(), interactors.end(), gi);
+ if(it != interactors.end())
+ interactors.erase(it);
+diff --git a/ThirdParty/GL/glh/glh_linear.h b/ThirdParty/GL/glh/glh_linear.h
+index 422c05f..2e033ba 100644
+--- a/ThirdParty/GL/glh/glh_linear.h
++++ b/ThirdParty/GL/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
+ {
+@@ -225,7 +225,7 @@ namespace glh
+ for(int i = 0; i < N; i++)
+ if(v1.v[i] != v2.v[i])
+ return false;
+- return true;
++ return true;
+ }
+
+ template <int N, class T> inline
+@@ -633,7 +633,7 @@ namespace glh
+ scp[i] = real(fabs(s[i][0]));
+ for(j=1;j<4;j++)
+ if(real(fabs(s[i][j])) > scp[i]) scp[i] = real(fabs(s[i][j]));
+- if(scp[i] == 0.0) return minv; // singular matrix!
++ if(scp[i] == 0.0) return minv; // singular matrix!
+ }
+
+ int pivot_to;
+@@ -647,26 +647,26 @@ namespace glh
+ for(p=i+1;p<4;p++)
+ if(real(fabs(s[p][i]/scp[p])) > scp_max)
+ { scp_max = real(fabs(s[p][i]/scp[p])); pivot_to = p; }
+- // Pivot if necessary
+- if(pivot_to != i)
+- {
+- tmprow = s[i];
+- s[i] = s[pivot_to];
+- s[pivot_to] = tmprow;
+- real tmpscp;
+- tmpscp = scp[i];
+- scp[i] = scp[pivot_to];
+- scp[pivot_to] = tmpscp;
+- }
+-
+- real mji;
+- // perform gaussian elimination
+- for(j=i+1;j<4;j++)
+- {
+- mji = s[j][i]/s[i][i];
+- s[j][i] = 0.0;
+- for(jj=i+1;jj<8;jj++)
+- s[j][jj] -= mji*s[i][jj];
++ // Pivot if necessary
++ if(pivot_to != i)
++ {
++ tmprow = s[i];
++ s[i] = s[pivot_to];
++ s[pivot_to] = tmprow;
++ real tmpscp;
++ tmpscp = scp[i];
++ scp[i] = scp[pivot_to];
++ scp[pivot_to] = tmpscp;
++ }
++
++ real mji;
++ // perform gaussian elimination
++ for(j=i+1;j<4;j++)
++ {
++ mji = s[j][i]/s[i][i];
++ s[j][i] = 0.0;
++ for(jj=i+1;jj<8;jj++)
++ s[j][jj] -= mji*s[i][jj];
+ }
+ }
+ if(s[3][3] == 0.0) return minv; // singular matrix!
+@@ -702,7 +702,7 @@ namespace glh
+ for(j=0;j<4;j++)
+ minv(i,j) = s[i][j+4] / s[i][i];
+
+- return minv;
++ return minv;
+ }
+
+
+@@ -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/0014-fix-format-overflow-for-GCC7.patch b/0014-fix-format-overflow-for-GCC7.patch
new file mode 100644
index 000000000000..98c3922a8940
--- /dev/null
+++ b/0014-fix-format-overflow-for-GCC7.patch
@@ -0,0 +1,37 @@
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+Date: Tue, 7 Feb 2017 17:30:41 +0100
+Subject: fix format-overflow for GCC7
+
+---
+ Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp | 4 ++--
+ Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp b/Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp
+index 9663e41..62cf1c7 100644
+--- a/Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp
++++ b/Source/Drivers/PS1080/Sensor/XnFrameStreamProcessor.cpp
+@@ -40,8 +40,8 @@ XnFrameStreamProcessor::XnFrameStreamProcessor(XnFrameStream* pStream, XnSensorS
+ m_nLastSOFPacketID(0),
+ m_nFirstPacketTimestamp(0)
+ {
+- sprintf(m_csInDumpMask, "%sIn", pStream->GetType());
+- sprintf(m_csInternalDumpMask, "Internal%s", pStream->GetType());
++ snprintf(m_csInDumpMask, 100, "%.90sIn", pStream->GetType());
++ snprintf(m_csInternalDumpMask, 100, "Internal%.90s", pStream->GetType());
+ m_InDump = xnDumpFileOpen(m_csInDumpMask, "%s_0.raw", m_csInDumpMask);
+ m_InternalDump = xnDumpFileOpen(m_csInternalDumpMask, "%s_0.raw", m_csInternalDumpMask);
+ }
+diff --git a/Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp b/Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp
+index f93f333..d962ec0 100644
+--- a/Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp
++++ b/Source/Drivers/PS1080/Sensor/XnSensorFirmwareParams.cpp
+@@ -263,7 +263,7 @@ XnStatus XnSensorFirmwareParams::AddFirmwareParam(XnActualIntProperty& Property,
+ XN_IS_STATUS_OK(nRetVal);
+
+ XnChar csNewName[XN_DEVICE_MAX_STRING_LENGTH];
+- sprintf(csNewName, "%s (%d)", Property.GetName(), nFirmwareParam);
++ snprintf(csNewName, XN_DEVICE_MAX_STRING_LENGTH, "%.150s (%d)", Property.GetName(), nFirmwareParam);
+
+ Property.UpdateName("Firmware", csNewName);
+ Property.SetLogSeverity(XN_LOG_VERBOSE);
diff --git a/0015-Initialize-variable-for-gcc7.patch b/0015-Initialize-variable-for-gcc7.patch
new file mode 100644
index 000000000000..321f0e1580e0
--- /dev/null
+++ b/0015-Initialize-variable-for-gcc7.patch
@@ -0,0 +1,21 @@
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+Date: Tue, 8 Aug 2017 22:53:14 +0200
+Subject: Initialize variable for gcc7
+
+---
+ Source/Tools/NiViewer/Device.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/Tools/NiViewer/Device.cpp b/Source/Tools/NiViewer/Device.cpp
+index 28cbfee..7037320 100644
+--- a/Source/Tools/NiViewer/Device.cpp
++++ b/Source/Tools/NiViewer/Device.cpp
+@@ -364,7 +364,7 @@ void toggleMirror(int )
+
+ void toggleCloseRange(int )
+ {
+- bool bCloseRange;
++ bool bCloseRange = false;
+ g_depthStream.getProperty(XN_STREAM_PROPERTY_CLOSE_RANGE, &bCloseRange);
+
+ bCloseRange = !bCloseRange;
diff --git a/PKGBUILD b/PKGBUILD
index 955ad329c03b..327c6dd0e021 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,74 +1,109 @@
+# Maintainer: acxz<akashpatel2008 at yahoo dot com>
# Contributor: Christian Bühler <christian.buehler@ipoplan.de>
+
pkgname=openni2
-pkgver=2.2beta2
-_pkgver=2.2-beta2
-pkgrel=6
-pkgdesc="Open source SDK used for the development of 3D sensing middleware libraries and applications"
+pkgver=2.2.0
+_srcname=OpenNI2-${pkgver}-debian
+pkgrel=1
+pkgdesc='Framework for sensor-based Natural Interaction'
arch=('i686' 'x86_64')
-url="https://github.com/occipital/OpenNI2"
-license=('Apache')
-depends=(glu)
-makedepends=(doxygen java-environment freeglut)
-source=(https://github.com/occipital/OpenNI2/archive/${_pkgver}.tar.gz
- libopenni2.pc)
-md5sums=('3f2cd6a64776821fb2837c442539f65b'
- '37b0b6a6932f94269fdff88ace4d8844')
+url='https://github.com/occipital/OpenNI2/'
+license=('Apache-2.0')
+depends=('freeglut' 'glu' 'libusb' 'java-environment' 'libjpeg-turbo')
+makedepends=('python' 'doxygen' 'graphviz')
+source=("https://github.com/occipital/OpenNI2/archive/v${pkgver}-debian.tar.gz"
+ '0002-Change-path-of-config-files-to-etc-openni2.patch'
+ '0003-Use-system-wide-libjpeg.patch'
+ '0005-change-default-ni-drivers-path.patch'
+ '0013-Fix-GCC6-compilation.patch'
+ '0014-fix-format-overflow-for-GCC7.patch'
+ '0015-Initialize-variable-for-gcc7.patch'
+ 'libopenni2.pc')
+sha256sums=('08f6842f20d1098ab2ebafadaac0130ffae5abd34cdf464bb6100cbe01ed95a8'
+ '368c0b41a26a65377359ce22a914cb8b6f4020e2972f67f151f2b9bdbf1a5a50'
+ '1ca20e60ac10a193cbf0ca4759230ba7930479baa7d237476583359e7b62f604'
+ '635c762230a2dc57977c7f42cc7d1c25438d3864baca7632360466e8c031e3b5'
+ '0fd53b2c41a48cb4b28e67c6cfcedf4d17ffbe675bd2eb21793a683bbb0d85bb'
+ '05e95ab2375294a37354dab5ed746ff5c6de6e5ed1792ad398f489d6d35af93e'
+ '196128c92803cbfaa67643703e043247475b6c718af8cd9b4333806d2e04d762'
+ '57c9236c77133437a533d3cac6775da4749a070dd468e88e29b07d7a83aaaab1')
-if [ "${CARCH}" = "x86_64" ]; then
- _platform=x64
-elif [ "${CARCH}" = "i686" ]; then
- _platform=x86
-else
- _platform=Arm
-fi
+prepare() {
+ cd "$_srcname"
-_cfg=Release
+ # fix building documentation with java 8
+ # https://github.com/OpenNI/OpenNI2/issues/87
+ local _javaver
+ _javaver="$(archlinux-java get | grep -o '^[^-]*.[0-9]*')"
+ if [ "$(vercmp "$_javaver" java-8)" -ge '0' ]
+ then
+ sed -i "s/cmd = \[javaDocExe, '-d', 'java'\]/cmd = [javaDocExe, '-d', 'java', '-Xdoclint:none']/" Source/Documentation/Runme.py
+ fi
-prepare() {
- cd "${srcdir}/OpenNI2-${_pkgver}"
- sed -i s%-mfloat-abi=softfp%% ThirdParty/PSCommon/BuildSystem/Platform.Arm
-
- # https://github.com/OpenNI/OpenNI2/issues/87
- if [[ `java -version 2>&1` == *1.8* ]]
- then
- sed -i "s/cmd = \[javaDocExe, '-d', 'java'\]/cmd = [javaDocExe, '-d', 'java', '-Xdoclint:none']/" Source/Documentation/Runme.py
- fi
+ # apply patches
+ patch -Np1 -i "${srcdir}/0002-Change-path-of-config-files-to-etc-openni2.patch"
+ patch -Np1 -i "${srcdir}/0003-Use-system-wide-libjpeg.patch"
+ patch -Np1 -i "${srcdir}/0005-change-default-ni-drivers-path.patch"
+ patch -Np1 -i "${srcdir}/0013-Fix-GCC6-compilation.patch"
+ patch -Np1 -i "${srcdir}/0014-fix-format-overflow-for-GCC7.patch"
+ patch -Np1 -i "${srcdir}/0015-Initialize-variable-for-gcc7.patch"
}
build() {
- cd "${srcdir}/OpenNI2-${_pkgver}"
- LDFLAGS+=" -pthread -lc"
- make CFG=${_cfg} ALLOW_WARNINGS=1
- make doc
+ cd "$_srcname"
+ make
+ make doc
}
package() {
- install -d -m755 "${pkgdir}/etc/ld.so.conf.d"
- echo /usr/lib/OpenNI2/Drivers > "${pkgdir}/etc/ld.so.conf.d/openni2.conf"
+ [ "$CARCH" = 'x86_64' ] && local _architecture='x64'
+ [ "$CARCH" = 'i686' ] && local _architecture='x86'
- cp -r "${srcdir}/OpenNI2-${_pkgver}/Config" "${pkgdir}/etc/OpenNI2"
+ # directories creation
+ mkdir -p "${pkgdir}/usr/"{bin,include/openni2/{Driver,Linux-Arm,Linux-x86}}
+ mkdir -p "${pkgdir}/usr/lib/"{OpenNI2/Drivers,pkgconfig}
+ mkdir -p "${pkgdir}/usr/share/"{doc/"${pkgname}",licenses/"${pkgname}"}
+ mkdir -p "${pkgdir}/usr/lib/udev/rules.d" # usb rules (udev rules)
+ mkdir -p "${pkgdir}/etc/openni2/Drivers" # config
- install -d -m755 "${pkgdir}/usr/"{bin,lib/OpenNI2/Drivers,share/doc/OpenNI2}
+ # binaries and libraries
+ cd "${_srcname}/Bin/${_architecture}-Release"
+ install -m755 NiViewer "${pkgdir}/usr/bin/NiViewer2"
+ install -D -m755 ClosestPointViewer "${pkgdir}/usr/bin"
+ install -D -m755 EventBasedRead "${pkgdir}/usr/bin"
+ install -D -m755 Multi* "${pkgdir}/usr/bin"
+ install -D -m755 MWClosestPointApp "${pkgdir}/usr/bin"
+ install -D -m755 PS* "${pkgdir}/usr/bin"
+ install -D -m755 Simple* "${pkgdir}/usr/bin"
+ install -D -m755 *.so "${pkgdir}/usr/lib"
+ install -D -m755 OpenNI2/Drivers/*.so "${pkgdir}/usr/lib/OpenNI2/Drivers"
- cp -r "${srcdir}/OpenNI2-${_pkgver}/Include" "${pkgdir}/usr/include"
+ # includes
+ cd "${srcdir}/${_srcname}/Include"
+ install -D -m644 *.h "${pkgdir}/usr/include/openni2"
+ install -D -m644 Driver/* "${pkgdir}/usr/include/openni2/Driver"
+ install -D -m644 Linux-Arm/* "${pkgdir}/usr/include/openni2/Linux-Arm"
+ install -D -m644 Linux-x86/* "${pkgdir}/usr/include/openni2/Linux-x86"
- cd "${srcdir}/OpenNI2-${_pkgver}/Bin/${_platform}-${_cfg}"
- install *.so "${pkgdir}/usr/lib"
- install ClosestPointViewer EventBasedRead MultiDepthViewer MultipleStreamRead MWClosestPointApp NiViewer PS1080Console PSLinkConsole SimpleRead SimpleViewer "${pkgdir}/usr/bin"
+ # udev rules
+ cd "${srcdir}/${_srcname}/Packaging/Linux"
+ install -m644 primesense-usb.rules "${pkgdir}/usr/lib/udev/rules.d/60-openni2-usb.rules"
- cd "${srcdir}/OpenNI2-${_pkgver}/Bin/${_platform}-${_cfg}/OpenNI2/Drivers"
- install *.so "${pkgdir}/usr/lib/OpenNI2/Drivers"
+ # config
+ cd "${srcdir}/${_srcname}/Config"
+ install -D -m644 *.ini "${pkgdir}/etc/openni2"
+ install -D -m644 OpenNI2/Drivers/* "${pkgdir}/etc/openni2/Drivers"
- cd "${srcdir}/OpenNI2-${_pkgver}/Source/Documentation/html"
- install * "${pkgdir}/usr/share/doc/OpenNI2"
+ # documentation
+ cd "${srcdir}/${_srcname}/Source/Documentation/html"
+ install -D -m644 * "${pkgdir}/usr/share/doc/${pkgname}"
- cd "${srcdir}/OpenNI2-${_pkgver}/Packaging/Linux"
- sed -i s%/etc/udev/rules.d/%${pkgdir}/etc/udev/rules.d/% install.sh
- install -d -m755 "${pkgdir}/etc/udev/rules.d"
- sh install.sh
+ # pkg-config file
+ cd "$srcdir"
+ install -D -m644 libopenni2.pc "${pkgdir}/usr/lib/pkgconfig"
- install -d -m755 "${pkgdir}/usr/lib/pkgconfig"
- cp "${srcdir}/libopenni2.pc" "${pkgdir}/usr/lib/pkgconfig/"
+ # license
+ cd "$_srcname"
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 NOTICE "${pkgdir}/usr/share/licenses/${pkgname}"
}
-
-# vim:set ts=2 sw=2 et:
diff --git a/libopenni2.pc b/libopenni2.pc
index 56b72ccb1611..7da42efa01f1 100644
--- a/libopenni2.pc
+++ b/libopenni2.pc
@@ -3,8 +3,8 @@ exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/openni2
-Name: OpenNI2
+Name: openni2
Description: A general purpose driver for all OpenNI cameras.
-Version: 2.2.beta2
+Version: 2.2.0
Cflags: -I${includedir}
Libs: -L${libdir} -lOpenNI2