profiles/features/musl: mask app-crypt/mit-krb5-appl
[gentoo/gentoo.git] / media-libs / cogl / cogl-1.22.8-r3.ebuild
blob60f9a41c27f7243a0b9d544e898e9d93262e569b
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 # Temporarily needed for slibtool patch
7 # It's upstreamed so should be able to drop in future
8 # bug #778041
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/"
15 LICENSE="MIT BSD"
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
20 REQUIRED_USE="
21         wayland? ( gles2 )
22         || ( gles2 opengl )
24 # Need classic mesa swrast for tests, llvmpipe causes a test failure
25 # For some reason GL3 conformance test all fails again...
26 RESTRICT="test"
28 DEPEND="
29         >=dev-libs/glib-2.32:2
30         x11-libs/cairo:=
31         >=x11-libs/gdk-pixbuf-2:2
32         x11-libs/libX11
33         >=x11-libs/libXcomposite-0.4
34         x11-libs/libXdamage
35         x11-libs/libXext
36         >=x11-libs/libXfixes-3
37         >=x11-libs/libXrandr-1.2
38         virtual/opengl
39         gles2? ( media-libs/libglvnd )
40         gstreamer? (
41                 media-libs/gstreamer:1.0
42                 media-libs/gst-plugins-base:1.0
43         )
44         introspection? ( >=dev-libs/gobject-introspection-1.34.2:= )
45         kms? (
46                 media-libs/mesa[gbm(+)]
47                 x11-libs/libdrm:=
48         )
49         pango? ( >=x11-libs/pango-1.20.0[introspection?] )
50         wayland? (
51                 >=dev-libs/wayland-1.1.90
52                 media-libs/mesa[wayland]
53         )
55 RDEPEND="${DEPEND}"
56 BDEPEND="
57         dev-util/glib-utils
58         >=sys-devel/gettext-0.19
59         virtual/pkgconfig
62 PATCHES=(
63         "${FILESDIR}"/${P}-slibtool.patch
66 src_prepare() {
67         # Do not build examples
68         sed -e "s/^\(SUBDIRS +=.*\)examples\(.*\)$/\1\2/" \
69                 -i Makefile.am Makefile.in || die
71         #if ! use test ; then
72         # For some reason the configure switch will not completely disable
73         # tests being built
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
78         #fi
80         gnome2_src_prepare
83 src_configure() {
84         # bug #943759
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 \
94                 --enable-cairo             \
95                 --enable-deprecated        \
96                 --enable-gdk-pixbuf        \
97                 --enable-glib              \
98                 $(use_enable debug)        \
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) \
112                 --disable-profile
115 src_install() {
116         if use examples; then
117                 docinto examples
118                 dodoc examples/{*.c,*.jpg}
119                 docompress -x /usr/share/doc/${PF}/examples
120         fi
122         gnome2_src_install
124         # Remove silly examples-data directory
125         rm -rvf "${ED}"/usr/share/cogl/examples-data/ || die