]>
Commit | Line | Data |
---|---|---|
c368d904 RD |
1 | #!/usr/bin/env python |
2 | #---------------------------------------------------------------------- | |
1128a89b RD |
3 | # Name: setup.py |
4 | # Purpose: Distutils script for building wxPython | |
5 | # | |
6 | # Author: Robin Dunn | |
7 | # | |
8 | # Created: 12-Oct-2000 | |
9 | # RCS-ID: $Id$ | |
10 | # Copyright: (c) 2000 by Total Control Software | |
11 | # Licence: wxWindows license | |
1e4a197e RD |
12 | #---------------------------------------------------------------------- |
13 | ||
1128a89b | 14 | import sys |
e6056257 | 15 | |
e6056257 | 16 | |
1128a89b RD |
17 | # The full contents of the wx.build.config module used to be located |
18 | # here in setup.py. They were split into a separate module so it will | |
19 | # be installed with wxPython and can then be used by the build scripts | |
20 | # of other extension modules that wich to be wxPython compatible. The | |
21 | # split is still fairly new and hasn't been tested by building | |
22 | # third-party extensions yet, so expect some things to still shift | |
23 | # back and forth, and also more stuff in config.py will get converted | |
24 | # to functions, etc. | |
e6056257 | 25 | |
8f8c4b40 RD |
26 | # This script imports it as just "config" because if wxPython doesn't |
27 | # exist yet, then it can't be imported from wx.build.config (since | |
28 | # wx._core doesn't exist yet.) So instead we keep the main copy of | |
29 | # config .py in the same place as setup.py, and then copy it to | |
30 | # wx/build as needed below. | |
31 | ||
1128a89b | 32 | sys.setup_is_main = __name__ == "__main__" # an icky hack! |
8f8c4b40 RD |
33 | from config import * |
34 | ||
35 | ||
36 | #---------------------------------------------------------------------- | |
37 | # Update the packaged config file. | |
38 | #---------------------------------------------------------------------- | |
c368d904 | 39 | |
8f8c4b40 RD |
40 | copy_file('config.py', 'wx/build', update=1, verbose=1) |
41 | CLEANUP.append('wx/build/config.py') | |
c368d904 | 42 | |
c368d904 | 43 | #---------------------------------------------------------------------- |
1fded56b | 44 | # Update the version file |
c368d904 RD |
45 | #---------------------------------------------------------------------- |
46 | ||
1128a89b RD |
47 | # The version file is unconditionally updated every time setup.py is |
48 | # run since the version string can change based on the UNICODE flag | |
49 | ||
e83135b2 | 50 | open('wx/__version__.py', 'w').write("""\ |
1fded56b RD |
51 | # This file was generated by setup.py... |
52 | ||
d14a1e28 RD |
53 | VERSION_STRING = '%(VERSION)s' |
54 | MAJOR_VERSION = %(VER_MAJOR)s | |
55 | MINOR_VERSION = %(VER_MINOR)s | |
56 | RELEASE_VERSION = %(VER_RELEASE)s | |
57 | SUBREL_VERSION = %(VER_SUBREL)s | |
1fded56b | 58 | |
d14a1e28 | 59 | VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION, |
e83135b2 | 60 | SUBREL_VERSION, '%(VER_FLAGS)s') |
1fded56b | 61 | |
d14a1e28 | 62 | RELEASE_NUMBER = RELEASE_VERSION # for compatibility |
1fded56b | 63 | """ % globals()) |
1e4a197e | 64 | |
99abd512 | 65 | CLEANUP.append('wx/__version__.py') |
c368d904 | 66 | |
1b62f00d | 67 | |
1b62f00d RD |
68 | #---------------------------------------------------------------------- |
69 | # Define the CORE extension module | |
70 | #---------------------------------------------------------------------- | |
71 | ||
1e4a197e | 72 | msg('Preparing CORE...') |
d14a1e28 RD |
73 | swig_sources = run_swig(['core.i'], 'src', GENDIR, PKGDIR, |
74 | USE_SWIG, swig_force, swig_args, swig_deps + | |
1e0c8722 RD |
75 | [ 'src/_accel.i', |
76 | 'src/_app.i', | |
d14a1e28 RD |
77 | 'src/_app_ex.py', |
78 | 'src/_constraints.i', | |
79 | 'src/_core_api.i', | |
80 | 'src/_core_ex.py', | |
54f9ee45 RD |
81 | 'src/__core_rename.i', |
82 | 'src/__core_reverse.txt', | |
d14a1e28 RD |
83 | 'src/_defs.i', |
84 | 'src/_event.i', | |
85 | 'src/_event_ex.py', | |
86 | 'src/_evthandler.i', | |
87 | 'src/_filesys.i', | |
88 | 'src/_gdicmn.i', | |
89 | 'src/_image.i', | |
90 | 'src/_menu.i', | |
91 | 'src/_obj.i', | |
92 | 'src/_sizers.i', | |
93 | 'src/_gbsizer.i', | |
94 | 'src/_streams.i', | |
95 | 'src/_validator.i', | |
96 | 'src/_window.i', | |
99abd512 | 97 | 'src/_control.i', |
54f9ee45 RD |
98 | ], |
99 | True) | |
1b62f00d | 100 | |
1e4a197e | 101 | copy_file('src/__init__.py', PKGDIR, update=1, verbose=0) |
99abd512 | 102 | CLEANUP.append(opj(PKGDIR, '__init__.py')) |
1b62f00d RD |
103 | |
104 | ||
d14a1e28 RD |
105 | # update the license files |
106 | mkpath('licence') | |
107 | for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']: | |
108 | copy_file(opj(WXDIR, 'docs', file), opj('licence',file), update=1, verbose=0) | |
99abd512 RD |
109 | CLEANUP.append(opj('licence',file)) |
110 | CLEANUP.append('licence') | |
c368d904 | 111 | |
c368d904 | 112 | |
1e4a197e RD |
113 | if os.name == 'nt': |
114 | build_locale_dir(opj(PKGDIR, 'locale')) | |
115 | DATA_FILES += build_locale_list(opj(PKGDIR, 'locale')) | |
4f3449b4 RD |
116 | |
117 | ||
1e4a197e RD |
118 | if os.name == 'nt': |
119 | rc_file = ['src/wxc.rc'] | |
120 | else: | |
121 | rc_file = [] | |
122 | ||
123 | ||
54f9ee45 RD |
124 | ext = Extension('_core_', ['src/helpers.cpp', |
125 | 'src/libpy.c', | |
126 | ] + rc_file + swig_sources, | |
1e4a197e RD |
127 | |
128 | include_dirs = includes, | |
129 | define_macros = defines, | |
130 | ||
131 | library_dirs = libdirs, | |
132 | libraries = libs, | |
133 | ||
134 | extra_compile_args = cflags, | |
135 | extra_link_args = lflags, | |
d14a1e28 RD |
136 | |
137 | depends = depends | |
1e4a197e RD |
138 | ) |
139 | wxpExtensions.append(ext) | |
140 | ||
141 | ||
d14a1e28 RD |
142 | |
143 | ||
144 | ||
145 | # Extension for the GDI module | |
146 | swig_sources = run_swig(['gdi.i'], 'src', GENDIR, PKGDIR, | |
147 | USE_SWIG, swig_force, swig_args, swig_deps + | |
54f9ee45 | 148 | ['src/__gdi_rename.i', |
99abd512 RD |
149 | 'src/_bitmap.i', |
150 | 'src/_colour.i', | |
151 | 'src/_dc.i', | |
152 | 'src/_gdiobj.i', | |
153 | 'src/_imaglist.i', | |
154 | 'src/_region.i', | |
155 | 'src/_stockobjs.i', | |
d14a1e28 | 156 | 'src/_effects.i', |
99abd512 RD |
157 | 'src/_intl.i', |
158 | 'src/_intl_ex.py', | |
159 | 'src/_brush.i', | |
160 | 'src/_cursor.i', | |
161 | 'src/_font.i', | |
162 | 'src/_icon.i', | |
163 | 'src/_pen.i', | |
164 | 'src/_palette.i', | |
54f9ee45 RD |
165 | ], |
166 | True) | |
167 | ext = Extension('_gdi_', ['src/drawlist.cpp'] + swig_sources, | |
1e4a197e RD |
168 | include_dirs = includes, |
169 | define_macros = defines, | |
170 | library_dirs = libdirs, | |
171 | libraries = libs, | |
172 | extra_compile_args = cflags, | |
173 | extra_link_args = lflags, | |
d14a1e28 | 174 | depends = depends |
1e4a197e RD |
175 | ) |
176 | wxpExtensions.append(ext) | |
177 | ||
178 | ||
d14a1e28 RD |
179 | |
180 | ||
181 | ||
182 | ||
183 | # Extension for the windows module | |
184 | swig_sources = run_swig(['windows.i'], 'src', GENDIR, PKGDIR, | |
185 | USE_SWIG, swig_force, swig_args, swig_deps + | |
54f9ee45 RD |
186 | ['src/__windows_rename.i', |
187 | 'src/__windows_reverse.txt', | |
d14a1e28 | 188 | 'src/_panel.i', |
99abd512 RD |
189 | 'src/_toplvl.i', |
190 | 'src/_statusbar.i', | |
191 | 'src/_splitter.i', | |
192 | 'src/_sashwin.i', | |
193 | 'src/_popupwin.i', | |
194 | 'src/_tipwin.i', | |
195 | 'src/_vscroll.i', | |
196 | 'src/_taskbar.i', | |
197 | 'src/_cmndlgs.i', | |
198 | 'src/_mdi.i', | |
199 | 'src/_pywindows.i', | |
200 | 'src/_printfw.i', | |
54f9ee45 RD |
201 | ], |
202 | True) | |
203 | ext = Extension('_windows_', swig_sources, | |
1e4a197e RD |
204 | include_dirs = includes, |
205 | define_macros = defines, | |
206 | library_dirs = libdirs, | |
207 | libraries = libs, | |
208 | extra_compile_args = cflags, | |
209 | extra_link_args = lflags, | |
d14a1e28 | 210 | depends = depends |
1e4a197e RD |
211 | ) |
212 | wxpExtensions.append(ext) | |
213 | ||
214 | ||
d14a1e28 RD |
215 | |
216 | ||
217 | # Extension for the controls module | |
218 | swig_sources = run_swig(['controls.i'], 'src', GENDIR, PKGDIR, | |
219 | USE_SWIG, swig_force, swig_args, swig_deps + | |
54f9ee45 RD |
220 | [ 'src/__controls_rename.i', |
221 | 'src/__controls_reverse.txt', | |
cf636c45 | 222 | 'src/_toolbar.i', |
99abd512 RD |
223 | 'src/_button.i', |
224 | 'src/_checkbox.i', | |
225 | 'src/_choice.i', | |
226 | 'src/_combobox.i', | |
227 | 'src/_gauge.i', | |
228 | 'src/_statctrls.i', | |
229 | 'src/_listbox.i', | |
230 | 'src/_textctrl.i', | |
231 | 'src/_scrolbar.i', | |
232 | 'src/_spin.i', | |
233 | 'src/_radio.i', | |
234 | 'src/_slider.i', | |
235 | 'src/_tglbtn.i', | |
236 | 'src/_notebook.i', | |
237 | 'src/_listctrl.i', | |
238 | 'src/_treectrl.i', | |
239 | 'src/_dirctrl.i', | |
240 | 'src/_pycontrol.i', | |
241 | 'src/_cshelp.i', | |
242 | 'src/_dragimg.i', | |
54f9ee45 RD |
243 | ], |
244 | True) | |
245 | ext = Extension('_controls_', swig_sources, | |
d14a1e28 RD |
246 | include_dirs = includes, |
247 | define_macros = defines, | |
248 | library_dirs = libdirs, | |
249 | libraries = libs, | |
250 | extra_compile_args = cflags, | |
251 | extra_link_args = lflags, | |
252 | depends = depends | |
253 | ) | |
254 | wxpExtensions.append(ext) | |
255 | ||
256 | ||
257 | ||
258 | ||
259 | # Extension for the misc module | |
260 | swig_sources = run_swig(['misc.i'], 'src', GENDIR, PKGDIR, | |
261 | USE_SWIG, swig_force, swig_args, swig_deps + | |
54f9ee45 RD |
262 | [ 'src/__misc_rename.i', |
263 | 'src/__misc_reverse.txt', | |
264 | 'src/_settings.i', | |
99abd512 RD |
265 | 'src/_functions.i', |
266 | 'src/_misc.i', | |
267 | 'src/_tipdlg.i', | |
268 | 'src/_timer.i', | |
269 | 'src/_log.i', | |
270 | 'src/_process.i', | |
271 | 'src/_joystick.i', | |
272 | 'src/_sound.i', | |
273 | 'src/_mimetype.i', | |
274 | 'src/_artprov.i', | |
275 | 'src/_config.i', | |
276 | 'src/_datetime.i', | |
277 | 'src/_dataobj.i', | |
278 | 'src/_dnd.i', | |
279 | 'src/_display.i', | |
d14a1e28 | 280 | 'src/_clipbrd.i', |
54f9ee45 RD |
281 | ], |
282 | True) | |
283 | ext = Extension('_misc_', swig_sources, | |
d14a1e28 RD |
284 | include_dirs = includes, |
285 | define_macros = defines, | |
286 | library_dirs = libdirs, | |
287 | libraries = libs, | |
288 | extra_compile_args = cflags, | |
289 | extra_link_args = lflags, | |
290 | depends = depends | |
291 | ) | |
292 | wxpExtensions.append(ext) | |
293 | ||
294 | ||
295 | ||
296 | ## | |
297 | ## Core modules that are not in the "core" namespace start here | |
298 | ## | |
299 | ||
1e4a197e RD |
300 | swig_sources = run_swig(['calendar.i'], 'src', GENDIR, PKGDIR, |
301 | USE_SWIG, swig_force, swig_args, swig_deps) | |
d14a1e28 RD |
302 | ext = Extension('_calendar', swig_sources, |
303 | include_dirs = includes, | |
304 | define_macros = defines, | |
305 | library_dirs = libdirs, | |
306 | libraries = libs, | |
307 | extra_compile_args = cflags, | |
308 | extra_link_args = lflags, | |
309 | depends = depends | |
310 | ) | |
311 | wxpExtensions.append(ext) | |
312 | ||
313 | ||
314 | swig_sources = run_swig(['grid.i'], 'src', GENDIR, PKGDIR, | |
315 | USE_SWIG, swig_force, swig_args, swig_deps) | |
316 | ext = Extension('_grid', swig_sources, | |
1e4a197e RD |
317 | include_dirs = includes, |
318 | define_macros = defines, | |
319 | library_dirs = libdirs, | |
320 | libraries = libs, | |
321 | extra_compile_args = cflags, | |
322 | extra_link_args = lflags, | |
d14a1e28 | 323 | depends = depends |
1e4a197e RD |
324 | ) |
325 | wxpExtensions.append(ext) | |
326 | ||
327 | ||
d14a1e28 RD |
328 | |
329 | swig_sources = run_swig(['html.i'], 'src', GENDIR, PKGDIR, | |
1e4a197e | 330 | USE_SWIG, swig_force, swig_args, swig_deps) |
d14a1e28 | 331 | ext = Extension('_html', swig_sources, |
1e4a197e RD |
332 | include_dirs = includes, |
333 | define_macros = defines, | |
334 | library_dirs = libdirs, | |
335 | libraries = libs, | |
336 | extra_compile_args = cflags, | |
337 | extra_link_args = lflags, | |
d14a1e28 | 338 | depends = depends |
1e4a197e RD |
339 | ) |
340 | wxpExtensions.append(ext) | |
341 | ||
342 | ||
d14a1e28 | 343 | |
1e4a197e RD |
344 | swig_sources = run_swig(['wizard.i'], 'src', GENDIR, PKGDIR, |
345 | USE_SWIG, swig_force, swig_args, swig_deps) | |
d14a1e28 | 346 | ext = Extension('_wizard', swig_sources, |
1e4a197e RD |
347 | include_dirs = includes, |
348 | define_macros = defines, | |
349 | library_dirs = libdirs, | |
350 | libraries = libs, | |
351 | extra_compile_args = cflags, | |
352 | extra_link_args = lflags, | |
d14a1e28 | 353 | depends = depends |
1e4a197e RD |
354 | ) |
355 | wxpExtensions.append(ext) | |
af83019e RD |
356 | |
357 | ||
c368d904 RD |
358 | #---------------------------------------------------------------------- |
359 | # Define the GLCanvas extension module | |
360 | #---------------------------------------------------------------------- | |
361 | ||
1e4a197e | 362 | if BUILD_GLCANVAS: |
cfe766c3 | 363 | msg('Preparing GLCANVAS...') |
c368d904 | 364 | location = 'contrib/glcanvas' |
c368d904 | 365 | |
d14a1e28 | 366 | swig_sources = run_swig(['glcanvas.i'], location, GENDIR, PKGDIR, |
10ef30eb | 367 | USE_SWIG, swig_force, swig_args, swig_deps) |
c368d904 RD |
368 | |
369 | gl_libs = [] | |
370 | if os.name == 'posix': | |
f32afe1c | 371 | gl_config = os.popen(WX_CONFIG + ' --gl-libs', 'r').read()[:-1] |
1e4a197e | 372 | gl_lflags = gl_config.split() + lflags |
f32afe1c | 373 | gl_libs = libs |
19cf4f80 | 374 | else: |
3e46a8e6 | 375 | gl_libs = libs + ['opengl32', 'glu32'] + makeLibName('gl') |
f32afe1c | 376 | gl_lflags = lflags |
c368d904 | 377 | |
d14a1e28 | 378 | ext = Extension('_glcanvas', |
3e46a8e6 | 379 | swig_sources, |
1e7ecb7b | 380 | |
4c417214 | 381 | include_dirs = includes + CONTRIBS_INC, |
1e7ecb7b RD |
382 | define_macros = defines, |
383 | ||
384 | library_dirs = libdirs, | |
f32afe1c | 385 | libraries = gl_libs, |
1e7ecb7b RD |
386 | |
387 | extra_compile_args = cflags, | |
f32afe1c | 388 | extra_link_args = gl_lflags, |
1e7ecb7b RD |
389 | ) |
390 | ||
391 | wxpExtensions.append(ext) | |
c368d904 RD |
392 | |
393 | ||
394 | #---------------------------------------------------------------------- | |
395 | # Define the OGL extension module | |
396 | #---------------------------------------------------------------------- | |
397 | ||
1e4a197e | 398 | if BUILD_OGL: |
cfe766c3 | 399 | msg('Preparing OGL...') |
c368d904 | 400 | location = 'contrib/ogl' |
c368d904 | 401 | |
a32360e0 | 402 | swig_sources = run_swig(['ogl.i'], location, GENDIR, PKGDIR, |
d14a1e28 RD |
403 | USE_SWIG, swig_force, swig_args, swig_deps + |
404 | [ '%s/_oglbasic.i' % location, | |
405 | '%s/_oglshapes.i' % location, | |
406 | '%s/_oglshapes2.i' % location, | |
407 | '%s/_oglcanvas.i' % location, | |
408 | '%s/_ogldefs.i' % location, | |
409 | ]) | |
c368d904 | 410 | |
d14a1e28 | 411 | ext = Extension('_ogl', |
3ef86e32 | 412 | swig_sources, |
1e7ecb7b | 413 | |
4c417214 | 414 | include_dirs = includes + [ location ] + CONTRIBS_INC, |
dd116e73 | 415 | define_macros = defines + [('wxUSE_DEPRECATED', '0')], |
1e7ecb7b RD |
416 | |
417 | library_dirs = libdirs, | |
3ef86e32 | 418 | libraries = libs + makeLibName('ogl'), |
1e7ecb7b RD |
419 | |
420 | extra_compile_args = cflags, | |
421 | extra_link_args = lflags, | |
422 | ) | |
423 | ||
424 | wxpExtensions.append(ext) | |
425 | ||
426 | ||
c368d904 RD |
427 | |
428 | #---------------------------------------------------------------------- | |
429 | # Define the STC extension module | |
430 | #---------------------------------------------------------------------- | |
431 | ||
1e4a197e | 432 | if BUILD_STC: |
cfe766c3 | 433 | msg('Preparing STC...') |
c368d904 | 434 | location = 'contrib/stc' |
5a2a9da2 RD |
435 | if os.name == 'nt': |
436 | STC_H = opj(WXDIR, 'contrib', 'include/wx/stc') | |
437 | else: | |
438 | STC_H = opj(WXPREFIX, 'include/wx/stc') | |
55c020cf | 439 | |
de7b7fe6 | 440 | ## NOTE: need to add something like this to the stc.bkl... |
55c020cf | 441 | |
3ef86e32 RD |
442 | ## # Check if gen_iface needs to be run for the wxSTC sources |
443 | ## if (newer(opj(CTRB_SRC, 'stc/stc.h.in'), opj(CTRB_INC, 'stc/stc.h' )) or | |
444 | ## newer(opj(CTRB_SRC, 'stc/stc.cpp.in'), opj(CTRB_SRC, 'stc/stc.cpp')) or | |
445 | ## newer(opj(CTRB_SRC, 'stc/gen_iface.py'), opj(CTRB_SRC, 'stc/stc.cpp'))): | |
55c020cf | 446 | |
3ef86e32 RD |
447 | ## msg('Running gen_iface.py, regenerating stc.h and stc.cpp...') |
448 | ## cwd = os.getcwd() | |
449 | ## os.chdir(opj(CTRB_SRC, 'stc')) | |
450 | ## sys.path.insert(0, os.curdir) | |
451 | ## import gen_iface | |
452 | ## gen_iface.main([]) | |
453 | ## os.chdir(cwd) | |
c368d904 RD |
454 | |
455 | ||
befa6977 | 456 | swig_sources = run_swig(['stc.i'], location, GENDIR, PKGDIR, |
c368d904 RD |
457 | USE_SWIG, swig_force, |
458 | swig_args + ['-I'+STC_H, '-I'+location], | |
10ef30eb | 459 | [opj(STC_H, 'stc.h')] + swig_deps) |
c368d904 | 460 | |
d14a1e28 | 461 | ext = Extension('_stc', |
3ef86e32 RD |
462 | swig_sources, |
463 | ||
4c417214 | 464 | include_dirs = includes + CONTRIBS_INC, |
3ef86e32 | 465 | define_macros = defines, |
1e7ecb7b RD |
466 | |
467 | library_dirs = libdirs, | |
3ef86e32 | 468 | libraries = libs + makeLibName('stc'), |
c368d904 | 469 | |
1e7ecb7b RD |
470 | extra_compile_args = cflags, |
471 | extra_link_args = lflags, | |
472 | ) | |
473 | ||
474 | wxpExtensions.append(ext) | |
c368d904 RD |
475 | |
476 | ||
477 | ||
926bb76c RD |
478 | #---------------------------------------------------------------------- |
479 | # Define the IEWIN extension module (experimental) | |
480 | #---------------------------------------------------------------------- | |
481 | ||
1e4a197e | 482 | if BUILD_IEWIN: |
cfe766c3 | 483 | msg('Preparing IEWIN...') |
926bb76c RD |
484 | location = 'contrib/iewin' |
485 | ||
486 | swig_files = ['iewin.i', ] | |
487 | ||
488 | swig_sources = run_swig(swig_files, location, '', PKGDIR, | |
10ef30eb | 489 | USE_SWIG, swig_force, swig_args, swig_deps) |
926bb76c RD |
490 | |
491 | ||
de7b7fe6 | 492 | ext = Extension('_iewin', ['%s/IEHtmlWin.cpp' % location, |
c731eb47 | 493 | '%s/wxactivex.cpp' % location, |
926bb76c RD |
494 | ] + swig_sources, |
495 | ||
4c417214 | 496 | include_dirs = includes + CONTRIBS_INC, |
926bb76c RD |
497 | define_macros = defines, |
498 | ||
499 | library_dirs = libdirs, | |
500 | libraries = libs, | |
501 | ||
502 | extra_compile_args = cflags, | |
b7c75283 RD |
503 | extra_link_args = lflags, |
504 | ) | |
505 | ||
506 | wxpExtensions.append(ext) | |
507 | ||
508 | ||
509 | #---------------------------------------------------------------------- | |
510 | # Define the ACTIVEX extension module (experimental) | |
511 | #---------------------------------------------------------------------- | |
512 | ||
513 | if BUILD_ACTIVEX: | |
514 | msg('Preparing ACTIVEX...') | |
515 | location = 'contrib/activex' | |
516 | axloc = opj(location, "wxie") | |
517 | ||
518 | swig_files = ['activex.i', ] | |
519 | ||
520 | swig_sources = run_swig(swig_files, location, '', PKGDIR, | |
521 | USE_SWIG, swig_force, swig_args, swig_deps + | |
522 | [ '%s/_activex_ex.py' % location]) | |
523 | ||
524 | ||
525 | ext = Extension('_activex', ['%s/IEHtmlWin.cpp' % axloc, | |
526 | '%s/wxactivex.cpp' % axloc, | |
527 | ] + swig_sources, | |
528 | ||
529 | include_dirs = includes + [ axloc ], | |
530 | define_macros = defines, | |
531 | ||
532 | library_dirs = libdirs, | |
533 | libraries = libs, | |
534 | ||
535 | extra_compile_args = cflags, | |
926bb76c RD |
536 | extra_link_args = lflags, |
537 | ) | |
538 | ||
539 | wxpExtensions.append(ext) | |
540 | ||
541 | ||
d56cebe7 RD |
542 | #---------------------------------------------------------------------- |
543 | # Define the XRC extension module | |
544 | #---------------------------------------------------------------------- | |
545 | ||
1e4a197e | 546 | if BUILD_XRC: |
cfe766c3 | 547 | msg('Preparing XRC...') |
d56cebe7 | 548 | location = 'contrib/xrc' |
d56cebe7 | 549 | |
befa6977 | 550 | swig_sources = run_swig(['xrc.i'], location, GENDIR, PKGDIR, |
d14a1e28 RD |
551 | USE_SWIG, swig_force, swig_args, swig_deps + |
552 | [ '%s/_xrc_rename.i' % location, | |
553 | '%s/_xrc_ex.py' % location, | |
554 | '%s/_xmlres.i' % location, | |
555 | '%s/_xmlsub.i' % location, | |
556 | '%s/_xml.i' % location, | |
557 | '%s/_xmlhandler.i' % location, | |
558 | ]) | |
559 | ||
560 | ext = Extension('_xrc', | |
3ef86e32 | 561 | swig_sources, |
1fded56b | 562 | |
4c417214 | 563 | include_dirs = includes + CONTRIBS_INC, |
d56cebe7 RD |
564 | define_macros = defines, |
565 | ||
566 | library_dirs = libdirs, | |
3ef86e32 | 567 | libraries = libs + makeLibName('xrc'), |
d56cebe7 RD |
568 | |
569 | extra_compile_args = cflags, | |
570 | extra_link_args = lflags, | |
571 | ) | |
572 | ||
573 | wxpExtensions.append(ext) | |
574 | ||
575 | ||
576 | ||
ebf4302c RD |
577 | #---------------------------------------------------------------------- |
578 | # Define the GIZMOS extension module | |
579 | #---------------------------------------------------------------------- | |
580 | ||
1e4a197e | 581 | if BUILD_GIZMOS: |
ebf4302c RD |
582 | msg('Preparing GIZMOS...') |
583 | location = 'contrib/gizmos' | |
ebf4302c | 584 | |
a32360e0 | 585 | swig_sources = run_swig(['gizmos.i'], location, GENDIR, PKGDIR, |
10ef30eb | 586 | USE_SWIG, swig_force, swig_args, swig_deps) |
ebf4302c | 587 | |
d14a1e28 | 588 | ext = Extension('_gizmos', |
d84a9306 | 589 | [ '%s/treelistctrl.cpp' % location ] + swig_sources, |
ebf4302c | 590 | |
4c417214 | 591 | include_dirs = includes + [ location ] + CONTRIBS_INC, |
ebf4302c RD |
592 | define_macros = defines, |
593 | ||
594 | library_dirs = libdirs, | |
3ef86e32 | 595 | libraries = libs + makeLibName('gizmos'), |
ebf4302c RD |
596 | |
597 | extra_compile_args = cflags, | |
598 | extra_link_args = lflags, | |
599 | ) | |
600 | ||
601 | wxpExtensions.append(ext) | |
602 | ||
603 | ||
604 | ||
4a61305d RD |
605 | #---------------------------------------------------------------------- |
606 | # Define the DLLWIDGET extension module | |
607 | #---------------------------------------------------------------------- | |
608 | ||
1e4a197e | 609 | if BUILD_DLLWIDGET: |
4a61305d RD |
610 | msg('Preparing DLLWIDGET...') |
611 | location = 'contrib/dllwidget' | |
612 | swig_files = ['dllwidget_.i'] | |
613 | ||
614 | swig_sources = run_swig(swig_files, location, '', PKGDIR, | |
10ef30eb | 615 | USE_SWIG, swig_force, swig_args, swig_deps) |
4a61305d RD |
616 | |
617 | # copy a contrib project specific py module to the main package dir | |
618 | copy_file(opj(location, 'dllwidget.py'), PKGDIR, update=1, verbose=0) | |
99abd512 | 619 | CLEANUP.append(opj(PKGDIR, 'dllwidget.py')) |
4a61305d RD |
620 | |
621 | ext = Extension('dllwidget_c', [ | |
622 | '%s/dllwidget.cpp' % location, | |
623 | ] + swig_sources, | |
624 | ||
4c417214 | 625 | include_dirs = includes + CONTRIBS_INC, |
4a61305d RD |
626 | define_macros = defines, |
627 | ||
628 | library_dirs = libdirs, | |
629 | libraries = libs, | |
630 | ||
631 | extra_compile_args = cflags, | |
632 | extra_link_args = lflags, | |
633 | ) | |
634 | ||
635 | wxpExtensions.append(ext) | |
636 | ||
637 | ||
1e4a197e RD |
638 | |
639 | ||
640 | #---------------------------------------------------------------------- | |
1128a89b | 641 | # Tools, scripts data files, etc. |
1e4a197e | 642 | #---------------------------------------------------------------------- |
8916d007 | 643 | |
2eb31f8b RD |
644 | if NO_SCRIPTS: |
645 | SCRIPTS = None | |
646 | else: | |
1e4a197e RD |
647 | SCRIPTS = [opj('scripts/helpviewer'), |
648 | opj('scripts/img2png'), | |
2eb31f8b RD |
649 | opj('scripts/img2xpm'), |
650 | opj('scripts/img2py'), | |
651 | opj('scripts/xrced'), | |
652 | opj('scripts/pyshell'), | |
653 | opj('scripts/pycrust'), | |
1fded56b RD |
654 | opj('scripts/pywrap'), |
655 | opj('scripts/pywrap'), | |
656 | opj('scripts/pyalacarte'), | |
657 | opj('scripts/pyalamode'), | |
2eb31f8b | 658 | ] |
4a61305d | 659 | |
926bb76c | 660 | |
c2079460 RD |
661 | DATA_FILES += find_data_files('wx/tools/XRCed', '*.txt', '*.xrc') |
662 | DATA_FILES += find_data_files('wx/py', '*.txt', '*.ico', '*.css', '*.html') | |
1fded56b | 663 | DATA_FILES += find_data_files('wx', '*.txt', '*.css', '*.html') |
1e4a197e RD |
664 | |
665 | ||
1128a89b RD |
666 | if NO_HEADERS: |
667 | HEADERS = None | |
668 | else: | |
669 | h_files = glob.glob(opj("include/wx/wxPython/*.h")) | |
670 | i_files = glob.glob(opj("src/*.i")) + \ | |
671 | glob.glob(opj("src/_*.py")) + \ | |
672 | glob.glob(opj("src/*.swg")) | |
673 | ||
674 | HEADERS = zip(h_files, ["/include/wx/wxPython"]*len(h_files)) + \ | |
675 | zip(i_files, ["/include/wx/wxPython/i_files"]*len(i_files)) | |
676 | ||
c368d904 RD |
677 | #---------------------------------------------------------------------- |
678 | # Do the Setup/Build/Install/Whatever | |
679 | #---------------------------------------------------------------------- | |
680 | ||
1b62f00d | 681 | if __name__ == "__main__": |
1e4a197e | 682 | if not PREP_ONLY: |
d14a1e28 | 683 | setup(name = 'wxPython', |
1b62f00d RD |
684 | version = VERSION, |
685 | description = DESCRIPTION, | |
686 | long_description = LONG_DESCRIPTION, | |
687 | author = AUTHOR, | |
688 | author_email = AUTHOR_EMAIL, | |
689 | url = URL, | |
851d4ac7 | 690 | download_url = DOWNLOAD_URL, |
e2e02194 | 691 | license = LICENSE, |
851d4ac7 RD |
692 | platforms = PLATFORMS, |
693 | classifiers = filter(None, CLASSIFIERS.split("\n")), | |
694 | keywords = KEYWORDS, | |
d14a1e28 | 695 | |
1fded56b RD |
696 | packages = ['wxPython', |
697 | 'wxPython.lib', | |
698 | 'wxPython.lib.colourchooser', | |
699 | 'wxPython.lib.editor', | |
700 | 'wxPython.lib.mixins', | |
1fded56b | 701 | 'wxPython.tools', |
1fded56b RD |
702 | |
703 | 'wx', | |
1128a89b | 704 | 'wx.build', |
1fded56b RD |
705 | 'wx.lib', |
706 | 'wx.lib.colourchooser', | |
707 | 'wx.lib.editor', | |
9176f38f | 708 | 'wx.lib.masked', |
1fded56b RD |
709 | 'wx.lib.mixins', |
710 | 'wx.py', | |
711 | 'wx.tools', | |
712 | 'wx.tools.XRCed', | |
1b62f00d RD |
713 | ], |
714 | ||
715 | ext_package = PKGDIR, | |
716 | ext_modules = wxpExtensions, | |
8916d007 | 717 | |
1128a89b RD |
718 | options = { 'build' : { 'build_base' : BUILD_BASE }, |
719 | }, | |
a541c325 | 720 | |
1128a89b | 721 | scripts = SCRIPTS, |
1e4a197e | 722 | data_files = DATA_FILES, |
1128a89b | 723 | headers = HEADERS, |
8916d007 | 724 | |
1128a89b RD |
725 | cmdclass = { 'install_data': wx_smart_install_data, |
726 | 'install_headers': wx_install_headers, | |
727 | 'clean': wx_extra_clean, | |
728 | }, | |
1b62f00d | 729 | ) |
c368d904 | 730 | |
c368d904 | 731 | |
c368d904 RD |
732 | #---------------------------------------------------------------------- |
733 | #---------------------------------------------------------------------- |