diff options
author | Alexis Ballier <aballier@gentoo.org> | 2020-05-15 17:02:14 +0200 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2020-05-15 18:33:45 +0200 |
commit | e85bb7f7d313731f0249c8fadd2f47ebc474e934 (patch) | |
tree | 8eb26b44d37f271130e666bd5b3f2dde186f003e /dev-libs/OpenNI | |
parent | sci-electronics/gazebo: bump to 11.0.0 (diff) | |
download | gentoo-e85bb7f7d313731f0249c8fadd2f47ebc474e934.tar.gz gentoo-e85bb7f7d313731f0249c8fadd2f47ebc474e934.tar.bz2 gentoo-e85bb7f7d313731f0249c8fadd2f47ebc474e934.zip |
dev-libs/OpenNI: solidify ifdefs, otherwise this breaks e.g. pcl
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
Diffstat (limited to 'dev-libs/OpenNI')
-rw-r--r-- | dev-libs/OpenNI/OpenNI-1.5.7.10-r1.ebuild | 108 | ||||
-rw-r--r-- | dev-libs/OpenNI/files/betterdefines.patch | 16 |
2 files changed, 124 insertions, 0 deletions
diff --git a/dev-libs/OpenNI/OpenNI-1.5.7.10-r1.ebuild b/dev-libs/OpenNI/OpenNI-1.5.7.10-r1.ebuild new file mode 100644 index 000000000000..674ccb33fff4 --- /dev/null +++ b/dev-libs/OpenNI/OpenNI-1.5.7.10-r1.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +SCM="" +if [ "${PV#9999}" != "${PV}" ] ; then + SCM="git-r3" + EGIT_REPO_URI="https://github.com/OpenNI/OpenNI" +fi + +inherit ${SCM} toolchain-funcs eutils multilib java-pkg-opt-2 + +if [ "${PV#9999}" != "${PV}" ] ; then + KEYWORDS="" + SRC_URI="" +else + KEYWORDS="~amd64 ~arm" + SRC_URI="https://github.com/OpenNI/OpenNI/archive/Stable-${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-Stable-${PV}" +fi + +DESCRIPTION="OpenNI SDK" +HOMEPAGE="https://github.com/OpenNI/OpenNI" +LICENSE="Apache-2.0" +SLOT="0" +IUSE="doc java opengl" + +RDEPEND=" + virtual/libusb:1 + virtual/libudev + virtual/jpeg:0 + dev-libs/tinyxml + opengl? ( media-libs/freeglut !dev-libs/OpenNI2[opengl] ) + java? ( >=virtual/jre-1.5 ) +" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen ) + java? ( >=virtual/jdk-1.5 )" + +src_prepare() { + epatch \ + "${FILESDIR}/tinyxml.patch" \ + "${FILESDIR}/jpeg.patch" \ + "${FILESDIR}/soname.patch" \ + "${FILESDIR}/${P}-gcc6.patch" \ + "${FILESDIR}/betterdefines.patch" + + rm -rf External/{LibJPEG,TinyXml} + for i in Platform/Linux/Build/Common/Platform.* Externals/PSCommon/Linux/Build/Platform.* ; do + echo "" > ${i} + done + + find . -type f -print0 | xargs -0 sed -i "s:\".*/SamplesConfig.xml:\"${EPREFIX}/usr/share/${PN}/SamplesConfig.xml:" || die +} + +src_compile() { + emake -C "${S}/Platform/Linux/Build" \ + CC="$(tc-getCC)" \ + CXX="$(tc-getCXX)" \ + GLUT_SUPPORTED="$(usex opengl 1 0)" \ + $(usex java "" ALL_JAVA_PROJS="") \ + $(usex java "" JAVA_SAMPLES="") \ + ALL_MONO_PROJS="" \ + MONO_SAMPLES="" \ + MONO_FORMS_SAMPLES="" + + if use doc ; then + cd "${S}/Source/DoxyGen" + doxygen || die + fi +} + +src_install() { + dolib.so "${S}/Platform/Linux/Bin/"*Release/*.so + + insinto /usr/include/openni + doins -r Include/* + + dobin "${S}/Platform/Linux/Bin/"*Release/{ni*,Ni*,Sample-*} + + if use java ; then + java-pkg_dojar "${S}/Platform/Linux/Bin/"*Release/*.jar + echo "java -jar ${JAVA_PKG_JARDEST}/org.openni.Samples.SimpleViewer.jar" > org.openni.Samples.SimpleViewer + dobin org.openni.Samples.SimpleViewer + fi + + insinto /usr/share/${PN} + doins Data/* + + dodoc Documentation/OpenNI_UserGuide.pdf CHANGES NOTICE README + + if use doc ; then + dohtml -r "${S}/Source/DoxyGen/html/"* + dodoc Source/DoxyGen/Text/*.txt + fi + + keepdir /var/lib/ni +} + +pkg_postinst() { + if [ "${ROOT:-/}" = "/" ] ; then + for i in "${EROOR}/usr/$(get_libdir)"/libnim*.so ; do + einfo "Registering module ${i}" + niReg -r "${i}" + done + fi +} diff --git a/dev-libs/OpenNI/files/betterdefines.patch b/dev-libs/OpenNI/files/betterdefines.patch new file mode 100644 index 000000000000..5fd2eaed5d7e --- /dev/null +++ b/dev-libs/OpenNI/files/betterdefines.patch @@ -0,0 +1,16 @@ +Index: OpenNI-Stable-1.5.7.10/Include/XnPlatform.h +=================================================================== +--- OpenNI-Stable-1.5.7.10.orig/Include/XnPlatform.h ++++ OpenNI-Stable-1.5.7.10/Include/XnPlatform.h +@@ -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 (defined(__linux__) && (i386 || __x86_64__))
+ #include "Linux-x86/XnPlatformLinux-x86.h"
+-#elif (linux && __arm__)
++#elif (defined(__linux__) && __arm__)
+ #include "Linux-Arm/XnPlatformLinux-Arm.h"
+ #elif _ARC
+ #include "ARC/XnPlatformARC.h"
|