@@ -278,6 +278,14 @@ def getoutput(s):
278278 ret = os .popen (s ).read ().strip ()
279279 return ret
280280
281+ def convert_qt_version (version ):
282+ version = '%x' % version
283+ temp = []
284+ while len (version ) > 0 :
285+ version , chunk = version [:- 2 ], version [- 2 :]
286+ temp .insert (0 , str (int (chunk , 16 )))
287+ return '.' .join (temp )
288+
281289def check_for_qt ():
282290 try :
283291 import pyqtconfig
@@ -286,20 +294,20 @@ def check_for_qt():
286294 return False
287295 else :
288296 print_status ("Qt" , "Qt: %s, pyqt: %s" %
289- (pyqtconfig .Configuration ().pyqt_version_str ,
290- pyqtconfig .Configuration ().qt_version ))
297+ (convert_qt_version ( pyqtconfig .Configuration ().qt_version ) ,
298+ pyqtconfig .Configuration ().pyqt_version_str ))
291299 return True
292300
293301def check_for_qt4 ():
294302 try :
295- import PyQt4 . pyqtconfig
303+ from PyQt4 import pyqtconfig
296304 except ImportError :
297305 print_status ("Qt4" , "no" )
298306 return False
299307 else :
300308 print_status ("Qt4" , "Qt: %s, pyqt: %s" %
301- (PyQt4 . pyqtconfig .Configuration ().pyqt_version_str ,
302- PyQt4 . pyqtconfig .Configuration ().qt_version ))
309+ (convert_qt_version ( pyqtconfig .Configuration ().qt_version ) ,
310+ pyqtconfig .Configuration ().pyqt_version_str ))
303311 return True
304312
305313def check_for_cairo ():
@@ -455,14 +463,14 @@ def add_pygtk_flags(module):
455463 if not os .environ .has_key ('PKG_CONFIG_PATH' ):
456464 # If Gtk+ is installed, pkg-config is required to be installed
457465 os .environ ['PKG_CONFIG_PATH' ] = 'C:\GTK\lib\pkgconfig'
458-
459- pygtkIncludes = getoutput ('pkg-config --cflags-only-I pygtk-2.0' ).split ()
460- gtkIncludes = getoutput ('pkg-config --cflags-only-I gtk+-2.0' ).split ()
461- includes = pygtkIncludes + gtkIncludes
462- module .include_dirs .extend ([include [2 :] for include in includes ])
463-
464- pygtkLinker = getoutput ('pkg-config --libs pygtk-2.0' ).split ()
465- gtkLinker = getoutput ('pkg-config --libs gtk+-2.0' ).split ()
466+
467+ pygtkIncludes = getoutput ('pkg-config --cflags-only-I pygtk-2.0' ).split ()
468+ gtkIncludes = getoutput ('pkg-config --cflags-only-I gtk+-2.0' ).split ()
469+ includes = pygtkIncludes + gtkIncludes
470+ module .include_dirs .extend ([include [2 :] for include in includes ])
471+
472+ pygtkLinker = getoutput ('pkg-config --libs pygtk-2.0' ).split ()
473+ gtkLinker = getoutput ('pkg-config --libs gtk+-2.0' ).split ()
466474 linkerFlags = pygtkLinker + gtkLinker
467475
468476 module .libraries .extend (
0 commit comments