cogl-1.22.0-r2.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 eutils 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 to bugs #484750 and #483332
  11. IUSE="examples gles2 gstreamer +introspection +kms +opengl +pango test video_cards_fglrx wayland" # doc profile
  12. REQUIRED_USE="
  13. wayland? ( gles2 )
  14. || ( gles2 opengl )
  15. "
  16. KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
  17. COMMON_DEPEND="
  18. >=dev-libs/glib-2.32:2
  19. x11-libs/cairo:=
  20. >=x11-libs/gdk-pixbuf-2:2
  21. x11-libs/libX11
  22. >=x11-libs/libXcomposite-0.4
  23. x11-libs/libXdamage
  24. x11-libs/libXext
  25. >=x11-libs/libXfixes-3
  26. >=x11-libs/libXrandr-1.2
  27. virtual/opengl
  28. gles2? ( media-libs/mesa[gles2] )
  29. gstreamer? (
  30. media-libs/gstreamer:1.0
  31. media-libs/gst-plugins-base:1.0 )
  32. introspection? ( >=dev-libs/gobject-introspection-1.34.2:= )
  33. kms? (
  34. media-libs/mesa[gbm]
  35. x11-libs/libdrm:= )
  36. pango? ( >=x11-libs/pango-1.20.0[introspection?] )
  37. wayland? (
  38. >=dev-libs/wayland-1.1.90
  39. media-libs/mesa[egl,wayland] )
  40. "
  41. # before clutter-1.7, cogl was part of clutter
  42. RDEPEND="${COMMON_DEPEND}
  43. !<media-libs/clutter-1.7
  44. "
  45. DEPEND="${COMMON_DEPEND}
  46. >=dev-util/gtk-doc-am-1.13
  47. sys-devel/gettext
  48. virtual/pkgconfig
  49. test? (
  50. app-eselect/eselect-opengl
  51. media-libs/mesa[classic] )
  52. "
  53. # Need classic mesa swrast for tests, llvmpipe causes a test failure
  54. # For some reason GL3 conformance test all fails again...
  55. RESTRICT="test"
  56. src_prepare() {
  57. # Upstream fixes from 1.22 branch
  58. # kms-winsys: don't wait for a flip when page flipping fails
  59. epatch "${FILESDIR}"/${P}-wait-flip.patch
  60. # Let cogl work with fglrx driver, bug #567168
  61. # https://bugzilla.gnome.org/show_bug.cgi?id=756306
  62. use video_cards_fglrx && epatch "${FILESDIR}"/${PN}-1.22.0-fglrx.patch
  63. # Do not build examples
  64. sed -e "s/^\(SUBDIRS +=.*\)examples\(.*\)$/\1\2/" \
  65. -i Makefile.am Makefile.in || die
  66. if ! use test ; then
  67. # For some reason the configure switch will not completely disable
  68. # tests being built
  69. sed -e "s/^\(SUBDIRS =.*\)test-fixtures\(.*\)$/\1\2/" \
  70. -e "s/^\(SUBDIRS +=.*\)tests\(.*\)$/\1\2/" \
  71. -e "s/^\(.*am__append.* \)tests\(.*\)$/\1\2/" \
  72. -i Makefile.am Makefile.in || die
  73. fi
  74. gnome2_src_prepare
  75. }
  76. src_configure() {
  77. # TODO: think about quartz, sdl
  78. # Prefer gl over gles2 if both are selected
  79. # Profiling needs uprof, which is not available in portage yet, bug #484750
  80. # FIXME: Doesn't provide prebuilt docs, but they can neither be rebuilt, bug #483332
  81. gnome2_src_configure \
  82. --disable-examples-install \
  83. --disable-maintainer-flags \
  84. --enable-cairo \
  85. --enable-deprecated \
  86. --enable-gdk-pixbuf \
  87. --enable-glib \
  88. $(use_enable opengl glx) \
  89. $(use_enable opengl gl) \
  90. $(use_enable gles2) \
  91. $(use_enable gles2 cogl-gles2) \
  92. $(use_enable gles2 xlib-egl-platform) \
  93. $(usex gles2 --with-default-driver=$(usex opengl gl gles2)) \
  94. $(use_enable gstreamer cogl-gst) \
  95. $(use_enable introspection) \
  96. $(use_enable kms kms-egl-platform) \
  97. $(use_enable pango cogl-pango) \
  98. $(use_enable test unit-tests) \
  99. $(use_enable wayland wayland-egl-platform) \
  100. $(use_enable wayland wayland-egl-server) \
  101. --disable-profile
  102. # $(use_enable profile)
  103. }
  104. src_test() {
  105. # Use swrast for tests, llvmpipe is incomplete and "test_sub_texture" fails
  106. # NOTE: recheck if this is needed after every mesa bump
  107. if [[ "$(eselect opengl show)" != "xorg-x11" ]]; then
  108. ewarn "Skipping tests because a binary OpenGL library is enabled. To"
  109. ewarn "run tests for ${PN}, you need to enable the Mesa library:"
  110. ewarn "# eselect opengl set xorg-x11"
  111. return
  112. fi
  113. LIBGL_DRIVERS_PATH="${EROOT}/usr/$(get_libdir)/mesa" Xemake check
  114. }
  115. src_install() {
  116. if use examples; then
  117. insinto /usr/share/doc/${PF}/examples
  118. doins examples/{*.c,*.jpg}
  119. fi
  120. gnome2_src_install
  121. # Remove silly examples-data directory
  122. rm -rvf "${ED}/usr/share/cogl/examples-data/" || die
  123. }