[glade3/f16] add a patch to build with pygobject3

John Palmieri (J5) johnp at fedoraproject.org
Fri Sep 16 21:19:29 UTC 2011


commit 61b224a383473f68a7115633c730cff3ef9e1cab
Author: John (J5) Palmieri <johnp at redhat.com>
Date:   Fri Sep 16 15:59:20 2011 -0400

    add a patch to build with pygobject3

 bump-to-pygobject3.patch |   93 ++++++++++++++++++++++++++++++++++++++++++++++
 glade3.spec              |   14 ++++++-
 2 files changed, 105 insertions(+), 2 deletions(-)
---
diff --git a/bump-to-pygobject3.patch b/bump-to-pygobject3.patch
new file mode 100644
index 0000000..7408b5b
--- /dev/null
+++ b/bump-to-pygobject3.patch
@@ -0,0 +1,93 @@
+From c34c48dfb4d40c57a5b99a16b16feb41a1433582 Mon Sep 17 00:00:00 2001
+From: Ignacio Casal Quinteiro <icq at gnome.org>
+Date: Fri, 9 Sep 2011 17:22:42 +0200
+Subject: [PATCH] Bump pygobject requisite to pygobject 3.
+
+---
+ configure.ac                  |    6 +++---
+ plugins/python/glade-python.c |   38 +++++++++++++++++++++-----------------
+ 2 files changed, 24 insertions(+), 20 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d24cf2f..9108d4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -144,9 +144,9 @@ AM_CONDITIONAL(HAVE_GTK_UNIX_PRINT, test x"$have_unix_print" = "xyes")
+ dnl ================================================================
+ dnl Python for optional python dev libs
+ dnl ================================================================
+-PYGOBJECT_REQS=2.27.0
++PYGOBJECT_REQS=2.90.0
+ PYGOBJECT_REQUIRED_MAJOR=2
+-PYGOBJECT_REQUIRED_MINOR=27
++PYGOBJECT_REQUIRED_MINOR=90
+ PYGOBJECT_REQUIRED_MICRO=0
+ 
+ AC_ARG_ENABLE(python,
+@@ -156,7 +156,7 @@ AC_ARG_ENABLE(python,
+ if test x"$check_python" = x"yes"; then
+   have_python=yes
+ 
+-  PKG_CHECK_MODULES([PYGOBJECT],[pygobject-2.0 >= ${PYGOBJECT_REQUIRED_MAJOR}.${PYGOBJECT_REQUIRED_MINOR}.${PYGOBJECT_REQUIRED_MICRO}],[have_pygobject=yes],[have_pygobject=no])
++  PKG_CHECK_MODULES([PYGOBJECT],[pygobject-3.0 >= ${PYGOBJECT_REQUIRED_MAJOR}.${PYGOBJECT_REQUIRED_MINOR}.${PYGOBJECT_REQUIRED_MICRO}],[have_pygobject=yes],[have_pygobject=no])
+ 
+   AM_CHECK_PYTHON_HEADERS(, [have_python_headers=no])
+   AM_CHECK_PYTHON_LIBS(, [have_python_lib=no])
+diff --git a/plugins/python/glade-python.c b/plugins/python/glade-python.c
+index 833b7de..14a2679 100644
+--- a/plugins/python/glade-python.c
++++ b/plugins/python/glade-python.c
+@@ -44,29 +44,33 @@ python_init (void)
+ static void
+ glade_python_init_pygobject_check (gint req_major, gint req_minor, gint req_micro)
+ {
+-  PyObject *gobject, *mdict, *version;
+-  int found_major, found_minor, found_micro;
++  PyObject *gi, *gobject;
+ 
+-  init_pygobject ();
++  /* import gobject */
++  pygobject_init (req_major, req_minor, req_micro);
++  if (PyErr_Occurred ())
++    {
++      g_warning ("Error initializing Python interpreter: could not "
++                 "import pygobject");
++
++      return;
++    }
+ 
+-  gobject = PyImport_ImportModule ("gobject");
+-  mdict = PyModule_GetDict (gobject);
+-  version = PyDict_GetItemString (mdict, "pygobject_version");
+-  if (!version)
++  gi = PyImport_ImportModule ("gi");
++  if (gi == NULL)
+     {
+-      PyErr_SetString (PyExc_ImportError, "PyGObject version too old");
++      g_warning ("Error initializing Python interpreter: could not "
++                 "import gi");
++
+       return;
+     }
+-  if (!PyArg_ParseTuple
+-      (version, "iii", &found_major, &found_minor, &found_micro))
+-    return;
+-  if (req_major != found_major || req_minor > found_minor ||
+-      (req_minor == found_minor && req_micro > found_micro))
++
++  gobject = PyImport_ImportModule ("gi.repository.GObject");
++  if (gobject == NULL)
+     {
+-      PyErr_Format (PyExc_ImportError,
+-                    "PyGObject version mismatch, %d.%d.%d is required, "
+-                    "found %d.%d.%d.", req_major, req_minor, req_micro,
+-                    found_major, found_minor, found_micro);
++      g_warning ("Error initializing Python interpreter: could not "
++                 "import gobject");
++
+       return;
+     }
+ }
+-- 
+1.7.6.1
+
diff --git a/glade3.spec b/glade3.spec
index 9086533..ebf43fc 100644
--- a/glade3.spec
+++ b/glade3.spec
@@ -1,12 +1,14 @@
 Summary:	User Interface Designer for GTK+ and GNOME
 Name:		glade3
 Version:	3.10.0
-Release:	2%{?dist}
+Release:	3%{?dist}
 Epoch:		1
 License:	GPLv2+
 Group:		Development/Tools
 URL:		http://glade.gnome.org/
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/glade/3.10/glade-%{version}.tar.bz2
+Patch0:		bump-to-pygobject3.patch
+
 BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Requires:	hicolor-icon-theme
 Requires:	%{name}-libgladeui = %{?epoch:%{epoch}:}:%{version}-%{release}
@@ -18,10 +20,11 @@ BuildRequires:	gtk-doc
 BuildRequires:	intltool
 BuildRequires:	libtool
 BuildRequires:	libxml2-devel
-BuildRequires:	pygobject2-devel
+BuildRequires:	pygobject3-devel
 BuildRequires:	python2-devel
 BuildRequires:	scrollkeeper
 BuildRequires:	chrpath
+BuildRequires:	autoconf
 
 %description
 Glade is a RAD tool to enable quick and easy development of user interfaces for
@@ -60,12 +63,15 @@ This package contains development files for %{name}-libgladeui.
 
 %prep
 %setup -q -n glade-%{version}
+%patch0 -p1 -b .bump-to-pygobject3
 
 # Suppress rpmlint warning.
 chmod 644 ./plugins/gtk+/glade-attributes.c
 chmod 644 ./plugins/gtk+/glade-attributes.h
 
 %build
+autoreconf
+
 %configure --disable-static \
   --enable-gtk-doc \
   --enable-python \
@@ -188,6 +194,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{_includedir}/libgladeui-2.0/gladeui
 
 %changelog
+* Fri Sep 16 2011 John (J5) Palmieri <johnp at redhat.com> - 1:3.10.0-3
+- add patch to make compile against pygobject3 so that we can
+  load custom python widgets
+
 * Sat May 07 2011 Christopher Aillon <caillon at redhat.com> - 1:3.10.0-2
 - Update scriptlets
 


More information about the scm-commits mailing list