summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2017-02-28 00:47:16 -0300
committerDaniel Bermond2017-02-28 00:47:16 -0300
commitbe35346318aee8b1544b83553e669760a9945ac6 (patch)
treec495e0b5fa83de6f29b675295aad458fbdf0867e
parentcc91c9cf3e258720f1df9a60b3d24bbf890721de (diff)
downloadaur-be35346318aee8b1544b83553e669760a9945ac6.tar.gz
Fixed compilation with gcc6. Major rewrite.
First commit after adoption. This package needed a major rewrite as follows: 1) description: a) removed the reference to $pkgname to avoid namcap complain. b) updated description. 2) url: Changed URL to the GitHub one since openni.org is redirecting to apple.com. 3) license: changed from GPL to APACHE as it is the correct one. 4) depends: a) added missed glu dependency (build fails in chroot). b) since both freeglut and glu triggers mesa installation, mesa can be removed. 5) makedepends: added dos2unix. See item 7 - prepare(). 6) source: source was a clone of the upstream git repository but this is not a git package (no -git in the name), so it was not making making sense to do a git clone. Changed this to a plain zip download. Please note that it will use the stable version. 7) prepare(): added this function to apply a patch from Debian that fixes building with gcc6. It was necessary to use dos2unix since the source has Windows line endings. 8) build(): a) removed the steps that were being made before running make. I could not identify any difference without them. b) removed the -lGL flag as it is already added by the building process. 9) package(): a) code rewrite, now cleaner IMHO and commented. b) changed the config directory from /usr/share/openni to /etc/openni as used by Debian. c) removed the installation of all Sample binaries because they seem to be useless. d) added installation of documentation (pre-built pdf and chm). e) added installation of the APACHE license and the file with copyright. 10) install file: a) added mention of openni-primesense-sensor. b) changed mention of sensorkinect-git (removed from AUR) to sensorkinect. 11) pkg-config file: a) changed name from OpenNI2 to openni. b) updated description. 12) readability and cosmetics: a) changed indentation from 2 to 4 spaces. b) changed $_platform variable to $_architecture.
-rw-r--r--.SRCINFO22
-rw-r--r--0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch81
-rw-r--r--PKGBUILD113
-rw-r--r--libopenni.pc4
-rw-r--r--openni.install2
5 files changed, 160 insertions, 62 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 86b67744684..03eaaee9af8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,25 @@
# Generated by mksrcinfo v8
-# Thu Dec 10 19:02:06 UTC 2015
+# Tue Feb 28 03:46:22 UTC 2017
pkgbase = openni
- pkgdesc = The OpenNI Framework provides the interface for physical devices and for middleware components
+ pkgdesc = An interface for physical devices and for middleware components
pkgver = 1.5.7.10
- pkgrel = 2
- url = http://www.openni.org/
+ pkgrel = 3
+ url = https://github.com/OpenNI/OpenNI/
install = openni.install
arch = i686
arch = x86_64
- license = GPL
- makedepends = git
+ license = APACHE
+ makedepends = dos2unix
depends = freeglut
- depends = mesa
+ depends = glu
depends = libusb
depends = java-environment
- source = openni-build::git+https://github.com/OpenNI/OpenNI.git#tag=Stable-1.5.7.10
+ source = OpenNI-Stable-1.5.7.10.tar.gz::https://github.com/OpenNI/OpenNI/archive/Stable-1.5.7.10.tar.gz
+ source = 0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch
source = libopenni.pc
- md5sums = SKIP
- md5sums = 846a9b0be1dbee5f1d4619db42034978
+ sha256sums = 34b0bbf68633bb213dcb15408f979d5384bdceb04e151fa519e107a12e225852
+ sha256sums = 69cbbde667d2ad18bfb3e9933bda05d0cae36d575a4082912bbc42b7c754cd8c
+ sha256sums = 90b67ed122eb33df96d9935421d79b620f87e791d8773e00c1406ebafd01a364
pkgname = openni
diff --git a/0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch b/0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch
new file mode 100644
index 00000000000..bdb71f9f951
--- /dev/null
+++ b/0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch
@@ -0,0 +1,81 @@
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+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/PKGBUILD b/PKGBUILD
index 8dbe63722d7..04d8bf7bb50 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,63 +1,78 @@
-# Maintainer: Benjamin Chretien <chretien at lirmm dot fr>
+# Maintainer : Daniel Bermond < yahoo-com: danielbermond >
+# Contributor: Benjamin Chretien <chretien at lirmm dot fr>
# Contributor: Sven Schneider <archlinux.sandmann@googlemail.com>
# Contributor: bugix
# Contributor: Lubosz Sarnecki <lubosz at gmail>
pkgname=openni
pkgver=1.5.7.10
-pkgrel=2
-pkgdesc="The OpenNI Framework provides the interface for physical devices and for middleware components"
+pkgrel=3
+pkgdesc="An interface for physical devices and for middleware components"
arch=('i686' 'x86_64')
-url="http://www.openni.org/"
-license=('GPL')
-depends=('freeglut' 'mesa' 'libusb' 'java-environment')
-makedepends=('git')
-install="openni.install"
-
-_gitroot="github.com/OpenNI/OpenNI.git"
-_gitname="openni"
-_gitbranch="Stable"
-
-source=("$_gitname-build"::"git+https://$_gitroot"#tag=$_gitbranch-$pkgver
- "libopenni.pc")
-md5sums=('SKIP'
- '846a9b0be1dbee5f1d4619db42034978')
-
-if [ "${CARCH}" = "x86_64" ]; then
- _platform=x64
-else
- _platform=x86
-fi
+url="https://github.com/OpenNI/OpenNI/"
+license=('APACHE')
+depends=('freeglut' 'glu' 'libusb' 'java-environment')
+makedepends=('dos2unix')
+install="${pkgname}.install"
+_srcprefix="OpenNI-Stable"
+source=("${_srcprefix}-${pkgver}.tar.gz"::"https://github.com/OpenNI/OpenNI/archive/Stable-${pkgver}.tar.gz"
+ '0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch'
+ 'libopenni.pc')
+sha256sums=('34b0bbf68633bb213dcb15408f979d5384bdceb04e151fa519e107a12e225852'
+ '69cbbde667d2ad18bfb3e9933bda05d0cae36d575a4082912bbc42b7c754cd8c'
+ '90b67ed122eb33df96d9935421d79b620f87e791d8773e00c1406ebafd01a364')
+prepare() {
+ cd "${srcdir}/${_srcprefix}-${pkgver}"
+ dos2unix Samples/NiViewer/glh/glh_linear.h
+ patch -Np1 -i "${srcdir}/0016-Rename-equivalent-to-fix-compilation-on-gcc6.patch"
+}
build() {
- find "${srcdir}/${_gitname}-build/Samples" -type f -exec sed -i 's#../../../../Data/SamplesConfig.xml#/usr/share/openni/SamplesConfig.xml#g' {} \;
-
- cd "${srcdir}/${_gitname}-build/Platform/Linux/Build"
-
- if [ -f Common ]; then ln -fs `cat Common` Common; fi
-
- # BUILD
- LDFLAGS+=' -lGL' make
+ cd "${srcdir}/${_srcprefix}-${pkgver}/Platform/Linux/Build"
+ make
}
package() {
- install -d -m755 "${pkgdir}/usr/"{lib,bin,share/openni,include/ni/Linux-x86}
- install -d -m755 "${pkgdir}/var/lib/ni"
-
- cd "${srcdir}/${_gitname}-build/Include"
- install *.h "${pkgdir}/usr/include/ni"
- install Linux-x86/* "${pkgdir}/usr/include/ni/Linux-x86"
-
- cd "${srcdir}/${_gitname}-build/Data"
- install SamplesConfig.xml "${pkgdir}/usr/share/openni"
-
- cd "${srcdir}/${_gitname}-build/Platform/Linux/Bin/${_platform}-Release"
- install niLicense niReg "${pkgdir}/usr/bin"
- install Sample* "${pkgdir}/usr/bin"
-
- install libnimCodecs.so libnimMockNodes.so libnimRecorder.so libOpenNI.so libOpenNI.jni.so "${pkgdir}/usr/lib"
-
- install -d -m755 "${pkgdir}/usr/lib/pkgconfig"
- cp "${srcdir}/libopenni.pc" "${pkgdir}/usr/lib/pkgconfig/"
+ if [ "${CARCH}" = "x86_64" ]
+ then
+ _architecture="x64"
+ elif [ "${CARCH}" = "i686" ]
+ then
+ _architecture="x86"
+ fi
+
+ # directories creation
+ mkdir -p "${pkgdir}/usr/"{bin,include/ni/{Linux-Arm,Linux-x86}}
+ mkdir -p "${pkgdir}/usr/"{lib/pkgconfig,share/{doc/"${pkgname}",licenses/"${pkgname}"}}
+ mkdir -p "${pkgdir}/etc/openni" # config (populated at build time)
+ mkdir -p "${pkgdir}/var/lib/ni" # config (populated at install time)
+
+ # binaries and libraries
+ cd "${srcdir}/${_srcprefix}-${pkgver}/Platform/Linux/Bin/${_architecture}-Release"
+ install -D -m755 niLicense niReg NiViewer "${pkgdir}/usr/bin"
+ install -D -m755 *.so "${pkgdir}/usr/lib"
+
+ # includes
+ cd "${srcdir}/${_srcprefix}-${pkgver}/Include"
+ install -D -m644 *.h "${pkgdir}/usr/include/ni"
+ install -D -m755 Linux-Arm/* "${pkgdir}/usr/include/ni/Linux-Arm"
+ install -D -m755 Linux-x86/* "${pkgdir}/usr/include/ni/Linux-x86"
+
+ # config
+ cd "${srcdir}/${_srcprefix}-${pkgver}/Data"
+ install -D -m644 SamplesConfig.xml "${pkgdir}/etc/openni"
+
+ # pkg-config file
+ cd "$srcdir"
+ install -D -m644 libopenni.pc "${pkgdir}/usr/lib/pkgconfig"
+
+ # documentation
+ cd "${srcdir}/${_srcprefix}-${pkgver}/Documentation"
+ install -D -m644 * "${pkgdir}/usr/share/doc/${pkgname}"
+
+ # license
+ cd "${srcdir}/${_srcprefix}-${pkgver}"
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 NOTICE "${pkgdir}/usr/share/licenses/${pkgname}"
}
diff --git a/libopenni.pc b/libopenni.pc
index 5a9b1267a1a..5d3efc07820 100644
--- a/libopenni.pc
+++ b/libopenni.pc
@@ -3,8 +3,8 @@ exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/ni
-Name: OpenNI2
-Description: A general purpose driver for all OpenNI cameras.
+Name: openni
+Description: An interface for physical devices and for middleware components
Version: 1.5.7.10
Cflags: -I${includedir}
Libs: -L${libdir} -lOpenNI
diff --git a/openni.install b/openni.install
index 94ec3d5a926..3ef4704430a 100644
--- a/openni.install
+++ b/openni.install
@@ -5,7 +5,7 @@ post_install() {
/usr/bin/niReg /usr/lib/$module
done
- echo "Don't forget to install a hardware driver such as sensorkinect-git"
+ echo "Don't forget to install a hardware driver such as openni-primesense-sensor or sensorkinect"
}
pre_remove() {