|
102 | 102 | BUILT_IMAGE = False |
103 | 103 | BUILT_MACOSX = False |
104 | 104 | BUILT_TKAGG = False |
105 | | -BUILT_WXAGG = False |
106 | 105 | BUILT_WINDOWING = False |
107 | 106 | BUILT_CONTOUR = False |
108 | 107 | BUILT_DELAUNAY = False |
|
127 | 126 | 'build_gtk': 'auto', |
128 | 127 | 'build_gtkagg': 'auto', |
129 | 128 | 'build_tkagg': 'auto', |
130 | | - 'build_wxagg': 'auto', |
131 | 129 | 'build_macosx': 'auto', |
132 | 130 | 'build_image': True, |
133 | 131 | 'build_windowing': True, |
|
166 | 164 | try: options['build_tkagg'] = config.getboolean("gui_support", "tkagg") |
167 | 165 | except: options['build_tkagg'] = 'auto' |
168 | 166 |
|
169 | | - try: options['build_wxagg'] = config.getboolean("gui_support", "wxagg") |
170 | | - except: options['build_wxagg'] = 'auto' |
171 | | - |
172 | 167 | try: options['build_macosx'] = config.getboolean("gui_support", "macosx") |
173 | 168 | except: options['build_macosx'] = 'auto' |
174 | 169 |
|
@@ -710,97 +705,6 @@ def add_pygtk_flags(module): |
710 | 705 | if sys.platform == 'win32' and win32_compiler == 'msvc' and 'm' in module.libraries: |
711 | 706 | module.libraries.remove('m') |
712 | 707 |
|
713 | | - |
714 | | -def check_for_wx(): |
715 | | - gotit = False |
716 | | - explanation = None |
717 | | - try: |
718 | | - import wx |
719 | | - except ImportError: |
720 | | - explanation = 'wxPython not found' |
721 | | - else: |
722 | | - if getattr(wx, '__version__', '0.0')[0:3] >= '2.8': |
723 | | - print_status("wxPython", wx.__version__) |
724 | | - return True |
725 | | - elif sys.platform == 'win32' and win32_compiler == 'mingw32': |
726 | | - explanation = "The wxAgg extension can not be built using the mingw32 compiler on Windows, since the default wxPython binary is built using MS Visual Studio" |
727 | | - else: |
728 | | - wxconfig = find_wx_config() |
729 | | - if wxconfig is None: |
730 | | - explanation = """ |
731 | | -WXAgg's accelerator requires `wx-config'. |
732 | | -
|
733 | | -The `wx-config\' executable could not be located in any directory of the |
734 | | -PATH environment variable. If you want to build WXAgg, and wx-config is |
735 | | -in some other location or has some other name, set the WX_CONFIG |
736 | | -environment variable to the full path of the executable like so: |
737 | | -
|
738 | | -export WX_CONFIG=/usr/lib/wxPython-2.6.1.0-gtk2-unicode/bin/wx-config |
739 | | -""" |
740 | | - elif not check_wxpython_broken_macosx104_version(wxconfig): |
741 | | - explanation = 'WXAgg\'s accelerator not building because a broken wxPython (installed by Apple\'s Mac OS X) was found.' |
742 | | - else: |
743 | | - gotit = True |
744 | | - |
745 | | - if gotit: |
746 | | - module = Extension("test", []) |
747 | | - add_wx_flags(module, wxconfig) |
748 | | - if not find_include_file( |
749 | | - module.include_dirs, |
750 | | - os.path.join("wx", "wxPython", "wxPython.h")): |
751 | | - explanation = ("Could not find wxPython headers in any of %s" % |
752 | | - ", ".join(["'%s'" % x for x in module.include_dirs])) |
753 | | - |
754 | | - if gotit: |
755 | | - print_status("wxPython", wx.__version__) |
756 | | - else: |
757 | | - print_status("wxPython", "no") |
758 | | - if explanation is not None: |
759 | | - print_message(explanation) |
760 | | - return gotit |
761 | | - |
762 | | -def find_wx_config(): |
763 | | - """If the WX_CONFIG environment variable has been set, returns it value. |
764 | | - Otherwise, search for `wx-config' in the PATH directories and return the |
765 | | - first match found. Failing that, return None. |
766 | | - """ |
767 | | - |
768 | | - wxconfig = os.getenv('WX_CONFIG') |
769 | | - if wxconfig is not None: |
770 | | - return wxconfig |
771 | | - |
772 | | - path = os.getenv('PATH') or '' |
773 | | - for dir in path.split(':'): |
774 | | - wxconfig = os.path.join(dir, 'wx-config') |
775 | | - if os.path.exists(wxconfig): |
776 | | - return wxconfig |
777 | | - |
778 | | - return None |
779 | | - |
780 | | -def check_wxpython_broken_macosx104_version(wxconfig): |
781 | | - """Determines if we're using a broken wxPython installed by Mac OS X 10.4""" |
782 | | - if sys.platform == 'darwin': |
783 | | - if wxconfig == '/usr/bin/wx-config': |
784 | | - version_full = getoutput(wxconfig + ' --version-full') |
785 | | - if version_full == '2.5.3.1': |
786 | | - return False |
787 | | - return True |
788 | | - |
789 | | -def add_wx_flags(module, wxconfig): |
790 | | - """ |
791 | | - Add the module flags to build extensions which use wxPython. |
792 | | - """ |
793 | | - |
794 | | - if sys.platform == 'win32': # just added manually |
795 | | - wxlibs = ['wxexpath', 'wxjpegh', 'wxmsw26uh', |
796 | | - 'wxmsw26uh_animate', 'wxmsw26uh_gizmos', 'wxmsw26uh_gizmos_xrc', |
797 | | - 'wxmsw26uh_gl', 'wxmsw26uh_stc', 'wxpngh', 'wxregexuh', 'wxtiffh', 'wxzlibh'] |
798 | | - module.libraries.extend(wxlibs) |
799 | | - module.libraries.extend(wxlibs) |
800 | | - return |
801 | | - |
802 | | - get_pkgconfig(module, '', flags='--cppflags --libs', pkg_config_exec='wx-config') |
803 | | - |
804 | 708 | # Make sure you use the Tk version given by Tkinter.TkVersion |
805 | 709 | # or else you'll build for a wrong version of the Tcl |
806 | 710 | # interpreter (leading to nasty segfaults). |
@@ -1200,25 +1104,6 @@ def build_tkagg(ext_modules, packages): |
1200 | 1104 | BUILT_TKAGG = True |
1201 | 1105 |
|
1202 | 1106 |
|
1203 | | -def build_wxagg(ext_modules, packages): |
1204 | | - global BUILT_WXAGG |
1205 | | - if BUILT_WXAGG: |
1206 | | - return |
1207 | | - |
1208 | | - deps = ['src/_wxagg.cpp', 'src/mplutils.cpp'] |
1209 | | - deps.extend(glob.glob('CXX/*.cxx')) |
1210 | | - deps.extend(glob.glob('CXX/*.c')) |
1211 | | - |
1212 | | - module = Extension('matplotlib.backends._wxagg', deps) |
1213 | | - |
1214 | | - add_agg_flags(module) |
1215 | | - add_ft2font_flags(module) |
1216 | | - wxconfig = find_wx_config() |
1217 | | - add_wx_flags(module, wxconfig) |
1218 | | - |
1219 | | - ext_modules.append(module) |
1220 | | - BUILT_WXAGG = True |
1221 | | - |
1222 | 1107 | def build_macosx(ext_modules, packages): |
1223 | 1108 | global BUILT_MACOSX |
1224 | 1109 | if BUILT_MACOSX: return # only build it if you you haven't already |
|
0 commit comments