Gentoo Archives: gentoo-commits

From: Alexandre Rostovtsev <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: gnome-base/gnome-shell/, gnome-base/gnome-shell/files/
Date: Mon, 27 Jun 2016 14:06:46
Message-Id: 1467036346.de093187ffd212744ab9952167e511d74de42153.tetromino@gentoo
1 commit: de093187ffd212744ab9952167e511d74de42153
2 Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 27 14:05:46 2016 +0000
4 Commit: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 27 14:05:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de093187
7
8 gnome-base/gnome-shell: fix nvidia-drivers crash (bug #587110)
9
10 Thanks to Mark R. Pariente for reporting.
11
12 Also, require adwaita-icon-theme-3.20 for new grid icon (bug #587130)
13
14 Package-Manager: portage-2.3.0
15
16 .../files/gnome-shell-3.20.2-st-nvidia.patch | 121 +++++++++++
17 .../gnome-shell/gnome-shell-3.20.2-r1.ebuild | 221 +++++++++++++++++++++
18 2 files changed, 342 insertions(+)
19
20 diff --git a/gnome-base/gnome-shell/files/gnome-shell-3.20.2-st-nvidia.patch b/gnome-base/gnome-shell/files/gnome-shell-3.20.2-st-nvidia.patch
21 new file mode 100644
22 index 0000000..63df248
23 --- /dev/null
24 +++ b/gnome-base/gnome-shell/files/gnome-shell-3.20.2-st-nvidia.patch
25 @@ -0,0 +1,121 @@
26 +From 35cc224240ec4fc8159fc689fe3e093a81f97dc9 Mon Sep 17 00:00:00 2001
27 +From: Martin Szulecki <martin.szulecki@××××××××××××××××.org>
28 +Date: Tue, 17 May 2016 15:00:04 +0200
29 +Subject: [PATCH] st: Init framebuffer early to fix gnome-shell crash on NVIDIA
30 + drivers
31 +
32 +Checking offscreen for COGL_INVALID_HANDLE is not sufficient,
33 +as cogl_offscreen_new_with_texture doesn't initialize framebuffer
34 +objects but lets Cogl solve this the lazy way.
35 +cogl_offscreen_new_with_texture will never return COGL_INVALID_HANDLE
36 +anyways.
37 +
38 +https://bugzilla.gnome.org/show_bug.cgi?id=764898
39 +---
40 + src/st/st-theme-node-drawing.c | 18 ++++++++++++------
41 + src/st/st-theme-node-transition.c | 25 ++++++++++++++++++++-----
42 + 2 files changed, 32 insertions(+), 11 deletions(-)
43 +
44 +diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
45 +index 85feb20..8942966 100644
46 +--- a/src/st/st-theme-node-drawing.c
47 ++++ b/src/st/st-theme-node-drawing.c
48 +@@ -2224,6 +2224,7 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
49 + int max_borders[4];
50 + int center_radius, corner_id;
51 + CoglHandle buffer, offscreen = COGL_INVALID_HANDLE;
52 ++ CoglError *error = NULL;
53 +
54 + /* Get infos from the node */
55 + if (state->alloc_width < node->box_shadow_min_width ||
56 +@@ -2264,10 +2265,12 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
57 + state->box_shadow_height,
58 + COGL_TEXTURE_NO_SLICING,
59 + COGL_PIXEL_FORMAT_ANY);
60 +- if (buffer != COGL_INVALID_HANDLE)
61 +- offscreen = cogl_offscreen_new_with_texture (buffer);
62 ++ if (buffer == NULL)
63 ++ return;
64 +
65 +- if (offscreen != COGL_INVALID_HANDLE)
66 ++ offscreen = cogl_offscreen_new_with_texture (buffer);
67 ++
68 ++ if (cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), &error))
69 + {
70 + ClutterActorBox box = { 0, 0, state->box_shadow_width, state->box_shadow_height};
71 +
72 +@@ -2277,14 +2280,17 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
73 + cogl_framebuffer_clear4f (offscreen, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 0);
74 +
75 + st_theme_node_paint_borders (state, offscreen, &box, 0xFF);
76 +- cogl_handle_unref (offscreen);
77 +
78 + state->box_shadow_pipeline = _st_create_shadow_pipeline (st_theme_node_get_box_shadow (node),
79 + buffer);
80 + }
81 ++ else
82 ++ {
83 ++ cogl_error_free (error);
84 ++ }
85 +
86 +- if (buffer != COGL_INVALID_HANDLE)
87 +- cogl_handle_unref (buffer);
88 ++ cogl_handle_unref (offscreen);
89 ++ cogl_handle_unref (buffer);
90 + }
91 +
92 + static void
93 +diff --git a/src/st/st-theme-node-transition.c b/src/st/st-theme-node-transition.c
94 +index 1eef17b..afde977 100644
95 +--- a/src/st/st-theme-node-transition.c
96 ++++ b/src/st/st-theme-node-transition.c
97 +@@ -241,6 +241,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
98 + {
99 + StThemeNodeTransitionPrivate *priv = transition->priv;
100 + guint width, height;
101 ++ CoglError *catch_error = NULL;
102 +
103 + /* template material to avoid unnecessary shader compilation */
104 + static CoglHandle material_template = COGL_INVALID_HANDLE;
105 +@@ -263,19 +264,33 @@ setup_framebuffers (StThemeNodeTransition *transition,
106 + COGL_TEXTURE_NO_SLICING,
107 + COGL_PIXEL_FORMAT_ANY);
108 +
109 +- g_return_val_if_fail (priv->old_texture != COGL_INVALID_HANDLE, FALSE);
110 +- g_return_val_if_fail (priv->new_texture != COGL_INVALID_HANDLE, FALSE);
111 ++ if (priv->old_texture == COGL_INVALID_HANDLE)
112 ++ return FALSE;
113 ++
114 ++ if (priv->new_texture == COGL_INVALID_HANDLE)
115 ++ return FALSE;
116 +
117 + if (priv->old_offscreen)
118 + cogl_handle_unref (priv->old_offscreen);
119 + priv->old_offscreen = cogl_offscreen_new_with_texture (priv->old_texture);
120 ++ if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (priv->old_offscreen), &catch_error))
121 ++ {
122 ++ cogl_object_unref (priv->old_offscreen);
123 ++ cogl_error_free (catch_error);
124 ++ priv->old_offscreen = COGL_INVALID_HANDLE;
125 ++ return FALSE;
126 ++ }
127 +
128 + if (priv->new_offscreen)
129 + cogl_handle_unref (priv->new_offscreen);
130 + priv->new_offscreen = cogl_offscreen_new_with_texture (priv->new_texture);
131 +-
132 +- g_return_val_if_fail (priv->old_offscreen != COGL_INVALID_HANDLE, FALSE);
133 +- g_return_val_if_fail (priv->new_offscreen != COGL_INVALID_HANDLE, FALSE);
134 ++ if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (priv->new_offscreen), &catch_error))
135 ++ {
136 ++ cogl_object_unref (priv->new_offscreen);
137 ++ cogl_error_free (catch_error);
138 ++ priv->new_offscreen = COGL_INVALID_HANDLE;
139 ++ return FALSE;
140 ++ }
141 +
142 + if (priv->material == NULL)
143 + {
144 +--
145 +2.9.0
146 +
147
148 diff --git a/gnome-base/gnome-shell/gnome-shell-3.20.2-r1.ebuild b/gnome-base/gnome-shell/gnome-shell-3.20.2-r1.ebuild
149 new file mode 100644
150 index 0000000..09e83ab
151 --- /dev/null
152 +++ b/gnome-base/gnome-shell/gnome-shell-3.20.2-r1.ebuild
153 @@ -0,0 +1,221 @@
154 +# Copyright 1999-2016 Gentoo Foundation
155 +# Distributed under the terms of the GNU General Public License v2
156 +# $Id$
157 +
158 +EAPI=6
159 +GNOME2_LA_PUNT="yes"
160 +PYTHON_COMPAT=( python{3_3,3_4,3_5} )
161 +
162 +inherit autotools eutils gnome2 multilib pax-utils python-r1 systemd
163 +
164 +DESCRIPTION="Provides core UI functions for the GNOME 3 desktop"
165 +HOMEPAGE="https://wiki.gnome.org/Projects/GnomeShell"
166 +
167 +LICENSE="GPL-2+ LGPL-2+"
168 +SLOT="0"
169 +IUSE="+bluetooth +networkmanager +nls -openrc-force"
170 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
171 +
172 +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
173 +
174 +# libXfixes-5.0 needed for pointer barriers
175 +# FIXME:
176 +# * gstreamer support is currently automagic
177 +COMMON_DEPEND="
178 + >=app-accessibility/at-spi2-atk-2.5.3
179 + >=dev-libs/atk-2[introspection]
180 + >=app-crypt/gcr-3.7.5[introspection]
181 + >=dev-libs/glib-2.45.3:2[dbus]
182 + >=dev-libs/gjs-1.39
183 + >=dev-libs/gobject-introspection-1.45.4:=
184 + dev-libs/libical:=
185 + >=x11-libs/gtk+-3.15.0:3[introspection]
186 + >=media-libs/clutter-1.21.5:1.0[introspection]
187 + >=dev-libs/json-glib-0.13.2
188 + >=dev-libs/libcroco-0.6.8:0.6
189 + >=gnome-base/gnome-desktop-3.7.90:3=[introspection]
190 + >=gnome-base/gsettings-desktop-schemas-3.19.2
191 + >=gnome-base/gnome-keyring-3.3.90
192 + gnome-base/libgnome-keyring
193 + >=gnome-extra/evolution-data-server-3.17.2:=
194 + >=media-libs/gstreamer-0.11.92:1.0
195 + >=net-im/telepathy-logger-0.2.4[introspection]
196 + >=net-libs/telepathy-glib-0.19[introspection]
197 + >=sys-auth/polkit-0.100[introspection]
198 + >=x11-libs/libXfixes-5.0
199 + x11-libs/libXtst
200 + >=x11-wm/mutter-3.20.2[introspection]
201 + >=x11-libs/startup-notification-0.11
202 +
203 + ${PYTHON_DEPS}
204 + dev-python/pygobject:3[${PYTHON_USEDEP}]
205 +
206 + dev-libs/dbus-glib
207 + dev-libs/libxml2:2
208 + gnome-base/librsvg
209 + media-libs/libcanberra[gtk3]
210 + media-libs/mesa
211 + >=media-sound/pulseaudio-2
212 + >=net-libs/libsoup-2.40:2.4[introspection]
213 + x11-libs/libX11
214 + x11-libs/gdk-pixbuf:2[introspection]
215 + x11-libs/pango[introspection]
216 + x11-apps/mesa-progs
217 +
218 + bluetooth? ( >=net-wireless/gnome-bluetooth-3.9[introspection] )
219 + networkmanager? (
220 + app-crypt/libsecret
221 + >=gnome-extra/nm-applet-0.9.8
222 + >=net-misc/networkmanager-0.9.8[introspection] )
223 +"
224 +# Runtime-only deps are probably incomplete and approximate.
225 +# Introspection deps generated using:
226 +# grep -roe "imports.gi.*" gnome-shell-* | cut -f2 -d: | sort | uniq
227 +# Each block:
228 +# 1. Pull in polkit-0.101 for pretty authorization dialogs
229 +# 2. Introspection stuff needed via imports.gi.*
230 +# 3. gnome-session is needed for gnome-session-quit
231 +# 4. Control shell settings
232 +# 5. Systemd needed for suspending support
233 +# 6. xdg-utils needed for xdg-open, used by extension tool
234 +# 7. gnome-icon-theme-symbolic and dejavu font neeed for various icons & arrows
235 +# 8. IBus is needed for nls integration
236 +# 9. mobile-broadband-provider-info, timezone-data for shell-mobile-providers.c
237 +RDEPEND="${COMMON_DEPEND}
238 + >=sys-auth/polkit-0.101[introspection]
239 +
240 + >=app-accessibility/caribou-0.4.8
241 + media-libs/cogl[introspection]
242 + >=sys-apps/accountsservice-0.6.14[introspection]
243 + >=sys-power/upower-0.99:=[introspection]
244 +
245 + >=gnome-base/gnome-session-2.91.91
246 + >=gnome-base/gnome-settings-daemon-3.8.3
247 +
248 + !openrc-force? ( >=sys-apps/systemd-31 )
249 +
250 + x11-misc/xdg-utils
251 +
252 + media-fonts/dejavu
253 + >=x11-themes/adwaita-icon-theme-3.19.90
254 +
255 + networkmanager? (
256 + net-misc/mobile-broadband-provider-info
257 + sys-libs/timezone-data )
258 + nls? ( >=app-i18n/ibus-1.4.99[dconf(+),gtk3,introspection] )
259 +"
260 +# avoid circular dependency, see bug #546134
261 +PDEPEND="
262 + >=gnome-base/gdm-3.5[introspection]
263 + >=gnome-base/gnome-control-center-3.8.3[bluetooth(+)?,networkmanager(+)?]
264 +"
265 +DEPEND="${COMMON_DEPEND}
266 + dev-libs/libxslt
267 + >=dev-util/gtk-doc-am-1.17
268 + >=dev-util/intltool-0.40
269 + gnome-base/gnome-common
270 + virtual/pkgconfig
271 + !!=dev-lang/spidermonkey-1.8.2*
272 +"
273 +# libmozjs.so is picked up from /usr/lib while compiling, so block at build-time
274 +# https://bugs.gentoo.org/show_bug.cgi?id=360413
275 +
276 +src_prepare() {
277 + # Change favorites defaults, bug #479918
278 + eapply "${FILESDIR}"/${PN}-3.14.0-defaults.patch
279 +
280 + # Fix automagic gnome-bluetooth dep, bug #398145
281 + eapply "${FILESDIR}"/${PN}-3.12-bluetooth-flag.patch
282 +
283 + # Fix silent bluetooth linking failure with ld.gold, bug #503952
284 + # https://bugzilla.gnome.org/show_bug.cgi?id=726435
285 + # This shouldn't be needed per upstream
286 +# epatch "${FILESDIR}"/${PN}-3.14.0-bluetooth-gold.patch
287 +
288 + # Crash and visual corruption with nvidia-drivers, fixed in 3.20.3
289 + eapply "${FILESDIR}/${P}-st-nvidia.patch"
290 +
291 + eautoreconf
292 + gnome2_src_prepare
293 +}
294 +
295 +src_configure() {
296 + # Do not error out on warnings
297 + gnome2_src_configure \
298 + --enable-browser-plugin \
299 + --enable-man \
300 + $(use_enable !openrc-force systemd) \
301 + $(use_with bluetooth) \
302 + $(use_enable networkmanager) \
303 + BROWSER_PLUGIN_DIR="${EPREFIX}"/usr/$(get_libdir)/nsbrowser/plugins
304 +}
305 +
306 +src_install() {
307 + gnome2_src_install
308 + python_replicate_script "${ED}/usr/bin/gnome-shell-extension-tool"
309 + python_replicate_script "${ED}/usr/bin/gnome-shell-perf-tool"
310 +
311 + # Required for gnome-shell on hardened/PaX, bug #398941
312 + # Future-proof for >=spidermonkey-1.8.7 following polkit's example
313 + if has_version '<dev-lang/spidermonkey-1.8.7'; then
314 + pax-mark mr "${ED}usr/bin/gnome-shell"{,-extension-prefs}
315 + elif has_version '>=dev-lang/spidermonkey-1.8.7[jit]'; then
316 + pax-mark m "${ED}usr/bin/gnome-shell"{,-extension-prefs}
317 + # Required for gnome-shell on hardened/PaX #457146 and #457194
318 + # PaX EMUTRAMP need to be on
319 + elif has_version '>=dev-libs/libffi-3.0.13[pax_kernel]'; then
320 + pax-mark E "${ED}usr/bin/gnome-shell"{,-extension-prefs}
321 + else
322 + pax-mark m "${ED}usr/bin/gnome-shell"{,-extension-prefs}
323 + fi
324 +}
325 +
326 +pkg_postinst() {
327 + gnome2_pkg_postinst
328 +
329 + if ! has_version 'media-libs/gst-plugins-good:1.0' || \
330 + ! has_version 'media-plugins/gst-plugins-vpx:1.0'; then
331 + ewarn "To make use of GNOME Shell's built-in screen recording utility,"
332 + ewarn "you need to either install media-libs/gst-plugins-good:1.0"
333 + ewarn "and media-plugins/gst-plugins-vpx:1.0, or use dconf-editor to change"
334 + ewarn "apps.gnome-shell.recorder/pipeline to what you want to use."
335 + fi
336 +
337 + if ! has_version ">=x11-base/xorg-server-1.11"; then
338 + ewarn "If you use multiple screens, it is highly recommended that you"
339 + ewarn "upgrade to >=x11-base/xorg-server-1.11 to be able to make use of"
340 + ewarn "pointer barriers which will make it easier to use hot corners."
341 + fi
342 +
343 + if has_version "<x11-drivers/ati-drivers-12"; then
344 + ewarn "GNOME Shell has been reported to show graphical corruption under"
345 + ewarn "x11-drivers/ati-drivers-11.*; you may want to switch to open-source"
346 + ewarn "drivers."
347 + fi
348 +
349 + if ! has_version "media-libs/mesa[llvm]"; then
350 + elog "llvmpipe is used as fallback when no 3D acceleration"
351 + elog "is available. You will need to enable llvm USE for"
352 + elog "media-libs/mesa."
353 + fi
354 +
355 + # https://bugs.gentoo.org/show_bug.cgi?id=563084
356 + if has_version "x11-drivers/nvidia-drivers[-kms]"; then
357 + ewarn "You will need to enable kms support in x11-drivers/nvidia-drivers,"
358 + ewarn "otherwise Gnome will fail to start"
359 + fi
360 +
361 + if ! systemd_is_booted; then
362 + ewarn "${PN} needs Systemd to be *running* for working"
363 + ewarn "properly. Please follow this guide to migrate:"
364 + ewarn "https://wiki.gentoo.org/wiki/Systemd"
365 + fi
366 +
367 + if use openrc-force; then
368 + ewarn "You are enabling 'openrc-force' USE flag to skip systemd requirement,"
369 + ewarn "this can lead to unexpected problems and is not supported neither by"
370 + ewarn "upstream neither by Gnome Gentoo maintainers. If you suffer any problem,"
371 + ewarn "you will need to disable this USE flag system wide and retest before"
372 + ewarn "opening any bug report."
373 + fi
374 +}