100
100
numpy_inc_dirs = []
101
101
102
102
# matplotlib build options, which can be altered using setup.cfg
103
- options = {'display_status' : True ,
104
- 'verbose' : False ,
105
- 'provide_pytz' : 'auto' ,
106
- 'provide_dateutil' : 'auto' ,
107
- 'provide_configobj' : 'auto' ,
108
- 'provide_traits' : 'auto' ,
109
- 'build_agg' : True ,
110
- 'build_gtk' : 'auto' ,
111
- 'build_gtkagg' : 'auto' ,
112
- 'build_tkagg' : 'auto' ,
113
- 'build_wxagg' : 'auto' ,
114
- 'build_image' : True ,
115
- 'build_windowing' : True ,
116
- 'backend' : None ,
103
+ options = {'display_status' : True ,
104
+ 'verbose' : False ,
105
+ 'provide_pytz' : 'auto' ,
106
+ 'provide_dateutil' : 'auto' ,
107
+ 'provide_configobj' : 'auto' ,
108
+ 'provide_traits' : 'auto' ,
109
+ 'build_agg' : True ,
110
+ 'build_gtk' : 'auto' ,
111
+ 'build_gtkagg' : 'auto' ,
112
+ 'build_tkagg' : 'auto' ,
113
+ 'build_wxagg' : 'auto' ,
114
+ 'build_image' : True ,
115
+ 'build_windowing' : True ,
116
+ 'backend' : None ,
117
117
'numerix' : None }
118
118
119
119
# Based on the contents of setup.cfg, determine the build options
@@ -351,8 +351,13 @@ def check_for_qt():
351
351
print_status ("Qt" , "no" )
352
352
return False
353
353
else :
354
+ try :
355
+ qt_version = pyqtconfig .Configuration ().qt_version
356
+ qt_version = convert_qt_version (qt_version )
357
+ except AttributeError :
358
+ qt_version = "<unknown>"
354
359
print_status ("Qt" , "Qt: %s, PyQt: %s" %
355
- (convert_qt_version ( pyqtconfig . Configuration (). qt_version ) ,
360
+ (qt_version ,
356
361
pyqtconfig .Configuration ().pyqt_version_str ))
357
362
return True
358
363
@@ -813,7 +818,7 @@ def check_for_tk():
813
818
explanation = "Tcl/Tk v8.3 or later required"
814
819
else :
815
820
gotit = True
816
-
821
+
817
822
if gotit :
818
823
module = Extension ('test' , [])
819
824
try :
@@ -830,7 +835,7 @@ def check_for_tk():
830
835
else :
831
836
explanation = message
832
837
gotit = False
833
-
838
+
834
839
if gotit :
835
840
print_status ("Tkinter" , "Tkinter: %s, Tk: %s, Tcl: %s" %
836
841
(Tkinter .__version__ .split ()[- 2 ], Tkinter .TkVersion , Tkinter .TclVersion ))
@@ -849,7 +854,7 @@ def query_tcltk():
849
854
# Use cached values if they exist, which ensures this function only executes once
850
855
if TCL_TK_CACHE is not None :
851
856
return TCL_TK_CACHE
852
-
857
+
853
858
# By this point, we already know that Tkinter imports correctly
854
859
import Tkinter
855
860
tcl_lib_dir = ''
@@ -875,14 +880,14 @@ def query_tcltk():
875
880
tk .withdraw ()
876
881
tcl_lib_dir = str (tk .getvar ('tcl_library' ))
877
882
tk_lib_dir = str (tk .getvar ('tk_library' ))
878
-
883
+
879
884
# Save directories and version string to cache
880
885
TCL_TK_CACHE = tcl_lib_dir , tk_lib_dir , str (Tkinter .TkVersion )[:3 ]
881
886
return TCL_TK_CACHE
882
887
883
888
def add_tk_flags (module ):
884
889
'Add the module flags to build extensions which use tk'
885
- message = None
890
+ message = None
886
891
if sys .platform == 'win32' :
887
892
major , minor1 , minor2 , s , tmp = sys .version_info
888
893
if major == 2 and minor1 in [3 , 4 , 5 ]:
@@ -894,19 +899,19 @@ def add_tk_flags(module):
894
899
else :
895
900
raise RuntimeError ('No tk/win32 support for this python version yet' )
896
901
module .library_dirs .extend ([os .path .join (sys .prefix , 'dlls' )])
897
-
902
+
898
903
elif sys .platform == 'darwin' :
899
904
# this config section lifted directly from Imaging - thanks to
900
905
# the effbot!
901
-
906
+
902
907
# First test for a MacOSX/darwin framework install
903
908
from os .path import join , exists
904
909
framework_dirs = [
905
910
join (os .getenv ('HOME' ), '/Library/Frameworks' ),
906
911
'/Library/Frameworks' ,
907
912
'/System/Library/Frameworks/' ,
908
913
]
909
-
914
+
910
915
# Find the directory that contains the Tcl.framework and Tk.framework
911
916
# bundles.
912
917
# XXX distutils should support -F!
@@ -931,7 +936,7 @@ def add_tk_flags(module):
931
936
for fw in 'Tcl' , 'Tk'
932
937
for H in 'Headers' , 'Versions/Current/PrivateHeaders'
933
938
]
934
-
939
+
935
940
# For 8.4a2, the X11 headers are not included. Rather than include a
936
941
# complicated search, this is a hard-coded path. It could bail out
937
942
# if X11 libs are not found...
@@ -940,31 +945,31 @@ def add_tk_flags(module):
940
945
module .include_dirs .extend (tk_include_dirs )
941
946
module .extra_link_args .extend (frameworks )
942
947
module .extra_compile_args .extend (frameworks )
943
-
948
+
944
949
# you're still here? ok we'll try it this way...
945
950
else :
946
951
# Query Tcl/Tk system for library paths and version string
947
952
tcl_lib_dir , tk_lib_dir , tk_ver = query_tcltk () # todo: try/except
948
-
953
+
949
954
# Process base directories to obtain include + lib dirs
950
- if tcl_lib_dir != '' and tk_lib_dir != '' :
955
+ if tcl_lib_dir != '' and tk_lib_dir != '' :
951
956
tcl_lib = os .path .normpath (os .path .join (tcl_lib_dir , '../' ))
952
957
tk_lib = os .path .normpath (os .path .join (tk_lib_dir , '../' ))
953
- tcl_inc = os .path .normpath (os .path .join (tcl_lib_dir ,
958
+ tcl_inc = os .path .normpath (os .path .join (tcl_lib_dir ,
954
959
'../../include/tcl' + tk_ver ))
955
960
if not os .path .exists (tcl_inc ):
956
- tcl_inc = os .path .normpath (os .path .join (tcl_lib_dir ,
961
+ tcl_inc = os .path .normpath (os .path .join (tcl_lib_dir ,
957
962
'../../include' ))
958
- tk_inc = os .path .normpath (os .path .join (tk_lib_dir ,
963
+ tk_inc = os .path .normpath (os .path .join (tk_lib_dir ,
959
964
'../../include/tk' + tk_ver ))
960
965
if not os .path .exists (tk_inc ):
961
- tk_inc = os .path .normpath (os .path .join (tk_lib_dir ,
966
+ tk_inc = os .path .normpath (os .path .join (tk_lib_dir ,
962
967
'../../include' ))
963
-
968
+
964
969
if ((not os .path .exists (os .path .join (tk_inc ,'tk.h' ))) and
965
970
os .path .exists (os .path .join (tcl_inc ,'tk.h' ))):
966
971
tk_inc = tcl_inc
967
-
972
+
968
973
if not os .path .exists (tcl_inc ):
969
974
# this is a hack for suse linux, which is broken
970
975
if (sys .platform .startswith ('linux' ) and
@@ -986,7 +991,7 @@ def add_tk_flags(module):
986
991
module .include_dirs .extend ([tcl_inc , tk_inc ])
987
992
module .library_dirs .extend ([tcl_lib , tk_lib ])
988
993
module .libraries .extend (['tk' + tk_ver , 'tcl' + tk_ver ])
989
-
994
+
990
995
return message
991
996
992
997
def add_windowing_flags (module ):
0 commit comments