Gentoo Archives: gentoo-commits

From: Alexandre Restovtsev <tetromino@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:gnome-next commit in: app-accessibility/caribou/, app-accessibility/caribou/files/
Date: Tue, 30 Aug 2011 05:38:07
Message-Id: 51c5b6af66c6f77f3244b5c27ca19b25bc884473.tetromino@gentoo
1 commit: 51c5b6af66c6f77f3244b5c27ca19b25bc884473
2 Author: Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
3 AuthorDate: Tue Aug 30 05:33:56 2011 +0000
4 Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
5 CommitDate: Tue Aug 30 05:35:11 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=51c5b6af
7
8 app-accessibility/caribou: 0.2.00 → 0.3.5
9
10 Bump to gnome-3.1.x release; massive number of changes. Add a patch for
11 compatibility with pygobject:3 (see upstream bug 657666). Also, delete
12 the custom PYTHONPATH in shell files; it is totally unnecessary on
13 Gentoo systems, and can lead to errors (e.g. on multilib strict).
14
15 ---
16 app-accessibility/caribou/caribou-0.2.00.ebuild | 38 ---
17 app-accessibility/caribou/caribou-0.3.5.ebuild | 86 ++++++
18 .../caribou/files/caribou-0.3.5-pygobject-3.patch | 304 ++++++++++++++++++++
19 3 files changed, 390 insertions(+), 38 deletions(-)
20
21 diff --git a/app-accessibility/caribou/caribou-0.2.00.ebuild b/app-accessibility/caribou/caribou-0.2.00.ebuild
22 deleted file mode 100644
23 index c0c790d..0000000
24 --- a/app-accessibility/caribou/caribou-0.2.00.ebuild
25 +++ /dev/null
26 @@ -1,38 +0,0 @@
27 -# Copyright 1999-2011 Gentoo Foundation
28 -# Distributed under the terms of the GNU General Public License v2
29 -# $Header: $
30 -
31 -EAPI="3"
32 -GCONF_DEBUG="no"
33 -PYTHON_DEPEND="2:2.4"
34 -SUPPORT_PYTHON_ABIS="1"
35 -RESTRICT_PYTHON_ABIS="3.*"
36 -
37 -inherit gnome2-python
38 -
39 -DESCRIPTION="Input assistive technology intended for switch and pointer users"
40 -HOMEPAGE="https://live.gnome.org/Caribou"
41 -
42 -LICENSE="LGPL-2.1"
43 -SLOT="0"
44 -KEYWORDS="~amd64 ~x86"
45 -IUSE=""
46 -
47 -COMMON_DEPEND=">=dev-python/pygobject-2.27.92:2
48 - >=x11-libs/gtk+-2.91.8:3
49 - >=media-libs/clutter-1.5.11:1.0"
50 -# gsettings-desktop-schemas is needed for the 'toolkit-accessibility' key
51 -RDEPEND="${COMMON_DEPEND}
52 - dev-python/pyatspi
53 - dev-python/python-virtkey
54 - gnome-base/gsettings-desktop-schemas"
55 -DEPEND="${RDEPEND}
56 - >=dev-util/intltool-0.35.5
57 - app-text/gnome-doc-utils"
58 -
59 -DOCS="AUTHORS ChangeLog NEWS README"
60 -
61 -src_install() {
62 - gnome2-python_src_install
63 - python_convert_shebangs -r 2 "${ED}"
64 -}
65
66 diff --git a/app-accessibility/caribou/caribou-0.3.5.ebuild b/app-accessibility/caribou/caribou-0.3.5.ebuild
67 new file mode 100644
68 index 0000000..3aa4994
69 --- /dev/null
70 +++ b/app-accessibility/caribou/caribou-0.3.5.ebuild
71 @@ -0,0 +1,86 @@
72 +# Copyright 1999-2011 Gentoo Foundation
73 +# Distributed under the terms of the GNU General Public License v2
74 +# $Header: $
75 +
76 +EAPI="3"
77 +GNOME_TARBALL_SUFFIX="xz"
78 +GCONF_DEBUG="no"
79 +GNOME2_LA_PUNT="yes"
80 +PYTHON_DEPEND="2:2.4"
81 +PYTHON_USE_WITH="xml"
82 +SUPPORT_PYTHON_ABIS="1"
83 +RESTRICT_PYTHON_ABIS="3.*"
84 +
85 +inherit eutils gnome2-python
86 +
87 +DESCRIPTION="Input assistive technology intended for switch and pointer users"
88 +HOMEPAGE="https://live.gnome.org/Caribou"
89 +
90 +LICENSE="LGPL-2.1"
91 +SLOT="0"
92 +KEYWORDS="~amd64 ~x86"
93 +IUSE=""
94 +
95 +COMMON_DEPEND=">=dev-python/pygobject-2.27.92:2[introspection]
96 + >=x11-libs/gtk+-3.0.0:3[introspection]
97 + x11-libs/gtk+:2
98 + >=dev-libs/gobject-introspection-0.10.7
99 + dev-libs/libgee
100 + dev-libs/libxml2
101 + >=media-libs/clutter-1.5.11:1.0[introspection]
102 + x11-libs/libX11
103 + x11-libs/libxklavier
104 + x11-libs/libXtst"
105 +# gsettings-desktop-schemas is needed for the 'toolkit-accessibility' key
106 +# pyatspi-2.1.90 needed to run caribou if pygobject:3 is installed
107 +# librsvg[gtk3] needed to load svg images in css styles
108 +RDEPEND="${COMMON_DEPEND}
109 + dev-python/dbus-python
110 + >=dev-python/pyatspi-2.1.90
111 + gnome-base/gconf[introspection]
112 + gnome-base/gsettings-desktop-schemas
113 + gnome-base/librsvg[gtk3]
114 + sys-apps/dbus"
115 +DEPEND="${RDEPEND}
116 + >=dev-util/intltool-0.35.5
117 + app-text/gnome-doc-utils"
118 +
119 +DOCS="AUTHORS ChangeLog NEWS README"
120 +
121 +pkg_setup() {
122 + gnome2-python_pkg_setup
123 + G2CONF="${G2CONF}
124 + --disable-static
125 + --disable-schemas-compile
126 + --disable-maintainer-mode
127 + --enable-gtk3-module
128 + --enable-gtk2-module
129 + VALAC="
130 + # vala is not needed for tarball builds, but configure checks for it...
131 +}
132 +
133 +src_prepare() {
134 + # https://bugzilla.gnome.org/show_bug.cgi?id=657666
135 + epatch "${FILESDIR}/${PN}-0.3.5-pygobject-3.patch"
136 + # delete custom PYTHONPATH, useless on Gentoo and potential bug source
137 + sed -e '/export PYTHONPATH=.*python/ d' \
138 + -i bin/{antler-keyboard,caribou,caribou-preferences}.in ||
139 + die "sed failed"
140 +
141 + gnome2-python_src_prepare
142 +}
143 +
144 +src_install() {
145 + gnome2-python_src_install
146 + python_convert_shebangs -r 2 "${ED}"
147 +}
148 +
149 +pkg_postinst() {
150 + gnome2_pkg_postinst
151 + python_mod_optimize caribou
152 +}
153 +
154 +pkg_postrm() {
155 + gnome2_pkg_postrm
156 + python_mod_cleanup caribou
157 +}
158
159 diff --git a/app-accessibility/caribou/files/caribou-0.3.5-pygobject-3.patch b/app-accessibility/caribou/files/caribou-0.3.5-pygobject-3.patch
160 new file mode 100644
161 index 0000000..39f25c4
162 --- /dev/null
163 +++ b/app-accessibility/caribou/files/caribou-0.3.5-pygobject-3.patch
164 @@ -0,0 +1,304 @@
165 +From fc6795b711e8449a2bbeaa69bebda02e77bc84fe Mon Sep 17 00:00:00 2001
166 +From: Alexandre Rostovtsev <tetromino@×××××.com>
167 +Date: Mon, 29 Aug 2011 23:05:11 -0400
168 +Subject: [PATCH] Use GLib, GObject from gi.repository instead of glib,
169 + gobject
170 +
171 +Use GLib and GObject from gi.repository instead of glib and gobject
172 +modules for compatibility with pygobject-3.0. Otherwise, when running on
173 +a system with pygobject-2.0 and pygobject-3.0 installed, caribou-preferences
174 +fails with
175 +
176 +ImportError: could not import gobject (error was: ImportError('When
177 +using gi.repository you must not import static modules like "gobject".
178 +Please change all occurrences of "import gobject" to "from gi.repository
179 +import GObject".',))
180 +
181 +https://bugzilla.gnome.org/show_bug.cgi?id=657666
182 +---
183 + bin/antler-keyboard.in | 2 +-
184 + bin/caribou-preferences.in | 2 +-
185 + caribou/antler/keyboard_view.py | 18 +++++++++---------
186 + caribou/antler/main.py | 7 +++----
187 + caribou/antler/window.py | 14 +++++++-------
188 + caribou/settings/preferences_window.py | 6 +++---
189 + caribou/settings/setting_types.py | 27 +++++++++++++--------------
190 + 7 files changed, 37 insertions(+), 39 deletions(-)
191 +
192 +diff --git a/bin/antler-keyboard.in b/bin/antler-keyboard.in
193 +index 1b0c450..ce64128 100755
194 +--- a/bin/antler-keyboard.in
195 ++++ b/bin/antler-keyboard.in
196 +@@ -25,7 +25,7 @@ exec_prefix=@exec_prefix@
197 +
198 + if [ $script_dir == "@libexecdir@" ]
199 + then
200 +- datadir="$(@PYTHON@ -c "import glib; print ':'.join(glib.get_system_data_dirs())")"
201 ++ datadir="$(@PYTHON@ -c "from gi.repository import GLib; print ':'.join(GLib.get_system_data_dirs())")"
202 + export PYTHONPATH="${prefix}/lib/python@PYTHON_VERSION@/site-packages${PYTHONPATH:+:$PYTHONPATH}"
203 + export GI_TYPELIB_PATH="@libdir@/girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
204 + export LD_LIBRARY_PATH="@libdir@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
205 +diff --git a/bin/caribou-preferences.in b/bin/caribou-preferences.in
206 +index 6aae29e..57772e7 100755
207 +--- a/bin/caribou-preferences.in
208 ++++ b/bin/caribou-preferences.in
209 +@@ -25,7 +25,7 @@ exec_prefix=@exec_prefix@
210 +
211 + if [ $script_dir == "@bindir@" ]
212 + then
213 +- datadir="$(@PYTHON@ -c "import glib; print ':'.join(glib.get_system_data_dirs())")"
214 ++ datadir="$(@PYTHON@ -c "from gi.repository import GLib; print ':'.join(GLib.get_system_data_dirs())")"
215 + export PYTHONPATH="@prefix@/lib/python@PYTHON_VERSION@/site-packages${PYTHONPATH:+:$PYTHONPATH}"
216 + export GI_TYPELIB_PATH="@libdir@/girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
217 + export LD_LIBRARY_PATH="@libdir@${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}"
218 +diff --git a/caribou/antler/keyboard_view.py b/caribou/antler/keyboard_view.py
219 +index 3e09d94..350be91 100644
220 +--- a/caribou/antler/keyboard_view.py
221 ++++ b/caribou/antler/keyboard_view.py
222 +@@ -3,9 +3,9 @@ from caribou.settings import CaribouSettings
223 + from antler_settings import AntlerSettings
224 + from gi.repository import Gtk
225 + from gi.repository import Gdk
226 ++from gi.repository import GObject
227 ++from gi.repository import GLib
228 + from gi.repository import Caribou
229 +-import gobject
230 +-import glib
231 + import os
232 + from math import ceil
233 +
234 +@@ -30,7 +30,7 @@ PRETTY_LABELS = {
235 +
236 + class AntlerKey(Gtk.Button):
237 + def __init__(self, key, spacing=0):
238 +- gobject.GObject.__init__(self)
239 ++ GObject.GObject.__init__(self)
240 + self.caribou_key = key.weak_ref()
241 + self.set_label(self._get_key_label())
242 + self._spacing = spacing
243 +@@ -71,7 +71,7 @@ class AntlerKey(Gtk.Button):
244 + if not unichar.isspace() and unichar != u'\x00':
245 + label = unichar
246 +
247 +- return "<b>%s</b>" % glib.markup_escape_text(label.encode('utf-8'))
248 ++ return "<b>%s</b>" % GLib.markup_escape_text(label.encode('utf-8'))
249 +
250 + def _caribou_key_pressed (self, key, _key):
251 + self.set_state_flags(Gtk.StateFlags.ACTIVE, False)
252 +@@ -106,7 +106,7 @@ class AntlerKey(Gtk.Button):
253 +
254 + class AntlerSubLevel(Gtk.Window):
255 + def __init__(self, key):
256 +- gobject.GObject.__init__(self, type=Gtk.WindowType.POPUP)
257 ++ GObject.GObject.__init__(self, type=Gtk.WindowType.POPUP)
258 +
259 + self.set_decorated(False)
260 + self.set_resizable(False)
261 +@@ -138,7 +138,7 @@ class AntlerLayout(Gtk.Box):
262 + KEY_SPAN = 4
263 +
264 + def __init__(self, level=None, spacing=6):
265 +- gobject.GObject.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
266 ++ GObject.GObject.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
267 + self.set_spacing(12)
268 + self._columns = []
269 + self._keys_map = {}
270 +@@ -243,7 +243,7 @@ class AntlerLayout(Gtk.Box):
271 +
272 + class AntlerKeyboardView(Gtk.Notebook):
273 + def __init__(self, keyboard_type):
274 +- gobject.GObject.__init__(self)
275 ++ GObject.GObject.__init__(self)
276 + settings = AntlerSettings()
277 + self.set_show_tabs(False)
278 +
279 +@@ -253,7 +253,7 @@ class AntlerKeyboardView(Gtk.Notebook):
280 + self._app_css_provider = Gtk.CssProvider()
281 + self._load_style(
282 + self._app_css_provider, "style.css",
283 +- [glib.get_user_data_dir()] + list(glib.get_system_data_dirs()))
284 ++ [GLib.get_user_data_dir()] + list(GLib.get_system_data_dirs()))
285 +
286 + if not use_system.value:
287 + Gtk.StyleContext.add_provider_for_screen(
288 +@@ -262,7 +262,7 @@ class AntlerKeyboardView(Gtk.Notebook):
289 +
290 + self._user_css_provider = Gtk.CssProvider()
291 + self._load_style(self._user_css_provider, "user-style.css",
292 +- [glib.get_user_data_dir()])
293 ++ [GLib.get_user_data_dir()])
294 + Gtk.StyleContext.add_provider_for_screen(
295 + Gdk.Screen.get_default(), self._user_css_provider,
296 + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + 1)
297 +diff --git a/caribou/antler/main.py b/caribou/antler/main.py
298 +index 6bd3932..fab1c60 100644
299 +--- a/caribou/antler/main.py
300 ++++ b/caribou/antler/main.py
301 +@@ -1,17 +1,16 @@
302 +-from gi.repository import Caribou
303 ++from gi.repository import Caribou, GObject
304 + from window import AntlerWindowEntry
305 + from keyboard_view import AntlerKeyboardView
306 +-import gobject
307 + import sys
308 +
309 + class AntlerKeyboardService(Caribou.KeyboardService):
310 + def __init__(self):
311 +- gobject.GObject.__init__(self)
312 ++ GObject.GObject.__init__(self)
313 + self.register_keyboard("Antler")
314 + self.window = AntlerWindowEntry(AntlerKeyboardView)
315 +
316 + def run(self):
317 +- loop = gobject.MainLoop()
318 ++ loop = GObject.MainLoop()
319 + loop.run()
320 +
321 + def do_show(self, timestamp):
322 +diff --git a/caribou/antler/window.py b/caribou/antler/window.py
323 +index a72203e..f7c5fa5 100644
324 +--- a/caribou/antler/window.py
325 ++++ b/caribou/antler/window.py
326 +@@ -22,24 +22,24 @@
327 +
328 + from gi.repository import Gtk
329 + from gi.repository import Gdk
330 ++from gi.repository import GObject
331 + from gi.repository import Clutter
332 + from antler_settings import AntlerSettings
333 + from math import sqrt
334 + import os
335 + import sys
336 +-import gobject
337 +
338 + Clutter.init("antler")
339 +
340 +
341 + class AnimatedWindowBase(Gtk.Window, Clutter.Animatable):
342 + __gproperties__ = {
343 +- 'antler-window-position' : (gobject.TYPE_PYOBJECT, 'Window position',
344 ++ 'antler-window-position' : (GObject.TYPE_PYOBJECT, 'Window position',
345 + 'Window position in X, Y coordinates',
346 +- gobject.PARAM_READWRITE)
347 ++ GObject.PARAM_READWRITE)
348 + }
349 + def __init__(self):
350 +- gobject.GObject.__init__(self, type=Gtk.WindowType.POPUP)
351 ++ GObject.GObject.__init__(self, type=Gtk.WindowType.POPUP)
352 + # animation
353 + self._stage = Clutter.Stage.get_default()
354 + self._move_animation = None
355 +@@ -71,7 +71,7 @@ class AnimatedWindowBase(Gtk.Window, Clutter.Animatable):
356 + return True
357 + if prop_name == "opacity":
358 + opacity = initial_value + ((final_value - initial_value) * progress)
359 +- gobject.idle_add(lambda: self.set_opacity(opacity))
360 ++ GObject.idle_add(lambda: self.set_opacity(opacity))
361 +
362 + return True
363 + else:
364 +@@ -132,9 +132,9 @@ class ProximityWindowBase(AnimatedWindowBase):
365 + self.min_alpha = min_alpha
366 + if self.max_alpha != self.min_alpha:
367 + if self._poll_tid == 0:
368 +- self._poll_tid = gobject.timeout_add(100, self._proximity_check)
369 ++ self._poll_tid = GObject.timeout_add(100, self._proximity_check)
370 + elif self._poll_tid != 0:
371 +- gobject.source_remove(self._poll_tid)
372 ++ GObject.source_remove(self._poll_tid)
373 +
374 + def _onmapped(self, obj, event, settings):
375 + if self.is_composited():
376 +diff --git a/caribou/settings/preferences_window.py b/caribou/settings/preferences_window.py
377 +index 55f9fca..541ecb5 100644
378 +--- a/caribou/settings/preferences_window.py
379 ++++ b/caribou/settings/preferences_window.py
380 +@@ -20,7 +20,7 @@
381 +
382 + from caribou.settings.setting_types import *
383 +
384 +-import gobject
385 ++from gi.repository import GObject
386 + from gi.repository import Gdk
387 + from gi.repository import Gtk
388 +
389 +@@ -230,7 +230,7 @@ class PreferencesDialog(Gtk.Dialog, AbstractPreferencesUI):
390 + __gtype_name__ = "PreferencesDialog"
391 +
392 + def __init__(self, settings_manager):
393 +- gobject.GObject.__init__(self)
394 ++ GObject.GObject.__init__(self)
395 + self.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
396 + self.set_border_width(6)
397 + self.set_title(settings_manager.groups.label)
398 +@@ -243,7 +243,7 @@ class PreferencesWindow(Gtk.Window, AbstractPreferencesUI):
399 + __gtype_name__ = "PreferencesWindow"
400 +
401 + def __init__(self, settings_manager):
402 +- gobject.GObject.__init__(self)
403 ++ GObject.GObject.__init__(self)
404 + self.set_border_width(6)
405 + self.set_title(settings_manager.groups.label)
406 +
407 +diff --git a/caribou/settings/setting_types.py b/caribou/settings/setting_types.py
408 +index 66fb0f0..c4af2a6 100644
409 +--- a/caribou/settings/setting_types.py
410 ++++ b/caribou/settings/setting_types.py
411 +@@ -1,5 +1,4 @@
412 +-import gobject
413 +-from gi.repository import GLib
414 ++from gi.repository import GLib, GObject
415 +
416 + ENTRY_DEFAULT=0
417 + ENTRY_COMBO=1
418 +@@ -10,17 +9,17 @@ ENTRY_SLIDER=5
419 + ENTRY_CHECKBOX=6
420 + ENTRY_RADIO=7
421 +
422 +-class Setting(gobject.GObject):
423 ++class Setting(GObject.GObject):
424 + __gsignals__ = {'value-changed' :
425 +- (gobject.SIGNAL_RUN_FIRST,
426 +- gobject.TYPE_NONE,
427 +- (gobject.TYPE_PYOBJECT,)),
428 ++ (GObject.SIGNAL_RUN_FIRST,
429 ++ GObject.TYPE_NONE,
430 ++ (GObject.TYPE_PYOBJECT,)),
431 + 'sensitivity-changed' :
432 +- (gobject.SIGNAL_RUN_FIRST,
433 +- gobject.TYPE_NONE,
434 +- (gobject.TYPE_BOOLEAN,))}
435 ++ (GObject.SIGNAL_RUN_FIRST,
436 ++ GObject.TYPE_NONE,
437 ++ (GObject.TYPE_BOOLEAN,))}
438 + def __init__(self, name, label, children=[]):
439 +- gobject.GObject.__init__(self)
440 ++ GObject.GObject.__init__(self)
441 + self.name = name
442 + self.label = label
443 + self.children = children
444 +@@ -129,8 +128,8 @@ class IntegerSetting(ValueSetting):
445 + variant_type = 'i'
446 + entry_type = ENTRY_SPIN
447 + def __init__(self, *args, **kwargs):
448 +- self.min = kwargs.pop('min', gobject.G_MININT)
449 +- self.max = kwargs.pop('max', gobject.G_MAXINT)
450 ++ self.min = kwargs.pop('min', GObject.G_MININT)
451 ++ self.max = kwargs.pop('max', GObject.G_MAXINT)
452 + ValueSetting.__init__(self, *args, **kwargs)
453 +
454 + def convert_value(self, val):
455 +@@ -140,8 +139,8 @@ class FloatSetting(ValueSetting):
456 + variant_type = 'd'
457 + entry_type = ENTRY_SPIN
458 + def __init__(self, *args, **kwargs):
459 +- self.min = kwargs.pop('min', gobject.G_MINFLOAT)
460 +- self.max = kwargs.pop('max', gobject.G_MAXFLOAT)
461 ++ self.min = kwargs.pop('min', GObject.G_MINFLOAT)
462 ++ self.max = kwargs.pop('max', GObject.G_MAXFLOAT)
463 + ValueSetting.__init__(self, *args, **kwargs)
464 +
465 + def convert_value(self, val):
466 +--
467 +1.7.6.1
468 +