OpenNI2-9999.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. SCM=""
  5. if [ "${PV#9999}" != "${PV}" ] ; then
  6. SCM="git-r3"
  7. EGIT_REPO_URI="https://github.com/occipital/openni2"
  8. fi
  9. inherit ${SCM} toolchain-funcs eutils multilib java-pkg-opt-2 flag-o-matic
  10. if [ "${PV#9999}" != "${PV}" ] ; then
  11. KEYWORDS=""
  12. SRC_URI=""
  13. else
  14. KEYWORDS="~amd64 ~arm"
  15. SRC_URI="https://github.com/occipital/OpenNI2/archive/${PV/_/-}.tar.gz -> ${P}.tar.gz"
  16. S="${WORKDIR}/${P/_/-}"
  17. fi
  18. DESCRIPTION="OpenNI2 SDK"
  19. HOMEPAGE="http://structure.io/openni"
  20. LICENSE="Apache-2.0"
  21. SLOT="0"
  22. IUSE="doc java neon opengl static-libs"
  23. RDEPEND="
  24. virtual/libusb:1
  25. virtual/libudev
  26. virtual/jpeg:0
  27. opengl? ( media-libs/freeglut )
  28. java? ( >=virtual/jre-1.5:* )
  29. "
  30. DEPEND="${RDEPEND}
  31. dev-lang/python
  32. doc? ( app-doc/doxygen )
  33. java? ( >=virtual/jdk-1.5:* )"
  34. src_prepare() {
  35. epatch \
  36. "${FILESDIR}/jpeg.patch" \
  37. "${FILESDIR}/rpath.patch" \
  38. "${FILESDIR}/soname.patch"
  39. rm -rf ThirdParty/LibJPEG
  40. for i in ThirdParty/PSCommon/BuildSystem/Platform.* ; do
  41. echo "" > ${i}
  42. done
  43. }
  44. src_compile() {
  45. use neon && export CFLAGS="${CFLAGS} -DXN_NEON"
  46. emake \
  47. CC="$(tc-getCC)" \
  48. CXX="$(tc-getCXX)" \
  49. ALLOW_WARNINGS=1 \
  50. GLUT_SUPPORTED="$(usex opengl 1 0)" \
  51. $(usex java "" ALL_WRAPPERS="") \
  52. $(usex java "" JAVA_SAMPLES="")
  53. if use doc ; then
  54. cd "${S}/Source/Documentation"
  55. doxygen || die
  56. fi
  57. }
  58. src_install() {
  59. dolib.so "${S}/Bin/"*Release/*.so
  60. cp -a "${S}/Bin/"*Release/OpenNI2 "${ED}/usr/$(get_libdir)"
  61. use static-libs && dolib.a "${S}/Bin/"*Release/*.a
  62. insinto /usr/include/openni2
  63. doins -r Include/*
  64. dobin "${S}/Bin/"*Release/{PS1080Console,PSLinkConsole,SimpleRead,EventBasedRead,MultipleStreamRead,MWClosestPointApp}
  65. use opengl && dobin "${S}/Bin/"*Release/{NiViewer,SimpleViewer,MultiDepthViewer,ClosestPointViewer}
  66. if use java ; then
  67. java-pkg_dojar "${S}/Bin/"*Release/*.jar
  68. echo "java -jar ${JAVA_PKG_JARDEST}/org.openni.Samples.SimpleViewer.jar" > org.openni.Samples.SimpleViewer
  69. dobin org.openni.Samples.SimpleViewer
  70. fi
  71. dodoc CHANGES.txt NOTICE README.md ReleaseNotes.txt Source/Documentation/Text/*.txt
  72. if use doc ; then
  73. dohtml -r "${S}/Source/Documentation/html/"*
  74. fi
  75. dodir /usr/$(get_libdir)/pkgconfig
  76. sed \
  77. -e "s/@libdir@/$(get_libdir)/" \
  78. -e "s/@version@/${PV}/" \
  79. "${FILESDIR}/libopenni2.pc.in" > "${ED}/usr/$(get_libdir)/pkgconfig/libopenni2.pc" || die
  80. }