1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 # Temporarily needed for slibtool patch
7 # It's upstreamed so should be able to drop in future
9 GNOME2_EAUTORECONF="yes"
10 inherit flag-o-matic gnome2
12 DESCRIPTION="A library for using 3D graphics hardware to draw pretty pictures"
13 HOMEPAGE="https://www.cogl3d.org/"
16 SLOT="1.0/20" # subslot = .so version
17 KEYWORDS="~alpha amd64 ~arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
18 # doc and profile disable for now due to bugs #484750 and #483332
19 IUSE="debug examples gles2 gstreamer +introspection +kms +opengl +pango wayland" # doc profile
24 # Need classic mesa swrast for tests, llvmpipe causes a test failure
25 # For some reason GL3 conformance test all fails again...
29 >=dev-libs/glib-2.32:2
31 >=x11-libs/gdk-pixbuf-2:2
33 >=x11-libs/libXcomposite-0.4
36 >=x11-libs/libXfixes-3
37 >=x11-libs/libXrandr-1.2
39 gles2? ( media-libs/libglvnd )
41 media-libs/gstreamer:1.0
42 media-libs/gst-plugins-base:1.0
44 introspection? ( >=dev-libs/gobject-introspection-1.34.2:= )
46 media-libs/mesa[gbm(+)]
49 pango? ( >=x11-libs/pango-1.20.0[introspection?] )
51 >=dev-libs/wayland-1.1.90
52 media-libs/mesa[wayland]
58 >=sys-devel/gettext-0.19
63 "${FILESDIR}"/${P}-slibtool.patch
67 # Do not build examples
68 sed -e "s/^\(SUBDIRS +=.*\)examples\(.*\)$/\1\2/" \
69 -i Makefile.am Makefile.in || die
72 # For some reason the configure switch will not completely disable
74 sed -e "s/^\(SUBDIRS =.*\)test-fixtures\(.*\)$/\1\2/" \
75 -e "s/^\(SUBDIRS +=.*\)tests\(.*\)$/\1\2/" \
76 -e "s/^\(.*am__append.* \)tests\(.*\)$/\1\2/" \
77 -i Makefile.am Makefile.in || die
85 append-cflags -std=gnu17
87 # TODO: think about quartz, sdl
88 # Prefer gl over gles2 if both are selected
89 # Profiling needs uprof, which is not available in portage yet, bug #484750
90 # FIXME: Doesn't provide prebuilt docs, but they can neither be rebuilt, bug #483332
91 gnome2_src_configure \
92 --disable-examples-install \
93 --disable-maintainer-flags \
99 $(use_enable opengl glx) \
100 $(use_enable opengl gl) \
101 $(use_enable gles2) \
102 $(use_enable gles2 cogl-gles2) \
103 $(use_enable gles2 xlib-egl-platform) \
104 $(usev gles2 --with-default-driver=$(usex opengl gl gles2)) \
105 $(use_enable gstreamer cogl-gst) \
106 $(use_enable introspection) \
107 $(use_enable kms kms-egl-platform) \
108 $(use_enable pango cogl-pango) \
109 --disable-unit-tests \
110 $(use_enable wayland wayland-egl-platform) \
111 $(use_enable wayland wayland-egl-server) \
116 if use examples; then
118 dodoc examples/{*.c,*.jpg}
119 docompress -x /usr/share/doc/${PF}/examples
124 # Remove silly examples-data directory
125 rm -rvf "${ED}"/usr/share/cogl/examples-data/ || die