cogl-1.20.0.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. GCONF_DEBUG="yes"
  5. inherit gnome2 multilib virtualx
  6. DESCRIPTION="A library for using 3D graphics hardware to draw pretty pictures"
  7. HOMEPAGE="http://www.cogl3d.org/"
  8. LICENSE="MIT BSD"
  9. SLOT="1.0/20" # subslot = .so version
  10. # doc and profile disable for now due bugs #484750 and #483332
  11. IUSE="examples gles2 gstreamer +introspection +kms +opengl +pango test wayland" # doc profile
  12. REQUIRED_USE="wayland? ( gles2 )
  13. || ( gles2 opengl )"
  14. KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
  15. COMMON_DEPEND="
  16. >=dev-libs/glib-2.32:2
  17. x11-libs/cairo:=
  18. >=x11-libs/gdk-pixbuf-2:2
  19. x11-libs/libX11
  20. >=x11-libs/libXcomposite-0.4
  21. x11-libs/libXdamage
  22. x11-libs/libXext
  23. >=x11-libs/libXfixes-3
  24. >=x11-libs/libXrandr-1.2
  25. virtual/opengl
  26. gles2? ( media-libs/mesa[gles2] )
  27. gstreamer? (
  28. media-libs/gstreamer:1.0
  29. media-libs/gst-plugins-base:1.0 )
  30. introspection? ( >=dev-libs/gobject-introspection-1.34.2:= )
  31. kms? (
  32. media-libs/mesa[gbm]
  33. x11-libs/libdrm:= )
  34. pango? ( >=x11-libs/pango-1.20.0[introspection?] )
  35. wayland? (
  36. >=dev-libs/wayland-1.1.90
  37. media-libs/mesa[egl,wayland] )
  38. "
  39. # before clutter-1.7, cogl was part of clutter
  40. RDEPEND="${COMMON_DEPEND}
  41. !<media-libs/clutter-1.7
  42. "
  43. DEPEND="${COMMON_DEPEND}
  44. >=dev-util/gtk-doc-am-1.13
  45. sys-devel/gettext
  46. virtual/pkgconfig
  47. test? (
  48. app-eselect/eselect-opengl
  49. media-libs/mesa[classic] )
  50. "
  51. # Need classic mesa swrast for tests, llvmpipe causes a test failure
  52. # For some reason GL3 conformance test all fails again...
  53. RESTRICT="test"
  54. src_prepare() {
  55. # Do not build examples
  56. sed -e "s/^\(SUBDIRS +=.*\)examples\(.*\)$/\1\2/" \
  57. -i Makefile.am Makefile.in || die
  58. if ! use test ; then
  59. # For some reason the configure switch will not completely disable
  60. # tests being built
  61. sed -e "s/^\(SUBDIRS =.*\)test-fixtures\(.*\)$/\1\2/" \
  62. -e "s/^\(SUBDIRS +=.*\)tests\(.*\)$/\1\2/" \
  63. -e "s/^\(.*am__append.* \)tests\(.*\)$/\1\2/" \
  64. -i Makefile.am Makefile.in || die
  65. fi
  66. gnome2_src_prepare
  67. }
  68. src_configure() {
  69. # TODO: think about quartz, sdl
  70. # Prefer gl over gles2 if both are selected
  71. # Profiling needs uprof, which is not available in portage yet, bug #484750
  72. # FIXME: Doesn't provide prebuilt docs, but they can neither be rebuilt, bug #483332
  73. gnome2_src_configure \
  74. --disable-examples-install \
  75. --disable-maintainer-flags \
  76. --enable-cairo \
  77. --enable-deprecated \
  78. --enable-gdk-pixbuf \
  79. --enable-glib \
  80. $(use_enable opengl glx) \
  81. $(use_enable opengl gl) \
  82. $(use_enable gles2) \
  83. $(use_enable gles2 cogl-gles2) \
  84. $(use_enable gles2 xlib-egl-platform) \
  85. $(usex gles2 --with-default-driver=$(usex opengl gl gles2)) \
  86. $(use_enable gstreamer cogl-gst) \
  87. $(use_enable introspection) \
  88. $(use_enable kms kms-egl-platform) \
  89. $(use_enable pango cogl-pango) \
  90. $(use_enable test unit-tests) \
  91. $(use_enable wayland wayland-egl-platform) \
  92. $(use_enable wayland wayland-egl-server) \
  93. --disable-profile
  94. # $(use_enable profile)
  95. }
  96. src_test() {
  97. # Use swrast for tests, llvmpipe is incomplete and "test_sub_texture" fails
  98. # NOTE: recheck if this is needed after every mesa bump
  99. if [[ "$(eselect opengl show)" != "xorg-x11" ]]; then
  100. ewarn "Skipping tests because a binary OpenGL library is enabled. To"
  101. ewarn "run tests for ${PN}, you need to enable the Mesa library:"
  102. ewarn "# eselect opengl set xorg-x11"
  103. return
  104. fi
  105. LIBGL_DRIVERS_PATH="${EROOT}/usr/$(get_libdir)/mesa" Xemake check
  106. }
  107. src_install() {
  108. if use examples; then
  109. insinto /usr/share/doc/${PF}/examples
  110. doins examples/{*.c,*.jpg}
  111. fi
  112. gnome2_src_install
  113. # Remove silly examples-data directory
  114. rm -rvf "${ED}/usr/share/cogl/examples-data/" || die
  115. }