Backport a patch for GdkRectangle changes in gtk+ 3.17.2

This commit is contained in:
Kalev Lember 2015-06-03 12:54:27 +02:00
parent c21bd0d673
commit ec6a91e64d
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From 7a3bb6971f22accd25e987496d377e1879f6e1ba Mon Sep 17 00:00:00 2001
From: Christoph Reiter <creiter@src.gnome.org>
Date: Sat, 30 May 2015 17:46:54 +0200
Subject: [PATCH] Remove Gdk.Rectangle alias with newer gobject-introspection
and GTK+
The new GdkRectangle in the typelib confuses the marshalling code
as PyGObject uses the Python class from the overrides for marshalling
to Python but uses the gtype from the typelib to do
type checking when marshalling from Python.
https://bugzilla.gnome.org/show_bug.cgi?id=749625
---
gi/overrides/Gdk.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index 15f2a0a..3ab5d6d 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -126,10 +126,14 @@ if Gdk._version == '2.0':
Rectangle = override(Rectangle)
__all__.append('Rectangle')
else:
- from gi.repository import cairo as _cairo
- Rectangle = _cairo.RectangleInt
+ # Newer GTK+/gobject-introspection (3.17.x) include GdkRectangle in the
+ # typelib. See https://bugzilla.gnome.org/show_bug.cgi?id=748832 and
+ # https://bugzilla.gnome.org/show_bug.cgi?id=748833
+ if not hasattr(Gdk, 'Rectangle'):
+ from gi.repository import cairo as _cairo
+ Rectangle = _cairo.RectangleInt
- __all__.append('Rectangle')
+ __all__.append('Rectangle')
if Gdk._version == '2.0':
class Drawable(Gdk.Drawable):
--
2.4.2

View File

@ -22,13 +22,15 @@
Name: pygobject3
Version: 3.16.1
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+ and MIT
Group: Development/Languages
Summary: Python 2 bindings for GObject Introspection
URL: https://live.gnome.org/PyGObject
#VCS: git:git://git.gnome.org/pygobject
Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.16/pygobject-%{version}.tar.xz
# https://bugzilla.gnome.org/show_bug.cgi?id=748833
Patch0: 0001-Remove-Gdk.Rectangle-alias-with-newer-gobject-intros.patch
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
@ -106,6 +108,7 @@ for use in Python 3 programs.
%prep
%setup -q -n pygobject-%{version}
%patch0 -p1
%if 0%{?with_python3}
rm -rf %{py3dir}
@ -211,6 +214,9 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity}
%endif # with_python3
%changelog
* Wed Jun 03 2015 Kalev Lember <kalevlember@gmail.com> - 3.16.1-2
- Backport a patch for GdkRectangle changes in gtk+ 3.17.2
* Tue Apr 14 2015 Kalev Lember <kalevlember@gmail.com> - 3.16.1-1
- Update to 3.16.1