Skip to content

Instantly share code, notes, and snippets.

@muff1nman
Created February 23, 2014 19:28
Show Gist options
  • Save muff1nman/9176043 to your computer and use it in GitHub Desktop.
Save muff1nman/9176043 to your computer and use it in GitHub Desktop.
# Maintainer: Andrew DeMaria <[email protected]>
pkgname=openni2-libfreenect
pkgver=2.2beta2
_pkgver=2.2-beta2
pkgrel=5
pkgdesc="Open source SDK used for the development of 3D sensing middleware libraries and applications"
arch=('i686' 'x86_64')
url="http://www.openni.org/"
license=('Apache')
provides=('openni2')
conflicts=('openni2')
makedepends=(doxygen java-environment
depends=(freeglut libfreenect)
source=(
"https://github.com/OpenNI/OpenNI2/archive/${_pkgver}.tar.gz"
)
md5sums=(
'3f2cd6a64776821fb2837c442539f65b'
)
if [ "${CARCH}" = "x86_64" ]; then
_platform=x64
elif [ "${CARCH}" = "i686" ]; then
_platform=x86
else
_platform=Arm
fi
_cfg=Release
prepare() {
cd "${srcdir}/OpenNI2-${_pkgver}"
sed -i s%-mfloat-abi=softfp%% ThirdParty/PSCommon/BuildSystem/Platform.Arm
}
build() {
cd "${srcdir}/OpenNI2-${_pkgver}"
LDFLAGS+=" -pthread"
make CFG=${_cfg} ALLOW_WARNINGS=1
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"
cp -r "${srcdir}/OpenNI2-${_pkgver}/Config" "${pkgdir}/etc/OpenNI2"
install -d -m755 "${pkgdir}/usr/"{bin,lib/OpenNI2/Drivers,share/doc/OpenNI2}
cp -r "${srcdir}/OpenNI2-${_pkgver}/Include" "${pkgdir}/usr/include"
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"
cd "${srcdir}/OpenNI2-${_pkgver}/Bin/${_platform}-${_cfg}/OpenNI2/Drivers"
install *.so "${pkgdir}/usr/lib/OpenNI2/Drivers"
cd "${srcdir}/OpenNI2-${_pkgver}/Source/Documentation/html"
install * "${pkgdir}/usr/share/doc/OpenNI2"
ln -s /usr/lib/OpenNI2-FreenectDriver/libFreenectDriver.so ${pkgdir}/usr/lib/OpenNI2/Drivers/libFreenectDriver.so
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
}
# vim:set ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment