]> git.saurik.com Git - wxWidgets.git/blame - wxPython/setup.py
Mention statusbar painting fix.
[wxWidgets.git] / wxPython / setup.py
CommitLineData
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
f35d1a03 14import sys, os
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
80050aa1
DS
20# of other extension modules that wish to be wxPython compatible.
21# The split is still fairly new and hasn't been tested by building
1128a89b
RD
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
f35d1a03
RD
32# To fully support external builds, we need to have a build options
33# file that is created whenever a new wxPython build is performed.
80050aa1
DS
34# We happen to be doing that here in this script, so make sure to
35# remove the build_options.py file, so that config.py will recreate it.
f35d1a03 36
02b800ce
RD
37for bo_name in ["build_options.py", "build_options.pyc"]:
38 if os.path.exists(bo_name):
39 os.remove(bo_name)
f35d1a03 40
1128a89b 41sys.setup_is_main = __name__ == "__main__" # an icky hack!
8f8c4b40
RD
42from config import *
43
44
45#----------------------------------------------------------------------
46# Update the packaged config file.
47#----------------------------------------------------------------------
c368d904 48
8f8c4b40 49copy_file('config.py', 'wx/build', update=1, verbose=1)
f35d1a03 50copy_file('build_options.py', 'wx/build', update=1, verbose=1)
8f8c4b40 51CLEANUP.append('wx/build/config.py')
f35d1a03 52CLEANUP.append('wx/build/build_options.py')
c368d904 53
c368d904 54#----------------------------------------------------------------------
1fded56b 55# Update the version file
c368d904
RD
56#----------------------------------------------------------------------
57
1128a89b
RD
58# The version file is unconditionally updated every time setup.py is
59# run since the version string can change based on the UNICODE flag
60
e83135b2 61open('wx/__version__.py', 'w').write("""\
1fded56b
RD
62# This file was generated by setup.py...
63
d14a1e28
RD
64VERSION_STRING = '%(VERSION)s'
65MAJOR_VERSION = %(VER_MAJOR)s
66MINOR_VERSION = %(VER_MINOR)s
67RELEASE_VERSION = %(VER_RELEASE)s
68SUBREL_VERSION = %(VER_SUBREL)s
1fded56b 69
d14a1e28 70VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION,
e83135b2 71 SUBREL_VERSION, '%(VER_FLAGS)s')
1fded56b 72
d14a1e28 73RELEASE_NUMBER = RELEASE_VERSION # for compatibility
1fded56b 74""" % globals())
1e4a197e 75
99abd512 76CLEANUP.append('wx/__version__.py')
c368d904 77
1b62f00d 78
41e8a69c
RD
79#----------------------------------------------------------------------
80# patch distutils if it can't cope with the "classifiers" or
81# "download_url" keywords
82#----------------------------------------------------------------------
83
84if sys.version < '2.2.3':
85 from distutils.dist import DistributionMetadata
86 DistributionMetadata.classifiers = None
87 DistributionMetadata.download_url = None
88 depends = {}
89else:
90 depends = {'depends' : depends}
91
92
1b62f00d
RD
93#----------------------------------------------------------------------
94# Define the CORE extension module
95#----------------------------------------------------------------------
96
1e4a197e 97msg('Preparing CORE...')
d14a1e28
RD
98swig_sources = run_swig(['core.i'], 'src', GENDIR, PKGDIR,
99 USE_SWIG, swig_force, swig_args, swig_deps +
1e0c8722
RD
100 [ 'src/_accel.i',
101 'src/_app.i',
d14a1e28
RD
102 'src/_app_ex.py',
103 'src/_constraints.i',
104 'src/_core_api.i',
105 'src/_core_ex.py',
54f9ee45
RD
106 'src/__core_rename.i',
107 'src/__core_reverse.txt',
d14a1e28
RD
108 'src/_defs.i',
109 'src/_event.i',
110 'src/_event_ex.py',
38b97c15 111 'src/_evtloop.i',
d14a1e28
RD
112 'src/_evthandler.i',
113 'src/_filesys.i',
114 'src/_gdicmn.i',
115 'src/_image.i',
116 'src/_menu.i',
117 'src/_obj.i',
118 'src/_sizers.i',
119 'src/_gbsizer.i',
120 'src/_streams.i',
121 'src/_validator.i',
122 'src/_window.i',
99abd512 123 'src/_control.i',
54f9ee45
RD
124 ],
125 True)
1b62f00d 126
1e4a197e 127copy_file('src/__init__.py', PKGDIR, update=1, verbose=0)
99abd512 128CLEANUP.append(opj(PKGDIR, '__init__.py'))
1b62f00d
RD
129
130
d14a1e28
RD
131# update the license files
132mkpath('licence')
133for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
134 copy_file(opj(WXDIR, 'docs', file), opj('licence',file), update=1, verbose=0)
99abd512
RD
135 CLEANUP.append(opj('licence',file))
136CLEANUP.append('licence')
c368d904 137
c368d904 138
1e4a197e
RD
139if os.name == 'nt':
140 build_locale_dir(opj(PKGDIR, 'locale'))
141 DATA_FILES += build_locale_list(opj(PKGDIR, 'locale'))
4f3449b4
RD
142
143
1e4a197e
RD
144if os.name == 'nt':
145 rc_file = ['src/wxc.rc']
146else:
147 rc_file = []
148
149
54f9ee45 150ext = Extension('_core_', ['src/helpers.cpp',
54f9ee45 151 ] + rc_file + swig_sources,
1e4a197e
RD
152
153 include_dirs = includes,
154 define_macros = defines,
155
156 library_dirs = libdirs,
157 libraries = libs,
158
159 extra_compile_args = cflags,
160 extra_link_args = lflags,
d14a1e28 161
41e8a69c 162 **depends
1e4a197e
RD
163 )
164wxpExtensions.append(ext)
165
166
d14a1e28
RD
167
168
169
170# Extension for the GDI module
171swig_sources = run_swig(['gdi.i'], 'src', GENDIR, PKGDIR,
172 USE_SWIG, swig_force, swig_args, swig_deps +
54f9ee45 173 ['src/__gdi_rename.i',
99abd512
RD
174 'src/_bitmap.i',
175 'src/_colour.i',
176 'src/_dc.i',
177 'src/_gdiobj.i',
178 'src/_imaglist.i',
179 'src/_region.i',
180 'src/_stockobjs.i',
d14a1e28 181 'src/_effects.i',
99abd512
RD
182 'src/_intl.i',
183 'src/_intl_ex.py',
184 'src/_brush.i',
185 'src/_cursor.i',
186 'src/_font.i',
187 'src/_icon.i',
188 'src/_pen.i',
189 'src/_palette.i',
c95499b9 190 'src/_renderer.i',
54f9ee45
RD
191 ],
192 True)
193ext = Extension('_gdi_', ['src/drawlist.cpp'] + swig_sources,
1e4a197e
RD
194 include_dirs = includes,
195 define_macros = defines,
196 library_dirs = libdirs,
197 libraries = libs,
198 extra_compile_args = cflags,
199 extra_link_args = lflags,
41e8a69c 200 **depends
1e4a197e
RD
201 )
202wxpExtensions.append(ext)
203
204
d14a1e28
RD
205
206
207
208
209# Extension for the windows module
210swig_sources = run_swig(['windows.i'], 'src', GENDIR, PKGDIR,
211 USE_SWIG, swig_force, swig_args, swig_deps +
54f9ee45
RD
212 ['src/__windows_rename.i',
213 'src/__windows_reverse.txt',
d14a1e28 214 'src/_panel.i',
99abd512
RD
215 'src/_toplvl.i',
216 'src/_statusbar.i',
217 'src/_splitter.i',
218 'src/_sashwin.i',
219 'src/_popupwin.i',
220 'src/_tipwin.i',
221 'src/_vscroll.i',
222 'src/_taskbar.i',
223 'src/_cmndlgs.i',
224 'src/_mdi.i',
225 'src/_pywindows.i',
226 'src/_printfw.i',
54f9ee45
RD
227 ],
228 True)
229ext = Extension('_windows_', swig_sources,
1e4a197e
RD
230 include_dirs = includes,
231 define_macros = defines,
232 library_dirs = libdirs,
233 libraries = libs,
234 extra_compile_args = cflags,
235 extra_link_args = lflags,
41e8a69c 236 **depends
1e4a197e
RD
237 )
238wxpExtensions.append(ext)
239
240
d14a1e28
RD
241
242
243# Extension for the controls module
244swig_sources = run_swig(['controls.i'], 'src', GENDIR, PKGDIR,
245 USE_SWIG, swig_force, swig_args, swig_deps +
54f9ee45
RD
246 [ 'src/__controls_rename.i',
247 'src/__controls_reverse.txt',
cf636c45 248 'src/_toolbar.i',
99abd512
RD
249 'src/_button.i',
250 'src/_checkbox.i',
251 'src/_choice.i',
252 'src/_combobox.i',
253 'src/_gauge.i',
254 'src/_statctrls.i',
255 'src/_listbox.i',
256 'src/_textctrl.i',
257 'src/_scrolbar.i',
258 'src/_spin.i',
259 'src/_radio.i',
260 'src/_slider.i',
261 'src/_tglbtn.i',
262 'src/_notebook.i',
263 'src/_listctrl.i',
264 'src/_treectrl.i',
265 'src/_dirctrl.i',
266 'src/_pycontrol.i',
267 'src/_cshelp.i',
268 'src/_dragimg.i',
b3b61cda 269 'src/_datectrl.i',
54f9ee45
RD
270 ],
271 True)
272ext = Extension('_controls_', swig_sources,
d14a1e28
RD
273 include_dirs = includes,
274 define_macros = defines,
275 library_dirs = libdirs,
276 libraries = libs,
277 extra_compile_args = cflags,
278 extra_link_args = lflags,
41e8a69c 279 **depends
d14a1e28
RD
280 )
281wxpExtensions.append(ext)
282
283
284
285
286# Extension for the misc module
287swig_sources = run_swig(['misc.i'], 'src', GENDIR, PKGDIR,
288 USE_SWIG, swig_force, swig_args, swig_deps +
54f9ee45
RD
289 [ 'src/__misc_rename.i',
290 'src/__misc_reverse.txt',
291 'src/_settings.i',
99abd512
RD
292 'src/_functions.i',
293 'src/_misc.i',
294 'src/_tipdlg.i',
295 'src/_timer.i',
296 'src/_log.i',
297 'src/_process.i',
298 'src/_joystick.i',
299 'src/_sound.i',
300 'src/_mimetype.i',
301 'src/_artprov.i',
302 'src/_config.i',
303 'src/_datetime.i',
304 'src/_dataobj.i',
305 'src/_dnd.i',
306 'src/_display.i',
d14a1e28 307 'src/_clipbrd.i',
53112743 308 'src/_stdpaths.i',
54f9ee45
RD
309 ],
310 True)
311ext = Extension('_misc_', swig_sources,
d14a1e28
RD
312 include_dirs = includes,
313 define_macros = defines,
314 library_dirs = libdirs,
315 libraries = libs,
316 extra_compile_args = cflags,
317 extra_link_args = lflags,
41e8a69c 318 **depends
d14a1e28
RD
319 )
320wxpExtensions.append(ext)
321
322
323
324##
325## Core modules that are not in the "core" namespace start here
326##
327
1e4a197e
RD
328swig_sources = run_swig(['calendar.i'], 'src', GENDIR, PKGDIR,
329 USE_SWIG, swig_force, swig_args, swig_deps)
d14a1e28
RD
330ext = Extension('_calendar', swig_sources,
331 include_dirs = includes,
332 define_macros = defines,
333 library_dirs = libdirs,
334 libraries = libs,
335 extra_compile_args = cflags,
336 extra_link_args = lflags,
41e8a69c 337 **depends
d14a1e28
RD
338 )
339wxpExtensions.append(ext)
340
341
342swig_sources = run_swig(['grid.i'], 'src', GENDIR, PKGDIR,
343 USE_SWIG, swig_force, swig_args, swig_deps)
344ext = Extension('_grid', swig_sources,
1e4a197e
RD
345 include_dirs = includes,
346 define_macros = defines,
347 library_dirs = libdirs,
348 libraries = libs,
349 extra_compile_args = cflags,
350 extra_link_args = lflags,
41e8a69c 351 **depends
1e4a197e
RD
352 )
353wxpExtensions.append(ext)
354
355
d14a1e28
RD
356
357swig_sources = run_swig(['html.i'], 'src', GENDIR, PKGDIR,
1e4a197e 358 USE_SWIG, swig_force, swig_args, swig_deps)
d14a1e28 359ext = Extension('_html', swig_sources,
1e4a197e
RD
360 include_dirs = includes,
361 define_macros = defines,
362 library_dirs = libdirs,
363 libraries = libs,
364 extra_compile_args = cflags,
365 extra_link_args = lflags,
41e8a69c 366 **depends
1e4a197e
RD
367 )
368wxpExtensions.append(ext)
369
f6f1e19f 370
eadf221f
RD
371mediaLibs = libs[:]
372if not MONOLITHIC and os.name == 'nt':
373 mediaLibs.append(makeLibName('media')[0])
870501f0
RD
374swig_sources = run_swig(['media.i'], 'src', GENDIR, PKGDIR,
375 USE_SWIG, swig_force, swig_args, swig_deps)
376ext = Extension('_media', swig_sources,
377 include_dirs = includes,
378 define_macros = defines,
379 library_dirs = libdirs,
eadf221f 380 libraries = mediaLibs,
870501f0
RD
381 extra_compile_args = cflags,
382 extra_link_args = lflags,
383 **depends
384 )
385wxpExtensions.append(ext)
386
387
7875e5ff
KO
388swig_sources = run_swig(['webkit.i'], 'src', GENDIR, PKGDIR,
389 USE_SWIG, swig_force, swig_args, swig_deps)
390ext = Extension('_webkit', swig_sources,
391 include_dirs = includes,
392 define_macros = defines,
393 library_dirs = libdirs,
394 libraries = libs,
395 extra_compile_args = cflags,
396 extra_link_args = lflags,
397 **depends
398 )
399wxpExtensions.append(ext)
d14a1e28 400
f6f1e19f
RD
401
402
1e4a197e
RD
403swig_sources = run_swig(['wizard.i'], 'src', GENDIR, PKGDIR,
404 USE_SWIG, swig_force, swig_args, swig_deps)
d14a1e28 405ext = Extension('_wizard', swig_sources,
1e4a197e
RD
406 include_dirs = includes,
407 define_macros = defines,
408 library_dirs = libdirs,
409 libraries = libs,
410 extra_compile_args = cflags,
411 extra_link_args = lflags,
41e8a69c 412 **depends
1e4a197e
RD
413 )
414wxpExtensions.append(ext)
af83019e
RD
415
416
38b97c15
RD
417
418swig_sources = run_swig(['xrc.i'], 'src', GENDIR, PKGDIR,
419 USE_SWIG, swig_force, swig_args, swig_deps +
420 [ 'src/_xrc_rename.i',
421 'src/_xrc_ex.py',
422 'src/_xmlres.i',
423 'src/_xmlsub.i',
424 'src/_xml.i',
425 'src/_xmlhandler.i',
426 ])
427ext = Extension('_xrc',
428 swig_sources,
429
430 include_dirs = includes + CONTRIBS_INC,
431 define_macros = defines,
432
433 library_dirs = libdirs,
434 libraries = libs,
435
436 extra_compile_args = cflags,
437 extra_link_args = lflags,
438 )
439wxpExtensions.append(ext)
440
441
c368d904
RD
442#----------------------------------------------------------------------
443# Define the GLCanvas extension module
444#----------------------------------------------------------------------
445
1e4a197e 446if BUILD_GLCANVAS:
cfe766c3 447 msg('Preparing GLCANVAS...')
c368d904 448 location = 'contrib/glcanvas'
c368d904 449
d14a1e28 450 swig_sources = run_swig(['glcanvas.i'], location, GENDIR, PKGDIR,
10ef30eb 451 USE_SWIG, swig_force, swig_args, swig_deps)
c368d904
RD
452
453 gl_libs = []
454 if os.name == 'posix':
cb9a93a2 455 gl_config = os.popen(WX_CONFIG + ' --libs gl', 'r').read()[:-1]
1e4a197e 456 gl_lflags = gl_config.split() + lflags
f32afe1c 457 gl_libs = libs
19cf4f80 458 else:
3e46a8e6 459 gl_libs = libs + ['opengl32', 'glu32'] + makeLibName('gl')
f32afe1c 460 gl_lflags = lflags
c368d904 461
d14a1e28 462 ext = Extension('_glcanvas',
3e46a8e6 463 swig_sources,
1e7ecb7b 464
4c417214 465 include_dirs = includes + CONTRIBS_INC,
1e7ecb7b
RD
466 define_macros = defines,
467
468 library_dirs = libdirs,
f32afe1c 469 libraries = gl_libs,
1e7ecb7b
RD
470
471 extra_compile_args = cflags,
f32afe1c 472 extra_link_args = gl_lflags,
1e7ecb7b
RD
473 )
474
475 wxpExtensions.append(ext)
c368d904
RD
476
477
478#----------------------------------------------------------------------
479# Define the OGL extension module
480#----------------------------------------------------------------------
481
1e4a197e 482if BUILD_OGL:
cfe766c3 483 msg('Preparing OGL...')
c368d904 484 location = 'contrib/ogl'
c368d904 485
a32360e0 486 swig_sources = run_swig(['ogl.i'], location, GENDIR, PKGDIR,
d14a1e28
RD
487 USE_SWIG, swig_force, swig_args, swig_deps +
488 [ '%s/_oglbasic.i' % location,
489 '%s/_oglshapes.i' % location,
490 '%s/_oglshapes2.i' % location,
491 '%s/_oglcanvas.i' % location,
492 '%s/_ogldefs.i' % location,
493 ])
c368d904 494
d14a1e28 495 ext = Extension('_ogl',
3ef86e32 496 swig_sources,
1e7ecb7b 497
4c417214 498 include_dirs = includes + [ location ] + CONTRIBS_INC,
dd116e73 499 define_macros = defines + [('wxUSE_DEPRECATED', '0')],
1e7ecb7b
RD
500
501 library_dirs = libdirs,
3ef86e32 502 libraries = libs + makeLibName('ogl'),
1e7ecb7b
RD
503
504 extra_compile_args = cflags,
505 extra_link_args = lflags,
506 )
507
508 wxpExtensions.append(ext)
509
510
c368d904
RD
511
512#----------------------------------------------------------------------
513# Define the STC extension module
514#----------------------------------------------------------------------
515
1e4a197e 516if BUILD_STC:
cfe766c3 517 msg('Preparing STC...')
c368d904 518 location = 'contrib/stc'
020fb2ee
RD
519 #if os.name == 'nt':
520 STC_H = opj(WXDIR, 'contrib', 'include/wx/stc')
521 #else:
522 # STC_H = opj(WXPREFIX, 'include/wx-%d.%d/wx/stc' % (VER_MAJOR, VER_MINOR))
55c020cf 523
de7b7fe6 524## NOTE: need to add something like this to the stc.bkl...
55c020cf 525
3ef86e32
RD
526## # Check if gen_iface needs to be run for the wxSTC sources
527## if (newer(opj(CTRB_SRC, 'stc/stc.h.in'), opj(CTRB_INC, 'stc/stc.h' )) or
528## newer(opj(CTRB_SRC, 'stc/stc.cpp.in'), opj(CTRB_SRC, 'stc/stc.cpp')) or
529## newer(opj(CTRB_SRC, 'stc/gen_iface.py'), opj(CTRB_SRC, 'stc/stc.cpp'))):
55c020cf 530
3ef86e32
RD
531## msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
532## cwd = os.getcwd()
533## os.chdir(opj(CTRB_SRC, 'stc'))
534## sys.path.insert(0, os.curdir)
535## import gen_iface
536## gen_iface.main([])
537## os.chdir(cwd)
c368d904
RD
538
539
befa6977 540 swig_sources = run_swig(['stc.i'], location, GENDIR, PKGDIR,
c368d904
RD
541 USE_SWIG, swig_force,
542 swig_args + ['-I'+STC_H, '-I'+location],
1ce1bd84
RD
543 [opj(STC_H, 'stc.h'),
544 opj(location, "_stc_utf8_methods.py"),
f2ccce28
RD
545 opj(location, "_stc_docstrings.i"),
546 opj(location, "_stc_gendocs.i"),
1ce1bd84 547 ] + swig_deps)
c368d904 548
d14a1e28 549 ext = Extension('_stc',
3ef86e32
RD
550 swig_sources,
551
4c417214 552 include_dirs = includes + CONTRIBS_INC,
3ef86e32 553 define_macros = defines,
1e7ecb7b
RD
554
555 library_dirs = libdirs,
3ef86e32 556 libraries = libs + makeLibName('stc'),
c368d904 557
1e7ecb7b
RD
558 extra_compile_args = cflags,
559 extra_link_args = lflags,
560 )
561
562 wxpExtensions.append(ext)
c368d904
RD
563
564
b7c75283
RD
565#----------------------------------------------------------------------
566# Define the ACTIVEX extension module (experimental)
567#----------------------------------------------------------------------
568
569if BUILD_ACTIVEX:
570 msg('Preparing ACTIVEX...')
571 location = 'contrib/activex'
572 axloc = opj(location, "wxie")
573
574 swig_files = ['activex.i', ]
575
576 swig_sources = run_swig(swig_files, location, '', PKGDIR,
577 USE_SWIG, swig_force, swig_args, swig_deps +
578 [ '%s/_activex_ex.py' % location])
579
580
581 ext = Extension('_activex', ['%s/IEHtmlWin.cpp' % axloc,
582 '%s/wxactivex.cpp' % axloc,
583 ] + swig_sources,
584
585 include_dirs = includes + [ axloc ],
586 define_macros = defines,
587
588 library_dirs = libdirs,
589 libraries = libs,
590
591 extra_compile_args = cflags,
926bb76c
RD
592 extra_link_args = lflags,
593 )
594
595 wxpExtensions.append(ext)
596
597
ebf4302c
RD
598#----------------------------------------------------------------------
599# Define the GIZMOS extension module
600#----------------------------------------------------------------------
601
1e4a197e 602if BUILD_GIZMOS:
ebf4302c
RD
603 msg('Preparing GIZMOS...')
604 location = 'contrib/gizmos'
ebf4302c 605
a32360e0 606 swig_sources = run_swig(['gizmos.i'], location, GENDIR, PKGDIR,
10ef30eb 607 USE_SWIG, swig_force, swig_args, swig_deps)
ebf4302c 608
d14a1e28 609 ext = Extension('_gizmos',
28eab81f 610 [ '%s/treelistctrl.cpp' % opj(location, 'wxCode/src') ] + swig_sources,
ebf4302c 611
28eab81f 612 include_dirs = includes + [ location, opj(location, 'wxCode/include') ] + CONTRIBS_INC,
ebf4302c
RD
613 define_macros = defines,
614
615 library_dirs = libdirs,
3ef86e32 616 libraries = libs + makeLibName('gizmos'),
ebf4302c
RD
617
618 extra_compile_args = cflags,
619 extra_link_args = lflags,
620 )
621
622 wxpExtensions.append(ext)
623
624
2e5aa9c4
RD
625#----------------------------------------------------------------------
626# Define the ANIMATE extension module
627#----------------------------------------------------------------------
628
629if BUILD_ANIMATE:
630 msg('Preparing ANIMATE...')
631 location = 'contrib/animate'
632
633 swig_sources = run_swig(['animate.i'], location, GENDIR, PKGDIR,
634 USE_SWIG, swig_force, swig_args, swig_deps)
635
636 ext = Extension('_animate',
637 swig_sources,
638
639 include_dirs = includes + CONTRIBS_INC,
640 define_macros = defines,
641
642 library_dirs = libdirs,
643 libraries = libs + makeLibName('animate'),
644
645 extra_compile_args = cflags,
646 extra_link_args = lflags,
647 )
648
649 wxpExtensions.append(ext)
650
651
ebf4302c 652
4a61305d
RD
653#----------------------------------------------------------------------
654# Define the DLLWIDGET extension module
655#----------------------------------------------------------------------
656
1e4a197e 657if BUILD_DLLWIDGET:
4a61305d
RD
658 msg('Preparing DLLWIDGET...')
659 location = 'contrib/dllwidget'
660 swig_files = ['dllwidget_.i']
661
662 swig_sources = run_swig(swig_files, location, '', PKGDIR,
10ef30eb 663 USE_SWIG, swig_force, swig_args, swig_deps)
4a61305d
RD
664
665 # copy a contrib project specific py module to the main package dir
666 copy_file(opj(location, 'dllwidget.py'), PKGDIR, update=1, verbose=0)
99abd512 667 CLEANUP.append(opj(PKGDIR, 'dllwidget.py'))
4a61305d
RD
668
669 ext = Extension('dllwidget_c', [
670 '%s/dllwidget.cpp' % location,
671 ] + swig_sources,
672
4c417214 673 include_dirs = includes + CONTRIBS_INC,
4a61305d
RD
674 define_macros = defines,
675
676 library_dirs = libdirs,
677 libraries = libs,
678
679 extra_compile_args = cflags,
680 extra_link_args = lflags,
681 )
682
683 wxpExtensions.append(ext)
684
685
1e4a197e 686
38b97c15 687
1e4a197e 688#----------------------------------------------------------------------
1128a89b 689# Tools, scripts data files, etc.
1e4a197e 690#----------------------------------------------------------------------
8916d007 691
2eb31f8b
RD
692if NO_SCRIPTS:
693 SCRIPTS = None
694else:
1e4a197e
RD
695 SCRIPTS = [opj('scripts/helpviewer'),
696 opj('scripts/img2png'),
2eb31f8b 697 opj('scripts/img2py'),
d48c1c64
RD
698 opj('scripts/img2xpm'),
699 opj('scripts/pyalacarte'),
700 opj('scripts/pyalamode'),
2eb31f8b 701 opj('scripts/pycrust'),
d48c1c64 702 opj('scripts/pyshell'),
1fded56b
RD
703 opj('scripts/pywrap'),
704 opj('scripts/pywrap'),
b6536d60 705 opj('scripts/pywxrc'),
d48c1c64 706 opj('scripts/xrced'),
2eb31f8b 707 ]
d48c1c64 708
4a61305d 709
926bb76c 710
c2079460
RD
711DATA_FILES += find_data_files('wx/tools/XRCed', '*.txt', '*.xrc')
712DATA_FILES += find_data_files('wx/py', '*.txt', '*.ico', '*.css', '*.html')
1fded56b 713DATA_FILES += find_data_files('wx', '*.txt', '*.css', '*.html')
1e4a197e
RD
714
715
1128a89b
RD
716if NO_HEADERS:
717 HEADERS = None
718else:
719 h_files = glob.glob(opj("include/wx/wxPython/*.h"))
720 i_files = glob.glob(opj("src/*.i")) + \
721 glob.glob(opj("src/_*.py")) + \
722 glob.glob(opj("src/*.swg"))
723
e9019d1c
RD
724 HEADERS = zip(h_files, ["/wxPython"]*len(h_files)) + \
725 zip(i_files, ["/wxPython/i_files"]*len(i_files))
726
1128a89b 727
d48c1c64
RD
728
729if INSTALL_MULTIVERSION:
095315e2 730 EXTRA_PATH = getExtraPath(addOpts=EP_ADD_OPTS, shortVer=not EP_FULL_VER)
d48c1c64
RD
731 open("src/wx.pth", "w").write(EXTRA_PATH)
732 CLEANUP.append("src/wx.pth")
733else:
734 EXTRA_PATH = None
735
736
737
c368d904
RD
738#----------------------------------------------------------------------
739# Do the Setup/Build/Install/Whatever
740#----------------------------------------------------------------------
741
1b62f00d 742if __name__ == "__main__":
1e4a197e 743 if not PREP_ONLY:
d48c1c64 744
d14a1e28 745 setup(name = 'wxPython',
1b62f00d
RD
746 version = VERSION,
747 description = DESCRIPTION,
748 long_description = LONG_DESCRIPTION,
749 author = AUTHOR,
750 author_email = AUTHOR_EMAIL,
751 url = URL,
851d4ac7 752 download_url = DOWNLOAD_URL,
e2e02194 753 license = LICENSE,
851d4ac7
RD
754 platforms = PLATFORMS,
755 classifiers = filter(None, CLASSIFIERS.split("\n")),
756 keywords = KEYWORDS,
d14a1e28 757
1fded56b
RD
758 packages = ['wxPython',
759 'wxPython.lib',
760 'wxPython.lib.colourchooser',
761 'wxPython.lib.editor',
762 'wxPython.lib.mixins',
1fded56b 763 'wxPython.tools',
1fded56b
RD
764
765 'wx',
1128a89b 766 'wx.build',
1fded56b
RD
767 'wx.lib',
768 'wx.lib.colourchooser',
769 'wx.lib.editor',
42463de2 770 'wx.lib.floatcanvas',
9176f38f 771 'wx.lib.masked',
1fded56b 772 'wx.lib.mixins',
f847103a 773 'wx.lib.ogl',
1fded56b
RD
774 'wx.py',
775 'wx.tools',
776 'wx.tools.XRCed',
1b62f00d
RD
777 ],
778
d48c1c64
RD
779 extra_path = EXTRA_PATH,
780
1b62f00d
RD
781 ext_package = PKGDIR,
782 ext_modules = wxpExtensions,
8916d007 783
1128a89b
RD
784 options = { 'build' : { 'build_base' : BUILD_BASE },
785 },
a541c325 786
1128a89b 787 scripts = SCRIPTS,
1e4a197e 788 data_files = DATA_FILES,
1128a89b 789 headers = HEADERS,
8916d007 790
d48c1c64
RD
791 # Override some of the default distutils command classes with my own
792 cmdclass = { 'install' : wx_install,
793 'install_data': wx_smart_install_data,
1128a89b
RD
794 'install_headers': wx_install_headers,
795 'clean': wx_extra_clean,
796 },
1b62f00d 797 )
c368d904 798
c368d904 799
d48c1c64
RD
800 if INSTALL_MULTIVERSION:
801 setup(name = 'wxPython-common',
802 version = VERSION,
803 description = DESCRIPTION,
804 long_description = LONG_DESCRIPTION,
805 author = AUTHOR,
806 author_email = AUTHOR_EMAIL,
807 url = URL,
808 download_url = DOWNLOAD_URL,
809 license = LICENSE,
810 platforms = PLATFORMS,
811 classifiers = filter(None, CLASSIFIERS.split("\n")),
812 keywords = KEYWORDS,
813
814 package_dir = { '': 'wxversion' },
815 py_modules = ['wxversion'],
816
817 data_files = [('', ['src/wx.pth'])],
818
819 options = { 'build' : { 'build_base' : BUILD_BASE },
820 },
821
822 cmdclass = { 'install_data': wx_smart_install_data,
823 },
824 )
825
c368d904
RD
826#----------------------------------------------------------------------
827#----------------------------------------------------------------------