b7538529cd9daf2a3196b250979ccd90e915aa24
[gentoo.git] / x11-wm / mutter / mutter-3.22.1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6 inherit gnome2 virtualx
7
8 DESCRIPTION="GNOME 3 compositing window manager based on Clutter"
9 HOMEPAGE="https://git.gnome.org/browse/mutter/"
10
11 LICENSE="GPL-2+"
12 SLOT="0"
13
14 IUSE="debug gles2 input_devices_wacom +introspection test udev wayland"
15
16 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
17
18 # libXi-1.7.4 or newer needed per:
19 # https://bugzilla.gnome.org/show_bug.cgi?id=738944
20 COMMON_DEPEND="
21         >=dev-libs/atk-2.5.3
22         >=x11-libs/gdk-pixbuf-2:2
23         >=dev-libs/json-glib-0.12.0
24         >=x11-libs/pango-1.30[X,introspection?]
25         >=x11-libs/cairo-1.14[X]
26         >=x11-libs/gtk+-3.19.8:3[X,introspection?]
27         >=dev-libs/glib-2.49.0:2[dbus]
28         >=media-libs/libcanberra-0.26[gtk3]
29         >=x11-libs/startup-notification-0.7
30         >=x11-libs/libXcomposite-0.2
31         >=gnome-base/gsettings-desktop-schemas-3.21.4[introspection?]
32         gnome-base/gnome-desktop:3=
33         >sys-power/upower-0.99:=
34
35         x11-libs/libICE
36         x11-libs/libSM
37         x11-libs/libX11
38         >=x11-libs/libXcomposite-0.4
39         x11-libs/libXcursor
40         x11-libs/libXdamage
41         x11-libs/libXext
42         >=x11-libs/libXfixes-3
43         >=x11-libs/libXi-1.7.4
44         x11-libs/libXinerama
45         >=x11-libs/libXrandr-1.5
46         x11-libs/libXrender
47         x11-libs/libxcb
48         x11-libs/libxkbfile
49         >=x11-libs/libxkbcommon-0.4.3[X]
50         x11-misc/xkeyboard-config
51
52         gnome-extra/zenity
53         media-libs/mesa[egl]
54
55         gles2? ( media-libs/mesa[gles2] )
56         input_devices_wacom? ( >=dev-libs/libwacom-0.13 )
57         introspection? ( >=dev-libs/gobject-introspection-1.42:= )
58         udev? ( virtual/libgudev:= )
59         wayland? (
60                 >=dev-libs/libinput-1.4
61                 >=dev-libs/wayland-1.6.90
62                 >=dev-libs/wayland-protocols-1.7
63                 >=media-libs/mesa-10.3[egl,gbm,wayland]
64                 sys-apps/systemd
65                 virtual/libgudev:=
66                 >=virtual/libudev-136:=
67                 x11-base/xorg-server[wayland]
68                 x11-libs/libdrm:=
69         )
70 "
71 DEPEND="${COMMON_DEPEND}
72         >=sys-devel/gettext-0.19.6
73         virtual/pkgconfig
74         x11-proto/xextproto
75         x11-proto/xineramaproto
76         x11-proto/xproto
77         test? ( app-text/docbook-xml-dtd:4.5 )
78         wayland? ( >=sys-kernel/linux-headers-4.4 )
79 "
80 RDEPEND="${COMMON_DEPEND}
81         !x11-misc/expocity
82 "
83
84 src_prepare() {
85         # Disable building of noinst_PROGRAM for tests
86         if ! use test; then
87                 sed -e '/^noinst_PROGRAMS/d' \
88                         -i cogl/tests/conform/Makefile.{am,in} || die
89                 sed -e '/noinst_PROGRAMS += testboxes/d' \
90                         -i src/Makefile-tests.am || die
91                 sed -e '/noinst_PROGRAMS/ s/testboxes$(EXEEXT)//' \
92                         -i src/Makefile.in || die
93         fi
94
95         gnome2_src_prepare
96
97         # Leave the damn CFLAGS alone
98         sed -e 's/$CFLAGS -g/$CFLAGS /' \
99                 -i clutter/configure || die
100         sed -e 's/$CFLAGS -g -O0/$CFLAGS /' \
101                 -i cogl/configure || die
102         sed -e 's/$CFLAGS -g -O/$CFLAGS /' \
103                 -i configure || die
104 }
105
106 src_configure() {
107         # Prefer gl driver by default
108         # GLX is forced by mutter but optional in clutter
109         # xlib-egl-platform required by mutter x11 backend
110         # native backend without wayland is useless
111         gnome2_src_configure \
112                 --disable-static \
113                 --enable-compile-warnings=minimum \
114                 --enable-gl \
115                 --enable-glx \
116                 --enable-sm \
117                 --enable-startup-notification \
118                 --enable-verbose-mode \
119                 --enable-xlib-egl-platform \
120                 --with-default-driver=gl \
121                 --with-libcanberra \
122                 $(usex debug --enable-debug=yes "") \
123                 $(use_enable gles2)        \
124                 $(use_enable gles2 cogl-gles2) \
125                 $(use_enable introspection) \
126                 $(use_enable wayland) \
127                 $(use_enable wayland kms-egl-platform) \
128                 $(use_enable wayland native-backend) \
129                 $(use_enable wayland wayland-egl-server) \
130                 $(use_with input_devices_wacom libwacom) \
131                 $(use_with udev gudev)
132 }
133
134 src_test() {
135         virtx emake check
136 }