|
1 | 1 | """ |
2 | 2 | matplotlib has added some extension module code which can optionally |
3 | 3 | be built by setting the appropriate flag below. |
| 4 | +
|
| 5 | +The GTKAgg and TkAgg will try to build if they detect pygtk or Tkinter |
| 6 | +respectively; set them to 0 if you do not want to build them |
4 | 7 | """ |
5 | 8 |
|
6 | 9 | # build the freetype2 interface - this is required for mathtext |
|
27 | 30 | # high quality image renderer to render to all the GUI windows |
28 | 31 |
|
29 | 32 | # build GTK GUI with Agg renderer ; requires pygtk src distros installed |
30 | | -BUILD_GTKAGG = 0 |
| 33 | +# Use False or 0 if you don't want to build |
| 34 | +BUILD_GTKAGG = 'auto' |
31 | 35 |
|
32 | 36 | # build TK GUI with Agg renderer ; requires Tkinter Python extension |
33 | 37 | # and Tk includes |
34 | | -BUILD_TKAGG = 0 |
| 38 | +# Use False or 0 if you don't want to build |
| 39 | +BUILD_TKAGG = 'auto' |
35 | 40 |
|
36 | 41 | # build a small extension to manage the focus on win32 platforms. |
37 | | -BUILD_WINDOWING = 0 |
| 42 | +BUILD_WINDOWING = 'auto' |
38 | 43 |
|
39 | 44 | ## You shouldn't need to customize below this point |
40 | 45 |
|
|
51 | 56 | data.extend(glob.glob('fonts/ttf/*.ttf')) |
52 | 57 | data.extend(glob.glob('images/*.xpm')) |
53 | 58 | data.extend(glob.glob('images/*.ppm')) |
54 | | -if sys.platform != 'win32': # win32 uses postinstaller for conditional install |
55 | | - data.append('.matplotlibrc') |
| 59 | +data.append('.matplotlibrc') |
56 | 60 |
|
57 | 61 | data_files=[('share/matplotlib', data),] |
58 | 62 |
|
|
64 | 68 |
|
65 | 69 |
|
66 | 70 | if BUILD_GTKAGG: |
67 | | - BUILD_AGG = 1 |
68 | | - build_gtkagg(ext_modules, packages) |
| 71 | + |
| 72 | + try: import gtk |
| 73 | + except ImportError: print 'GTKAgg requires pygtk' |
| 74 | + else: |
| 75 | + BUILD_AGG = 1 |
| 76 | + build_gtkagg(ext_modules, packages) |
69 | 77 |
|
70 | 78 | if BUILD_TKAGG: |
71 | | - BUILD_AGG = 1 |
72 | | - build_tkagg(ext_modules, packages) |
| 79 | + try: import Tkinter |
| 80 | + except ImportError: print 'GTKAgg requires pygtk' |
| 81 | + else: |
| 82 | + BUILD_AGG = 1 |
| 83 | + build_tkagg(ext_modules, packages) |
| 84 | + |
73 | 85 |
|
74 | 86 | if BUILD_AGG: |
75 | 87 | BUILD_FT2FONT = 1 |
|
78 | 90 | if BUILD_FT2FONT: |
79 | 91 | build_ft2font(ext_modules, packages) |
80 | 92 |
|
81 | | -if BUILD_WINDOWING: |
| 93 | +if BUILD_WINDOWING and sys.platform=='win32': |
82 | 94 | build_windowing(ext_modules, packages) |
83 | 95 |
|
84 | 96 | if BUILD_IMAGE: |
|
100 | 112 | platforms='any', |
101 | 113 | ext_modules = ext_modules, |
102 | 114 | data_files = data_files, |
103 | | - scripts=['postinstall.py'], |
104 | 115 | ) |
0 commit comments