Blame SOURCES/disable-detection-of-gtk.patch

bbbf6c
diff -up matplotlib-1.2.0/setupext.py.remove-need-for-xvfb matplotlib-1.2.0/setupext.py
bbbf6c
--- matplotlib-1.2.0/setupext.py.remove-need-for-xvfb	2013-03-05 16:48:16.785361527 -0500
bbbf6c
+++ matplotlib-1.2.0/setupext.py	2013-03-05 16:50:57.535350535 -0500
bbbf6c
@@ -656,20 +656,10 @@ def check_for_gtk():
bbbf6c
     'check for the presence of pygtk'
bbbf6c
     gotit = False
bbbf6c
     explanation = None
bbbf6c
-    try:
bbbf6c
-        import gtk
bbbf6c
-    except ImportError:
bbbf6c
-        explanation = 'Building for Gtk+ requires pygtk; you must be able to "import gtk" in your build/install environment'
bbbf6c
-    except RuntimeError:
bbbf6c
-        explanation = 'pygtk present but import failed'
bbbf6c
-    else:
bbbf6c
-        version = (2,2,0)
bbbf6c
-        if gtk.pygtk_version < version:
bbbf6c
-            explanation = "Error: GTK backend requires PyGTK %d.%d.%d (or later), " \
bbbf6c
-                  "%d.%d.%d was detected." % (
bbbf6c
-                version + gtk.pygtk_version)
bbbf6c
-        else:
bbbf6c
-            gotit = True
bbbf6c
+
bbbf6c
+    # Don't try to detect if "import gtk" succeeds, as this requires a
bbbf6c
+    # working X server, and $DISPLAY is unset in an rpm build.
bbbf6c
+    gotit = True
bbbf6c
 
bbbf6c
     if gotit:
bbbf6c
         module = make_extension('test', [])
bbbf6c
@@ -684,27 +674,13 @@ def check_for_gtk():
bbbf6c
         return ".".join([str(x) for x in tup])
bbbf6c
 
bbbf6c
     if gotit:
bbbf6c
-        import gobject
bbbf6c
-        if hasattr(gobject, 'pygobject_version'):
bbbf6c
-            pygobject_version = ver2str(gobject.pygobject_version)
bbbf6c
-        else:
bbbf6c
-            pygobject_version = '[pre-pygobject]'
bbbf6c
-        print_status("Gtk+", "gtk+: %s, glib: %s, pygtk: %s, pygobject: %s" %
bbbf6c
-                     (ver2str(gtk.gtk_version), ver2str(gobject.glib_version),
bbbf6c
-                      ver2str(gtk.pygtk_version), pygobject_version))
bbbf6c
+        print_status("Gtk+", "(assuming it it present)")
bbbf6c
     else:
bbbf6c
         print_status("Gtk+", "no")
bbbf6c
 
bbbf6c
     if explanation is not None:
bbbf6c
         print_message(explanation)
bbbf6c
 
bbbf6c
-    # Switch off the event loop for PyGTK >= 2.15.0
bbbf6c
-    if gotit:
bbbf6c
-        try:
bbbf6c
-            gtk.set_interactive(False)
bbbf6c
-        except AttributeError: # PyGTK < 2.15.0
bbbf6c
-            pass
bbbf6c
-
bbbf6c
     return gotit
bbbf6c
 
bbbf6c
 def add_pygtk_flags(module):