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