From ec6a91e64d132d1c93ff0bcb929f339237503f7f Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 3 Jun 2015 12:54:27 +0200 Subject: [PATCH] Backport a patch for GdkRectangle changes in gtk+ 3.17.2 --- ...ngle-alias-with-newer-gobject-intros.patch | 41 +++++++++++++++++++ pygobject3.spec | 8 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-Remove-Gdk.Rectangle-alias-with-newer-gobject-intros.patch diff --git a/0001-Remove-Gdk.Rectangle-alias-with-newer-gobject-intros.patch b/0001-Remove-Gdk.Rectangle-alias-with-newer-gobject-intros.patch new file mode 100644 index 0000000..e0ce3da --- /dev/null +++ b/0001-Remove-Gdk.Rectangle-alias-with-newer-gobject-intros.patch @@ -0,0 +1,41 @@ +From 7a3bb6971f22accd25e987496d377e1879f6e1ba Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +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 + diff --git a/pygobject3.spec b/pygobject3.spec index d2638cc..16cd5e6 100644 --- a/pygobject3.spec +++ b/pygobject3.spec @@ -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 - 3.16.1-2 +- Backport a patch for GdkRectangle changes in gtk+ 3.17.2 + * Tue Apr 14 2015 Kalev Lember - 3.16.1-1 - Update to 3.16.1