openscenegraph-3.2.1-r2.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. WX_GTK_VER="3.0"
  5. inherit eutils cmake-utils flag-o-matic wxwidgets
  6. MY_PN="OpenSceneGraph"
  7. MY_P=${MY_PN}-${PV}
  8. DESCRIPTION="Open source high performance 3D graphics toolkit"
  9. HOMEPAGE="http://www.openscenegraph.org/projects/osg/"
  10. SRC_URI="http://trac.openscenegraph.org/downloads/developer_releases/${MY_P}.zip"
  11. LICENSE="wxWinLL-3 LGPL-2.1"
  12. SLOT="0"
  13. KEYWORDS="amd64 ppc x86"
  14. IUSE="asio curl debug doc examples ffmpeg fltk fox gdal gif glut gtk jpeg jpeg2k
  15. openexr openinventor osgapps pdf png qt4 qt5 sdl svg tiff truetype vnc wxwidgets
  16. xine xrandr zlib"
  17. REQUIRED_USE="
  18. qt4? ( !qt5 )
  19. qt5? ( !qt4 )
  20. "
  21. # TODO: COLLADA, FBX, GTA, ITK, OpenVRML, Performer, DCMTK
  22. RDEPEND="
  23. x11-libs/libSM
  24. x11-libs/libXext
  25. virtual/glu
  26. virtual/opengl
  27. asio? ( dev-cpp/asio )
  28. curl? ( net-misc/curl )
  29. examples? (
  30. fltk? ( x11-libs/fltk:1[opengl] )
  31. fox? ( x11-libs/fox:1.6[opengl] )
  32. glut? ( media-libs/freeglut )
  33. gtk? ( x11-libs/gtkglext )
  34. sdl? ( media-libs/libsdl )
  35. wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[opengl,X] )
  36. )
  37. ffmpeg? ( virtual/ffmpeg )
  38. gdal? ( sci-libs/gdal )
  39. gif? ( media-libs/giflib:= )
  40. jpeg? ( virtual/jpeg:0 )
  41. jpeg2k? ( media-libs/jasper:= )
  42. openexr? (
  43. media-libs/ilmbase
  44. media-libs/openexr
  45. )
  46. openinventor? ( media-libs/coin )
  47. pdf? ( app-text/poppler[cairo] )
  48. png? ( media-libs/libpng:0= )
  49. qt4? (
  50. dev-qt/qtcore:4
  51. dev-qt/qtgui:4
  52. dev-qt/qtopengl:4
  53. )
  54. qt5? (
  55. dev-qt/qtcore:5
  56. dev-qt/qtgui:5
  57. dev-qt/qtopengl:5
  58. dev-qt/qtwidgets:5
  59. )
  60. svg? (
  61. gnome-base/librsvg
  62. x11-libs/cairo
  63. )
  64. tiff? ( media-libs/tiff:0 )
  65. truetype? ( media-libs/freetype:2 )
  66. vnc? ( net-libs/libvncserver )
  67. xine? ( media-libs/xine-lib )
  68. xrandr? ( x11-libs/libXrandr )
  69. zlib? ( sys-libs/zlib )
  70. "
  71. DEPEND="${RDEPEND}
  72. app-arch/unzip
  73. virtual/pkgconfig
  74. x11-proto/xextproto
  75. doc? ( app-doc/doxygen )
  76. xrandr? ( x11-proto/randrproto )
  77. "
  78. S=${WORKDIR}/${MY_P}
  79. DOCS=(AUTHORS.txt ChangeLog NEWS.txt)
  80. PATCHES=(
  81. "${FILESDIR}"/${PN}-3.2.1-cmake.patch
  82. "${FILESDIR}"/${PN}-3.2.1-gdal-2.0.patch
  83. "${FILESDIR}"/${PN}-3.2.1-giflib5.patch
  84. )
  85. src_configure() {
  86. if use examples && use wxwidgets; then
  87. need-wxwidgets unicode
  88. fi
  89. # Needed by FFmpeg
  90. append-cppflags -D__STDC_CONSTANT_MACROS
  91. mycmakeargs=(
  92. -DDYNAMIC_OPENSCENEGRAPH=ON
  93. -DWITH_ITK=OFF
  94. -DGENTOO_DOCDIR="/usr/share/doc/${PF}"
  95. $(cmake-utils_use_with asio)
  96. $(cmake-utils_use_with curl)
  97. $(cmake-utils_use_build doc DOCUMENTATION)
  98. $(cmake-utils_use_build osgapps OSG_APPLICATIONS)
  99. $(cmake-utils_use_build examples OSG_EXAMPLES)
  100. $(cmake-utils_use_with ffmpeg FFmpeg)
  101. $(cmake-utils_use_with fltk)
  102. $(cmake-utils_use_with fox)
  103. $(cmake-utils_use_with gdal)
  104. $(cmake-utils_use_with gif GIFLIB)
  105. $(cmake-utils_use_with glut)
  106. $(cmake-utils_use_with gtk GtkGl)
  107. $(cmake-utils_use_with jpeg)
  108. $(cmake-utils_use_with jpeg2k Jasper)
  109. $(cmake-utils_use_with openexr OpenEXR)
  110. $(cmake-utils_use_with openinventor Inventor)
  111. $(cmake-utils_use_with pdf Poppler-glib)
  112. $(cmake-utils_use_with png)
  113. $(cmake-utils_use_with sdl)
  114. $(cmake-utils_use_with svg rsvg)
  115. $(cmake-utils_use_with tiff)
  116. $(cmake-utils_use_with truetype Freetype)
  117. $(cmake-utils_use_with vnc LibVNCServer)
  118. $(cmake-utils_use_with wxwidgets wxWidgets)
  119. $(cmake-utils_use_with xine)
  120. $(cmake-utils_use xrandr OSGVIEWER_USE_XRANDR)
  121. $(cmake-utils_use_with zlib)
  122. )
  123. if use qt4; then
  124. mycmakeargs+=( -DOSG_USE_QT=ON -DDESIRED_QT_VERSION=4 )
  125. elif use qt5; then
  126. mycmakeargs+=( -DOSG_USE_QT=ON -DDESIRED_QT_VERSION=5 )
  127. else
  128. mycmakeargs+=( -DOSG_USE_QT=OFF )
  129. fi
  130. cmake-utils_src_configure
  131. }
  132. src_compile() {
  133. cmake-utils_src_compile
  134. use doc && cmake-utils_src_compile doc_openscenegraph doc_openthreads
  135. }