2 #----------------------------------------------------------------------
4 import sys
, os
, string
, glob
5 from distutils
.core
import setup
, Extension
6 from distutils
.file_util
import copy_file
7 from distutils
.dir_util
import mkpath
8 from distutils
.dep_util
import newer
10 from my_distutils
import run_swig
, contrib_copy_tree
12 #----------------------------------------------------------------------
13 # flags and values that affect this script
14 #----------------------------------------------------------------------
17 DESCRIPTION
= "Cross platform GUI toolkit for Python"
19 AUTHOR_EMAIL
= "Robin Dunn <robin@alldunn.com>"
20 URL
= "http://wxPython.org/"
21 LICENCE
= "wxWindows (LGPL derivative)"
22 LONG_DESCRIPTION
= """\
23 wxPython is a GUI toolkit for Python that is a wrapper around the
24 wxWindows C++ GUI library. wxPython provides a large variety of
25 window types and controls, all implemented with a native look and
26 feel (and native runtime speed) on the platforms it is supported
31 BUILD_GLCANVAS
= 1 # If true, build the contrib/glcanvas extension module
32 BUILD_OGL
= 1 # If true, build the contrib/ogl extension module
33 BUILD_STC
= 1 # If true, build the contrib/stc extension module
34 BUILD_XRC
= 1 # XML based resource system
35 BUILD_GIZMOS
= 1 # Build a module for the gizmos contrib library
36 BUILD_DLLWIDGET
= 1# Build a module for that enables unknown wx widgets
37 # to be loaded from a DLL to be used from Python.
39 BUILD_IEWIN
= 0 # Internet Explorer wrapper (experimental)
41 CORE_ONLY
= 0 # if true, don't build any of the above
44 GL_ONLY
= 0 # Only used when making the -gl RPM. See the "b" script
45 # for the ugly details
47 USE_SWIG
= 0 # Should we actually execute SWIG, or just use the
48 # files already in the distribution?
50 UNICODE
= 0 # This will pass the 'wxUSE_UNICODE' flag to SWIG and
51 # will ensure that the right headers are found and the
52 # right libs are linked.
54 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
55 # tree, otherwise will assume all needed files are
56 # available in the wxPython source distribution
58 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
59 # but you can set it to pass an alternate
60 # version of wx-config or alternate flags,
61 # eg. as required by the .deb in-tree build.
65 # Some MSW build settings
67 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
68 # (0 or 1 only) should probably find a way to
71 HYBRID
= 0 # If set and not debug or FINAL, then build a
72 # hybrid extension that can be used by the
73 # non-debug version of python, but contains
74 # debugging symbols for wxWindows and wxPython.
75 # wxWindows must have been built with /MD, not /MDd
76 # (using FINAL=hybrid will do it.)
78 WXDLLVER
= '233' # Version part of wxWindows DLL name
81 #----------------------------------------------------------------------
84 if __name__
== "__main__":
89 path
= apply(os
.path
.join
, args
)
90 return os
.path
.normpath(path
)
105 #----------------------------------------------------------------------
107 #----------------------------------------------------------------------
112 force
= '--force' in sys
.argv
or '-f' in sys
.argv
113 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
115 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
118 msg("Compiling wxPython by Borland C/C++ Compiler")
120 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
121 # Version part of BCPP build LIBRARY name
122 WXDLLVER
="" # no dll ver path avaible
125 #----------------------------------------------------------------------
126 # Check for build flags on the command line
127 #----------------------------------------------------------------------
129 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
130 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
131 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'UNICODE',
132 'FINAL', 'HYBRID', ]:
133 for x
in range(len(sys
.argv
)):
134 if string
.find(sys
.argv
[x
], flag
) == 0:
135 pos
= string
.find(sys
.argv
[x
], '=') + 1
137 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
140 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
141 for x
in range(len(sys
.argv
)):
142 if string
.find(sys
.argv
[x
], option
) == 0:
143 pos
= string
.find(sys
.argv
[x
], '=') + 1
145 vars()[option
] = sys
.argv
[x
][pos
:]
148 sys
.argv
= filter(None, sys
.argv
)
152 #----------------------------------------------------------------------
164 if UNICODE
and os
.name
!= 'nt':
165 print "UNICODE is currently only supported on Win32"
170 BUILD_BASE
= BUILD_BASE
+ '.unicode'
173 #----------------------------------------------------------------------
174 # Setup some platform specific stuff
175 #----------------------------------------------------------------------
178 # Set compile flags and such for MSVC. These values are derived
179 # from the wxWindows makefiles for MSVC, other compilers settings
180 # will probably vary...
181 if os
.environ
.has_key('WXWIN'):
182 WXDIR
= os
.environ
['WXWIN']
184 msg("WARNING: WXWIN not set in environment.")
185 WXDIR
= '..' # assumes in CVS tree
197 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
198 opj(WXDIR
, 'include'),
201 defines
= [ ('WIN32', None), # Some of these are no longer
202 ('__WIN32__', None), # necessary. Anybody know which?
204 ('__WINDOWS__', None),
205 ('WINVER', '0x0400'),
212 ('SWIG_GLOBAL', None),
213 ('HAVE_CONFIG_H', None),
214 ('WXP_USE_THREAD', '1'),
217 if bcpp_compiling
: # overwrite it
220 ('WINVER', '0x0400'),
225 ('SWIG_GLOBAL', None),
226 ('HAVE_CONFIG_H', None),
227 ('WXP_USE_THREAD', '1'),
229 ('WXUSE_DEFINE','1'),
234 if not FINAL
or HYBRID
:
235 defines
.append( ('__WXDEBUG__', None) )
237 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
238 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
242 libs
= ['wx'+WXBCPPLIBVER
]
244 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
245 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
246 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
247 'advapi32', 'wsock32']
251 # '/GX-' # workaround for internal compiler error in MSVC on some machines
256 if bcpp_compiling
: # overwrite it
257 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
258 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
259 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
260 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
264 if not FINAL
and HYBRID
and not bcpp_compiling
:
265 cflags
= cflags
+ ['/Od', '/Z7']
266 lflags
= ['/DEBUG', ]
268 elif bcpp_compiling
and not FINAL
:
269 cflags
= cflags
+ ['/Od', '/v', '/y']
270 lflags
= lflags
+ ['/v', ]
274 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
275 # Flags and such for a Darwin (Max OS X) build of Python
277 WXDIR
= '..' # assumes IN_CVS_TREE
282 defines
= [('SWIG_GLOBAL', None),
283 ('HAVE_CONFIG_H', None),
284 ('WXP_USE_THREAD', '1'),
289 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
290 cflags
= string
.split(cflags
)
292 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
293 lflags
= string
.split(lflags
)
297 elif os
.name
== 'posix':
298 # Set flags for Unix type platforms
300 WXDIR
= '..' # assumes IN_CVS_TREE
301 WXPLAT
= '__WXGTK__' # and assumes GTK...
302 GENDIR
= 'gtk' # Need to allow for Motif eventually too
305 defines
= [('SWIG_GLOBAL', None),
306 ('HAVE_CONFIG_H', None),
307 ('WXP_USE_THREAD', '1'),
312 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
313 os
.popen('gtk-config --cflags', 'r').read()[:-1]
314 cflags
= string
.split(cflags
)
316 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
317 lflags
= string
.split(lflags
)
321 raise 'Sorry Charlie...'
324 #----------------------------------------------------------------------
325 # Check if the version file needs updated
326 #----------------------------------------------------------------------
328 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
329 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
333 #----------------------------------------------------------------------
335 #----------------------------------------------------------------------
338 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
341 #'-docstring', '-Sbefore',
342 '-I./src', '-D'+WXPLAT
,
345 swig_args
.append('-DwxUSE_UNICODE')
347 swig_deps
= ['src/my_typemaps.i']
350 #----------------------------------------------------------------------
351 # Define the CORE extension module
352 #----------------------------------------------------------------------
355 msg('Preparing CORE...')
356 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
357 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
358 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
359 'printfw.i', 'sizers.i', 'clip_dnd.i',
360 'filesys.i', 'streams.i', 'utils.i'
363 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
364 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
366 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
367 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
368 copy_file('src/wxc.pyd.manifest', PKGDIR
, update
=1, verbose
=0)
370 if IN_CVS_TREE
: # update the licence files
372 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
373 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
377 rc_file
= ['src/wxc.rc']
382 ext
= Extension('wxc', ['src/helpers.cpp',
384 ] + rc_file
+ swig_sources
,
386 include_dirs
= includes
,
387 define_macros
= defines
,
389 library_dirs
= libdirs
,
392 extra_compile_args
= cflags
,
393 extra_link_args
= lflags
,
395 wxpExtensions
.append(ext
)
398 # Extension for the grid module
399 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
400 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
401 ext
= Extension('gridc', swig_sources
,
402 include_dirs
= includes
,
403 define_macros
= defines
,
404 library_dirs
= libdirs
,
406 extra_compile_args
= cflags
,
407 extra_link_args
= lflags
,
409 wxpExtensions
.append(ext
)
412 # Extension for the html modules
413 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
414 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
415 ext
= Extension('htmlc', swig_sources
,
416 include_dirs
= includes
,
417 define_macros
= defines
,
418 library_dirs
= libdirs
,
420 extra_compile_args
= cflags
,
421 extra_link_args
= lflags
,
423 wxpExtensions
.append(ext
)
426 # Extension for the calendar module
427 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
428 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
429 ext
= Extension('calendarc', swig_sources
,
430 include_dirs
= includes
,
431 define_macros
= defines
,
432 library_dirs
= libdirs
,
434 extra_compile_args
= cflags
,
435 extra_link_args
= lflags
,
437 wxpExtensions
.append(ext
)
440 # Extension for the help module
441 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
442 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
443 ext
= Extension('helpc', swig_sources
,
444 include_dirs
= includes
,
445 define_macros
= defines
,
446 library_dirs
= libdirs
,
448 extra_compile_args
= cflags
,
449 extra_link_args
= lflags
,
451 wxpExtensions
.append(ext
)
454 #----------------------------------------------------------------------
455 # Define the GLCanvas extension module
456 #----------------------------------------------------------------------
458 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
459 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
461 if BUILD_GLCANVAS
or GL_ONLY
:
462 msg('Preparing GLCANVAS...')
463 location
= 'contrib/glcanvas'
464 swig_files
= ['glcanvas.i']
467 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
468 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
471 if os
.name
== 'posix':
472 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
473 gl_lflags
= string
.split(gl_config
) + lflags
476 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
477 gl_libs
= libs
+ ['opengl32', 'glu32']
480 ext
= Extension('glcanvasc',
481 swig_sources
+ other_sources
,
483 include_dirs
= includes
,
484 define_macros
= defines
,
486 library_dirs
= libdirs
,
489 extra_compile_args
= cflags
,
490 extra_link_args
= gl_lflags
,
493 wxpExtensions
.append(ext
)
496 #----------------------------------------------------------------------
497 # Define the OGL extension module
498 #----------------------------------------------------------------------
500 if not GL_ONLY
and BUILD_OGL
:
501 msg('Preparing OGL...')
502 location
= 'contrib/ogl'
503 OGLLOC
= opj(location
, 'contrib/src/ogl')
504 OGLINC
= opj(location
, 'contrib/include')
506 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
509 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
510 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
513 # make sure local copy of contrib files are up to date
514 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
515 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
517 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
518 '%s/bmpshape.cpp' % OGLLOC
,
519 '%s/composit.cpp' % OGLLOC
,
520 '%s/divided.cpp' % OGLLOC
,
521 '%s/lines.cpp' % OGLLOC
,
522 '%s/misc.cpp' % OGLLOC
,
523 '%s/basic2.cpp' % OGLLOC
,
524 '%s/canvas.cpp' % OGLLOC
,
525 '%s/constrnt.cpp' % OGLLOC
,
526 '%s/drawn.cpp' % OGLLOC
,
527 '%s/mfutils.cpp' % OGLLOC
,
528 '%s/ogldiag.cpp' % OGLLOC
,
531 include_dirs
= [OGLINC
] + includes
,
532 define_macros
= defines
,
534 library_dirs
= libdirs
,
537 extra_compile_args
= cflags
,
538 extra_link_args
= lflags
,
541 wxpExtensions
.append(ext
)
545 #----------------------------------------------------------------------
546 # Define the STC extension module
547 #----------------------------------------------------------------------
549 if not GL_ONLY
and BUILD_STC
:
550 msg('Preparing STC...')
551 location
= 'contrib/stc'
552 STCLOC
= opj(location
, 'contrib/src/stc')
553 STCINC
= opj(location
, 'contrib/include')
554 STC_H
= opj(location
, 'contrib/include/wx/stc')
557 # Check if gen_iface needs to be run for the wxSTC sources
558 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
559 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
560 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
562 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
564 os
.chdir(opj(CTRB_SRC
, 'stc'))
570 # make sure local copy of contrib files are up to date
571 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
572 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
576 swig_files
= ['stc_.i']
577 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
578 USE_SWIG
, swig_force
,
579 swig_args
+ ['-I'+STC_H
, '-I'+location
],
580 [opj(STC_H
, 'stc.h')] + swig_deps
)
582 # copy a contrib project specific py module to the main package dir
583 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
585 # add some include dirs to the standard set
586 stc_includes
= includes
[:]
587 stc_includes
.append('%s/scintilla/include' % STCLOC
)
588 stc_includes
.append('%s/scintilla/src' % STCLOC
)
589 stc_includes
.append(STCINC
)
591 # and some macro definitions
592 stc_defines
= defines
[:]
593 stc_defines
.append( ('__WX__', None) )
594 stc_defines
.append( ('SCI_LEXER', None) )
595 stc_defines
.append( ('LINK_LEXERS', None) )
598 ext
= Extension('stc_c',
599 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
600 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
601 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
602 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
603 '%s/scintilla/src/Document.cxx' % STCLOC
,
604 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
605 '%s/scintilla/src/Editor.cxx' % STCLOC
,
606 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
607 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
608 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
609 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
610 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
611 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
612 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
613 '%s/scintilla/src/Style.cxx' % STCLOC
,
614 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
615 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
616 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
617 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
619 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
620 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
621 '%s/scintilla/src/LexBaan.cxx' % STCLOC
,
622 '%s/scintilla/src/LexBullant.cxx' % STCLOC
,
623 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
624 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
625 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
626 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
627 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
628 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
629 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
630 '%s/scintilla/src/LexMatlab.cxx' % STCLOC
,
631 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
632 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
633 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
634 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
635 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
636 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
637 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
639 '%s/PlatWX.cpp' % STCLOC
,
640 '%s/ScintillaWX.cpp' % STCLOC
,
641 '%s/stc.cpp' % STCLOC
,
644 include_dirs
= stc_includes
,
645 define_macros
= stc_defines
,
647 library_dirs
= libdirs
,
650 extra_compile_args
= cflags
,
651 extra_link_args
= lflags
,
654 wxpExtensions
.append(ext
)
658 #----------------------------------------------------------------------
659 # Define the IEWIN extension module (experimental)
660 #----------------------------------------------------------------------
662 if not GL_ONLY
and BUILD_IEWIN
:
663 msg('Preparing IEWIN...')
664 location
= 'contrib/iewin'
666 swig_files
= ['iewin.i', ]
668 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
669 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
672 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
675 include_dirs
= includes
,
676 define_macros
= defines
,
678 library_dirs
= libdirs
,
681 extra_compile_args
= cflags
,
682 extra_link_args
= lflags
,
685 wxpExtensions
.append(ext
)
688 #----------------------------------------------------------------------
689 # Define the XRC extension module
690 #----------------------------------------------------------------------
692 if not GL_ONLY
and BUILD_XRC
:
693 msg('Preparing XRC...')
694 location
= 'contrib/xrc'
695 XMLLOC
= opj(location
, 'contrib/src/xrc')
696 XMLINC
= opj(location
, 'contrib/include')
698 swig_files
= ['xrc.i']
700 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
701 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
703 xmlres_includes
= includes
[:]
704 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
705 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
706 xmlres_includes
.append(XMLINC
)
709 # make sure local copy of contrib files are up to date
711 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
712 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
714 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
715 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
716 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
718 '%s/xh_bmp.cpp' % XMLLOC
,
719 '%s/xh_bmpbt.cpp' % XMLLOC
,
720 '%s/xh_bttn.cpp' % XMLLOC
,
721 '%s/xh_cald.cpp' % XMLLOC
,
722 '%s/xh_chckb.cpp' % XMLLOC
,
724 '%s/xh_chckl.cpp' % XMLLOC
,
725 '%s/xh_choic.cpp' % XMLLOC
,
726 '%s/xh_combo.cpp' % XMLLOC
,
727 '%s/xh_dlg.cpp' % XMLLOC
,
728 '%s/xh_frame.cpp' % XMLLOC
,
730 '%s/xh_gauge.cpp' % XMLLOC
,
731 '%s/xh_gdctl.cpp' % XMLLOC
,
732 '%s/xh_html.cpp' % XMLLOC
,
733 '%s/xh_listb.cpp' % XMLLOC
,
734 '%s/xh_listc.cpp' % XMLLOC
,
735 '%s/xh_menu.cpp' % XMLLOC
,
737 '%s/xh_notbk.cpp' % XMLLOC
,
738 '%s/xh_panel.cpp' % XMLLOC
,
739 '%s/xh_radbt.cpp' % XMLLOC
,
740 '%s/xh_radbx.cpp' % XMLLOC
,
741 '%s/xh_scrol.cpp' % XMLLOC
,
743 '%s/xh_sizer.cpp' % XMLLOC
,
744 '%s/xh_slidr.cpp' % XMLLOC
,
745 '%s/xh_spin.cpp' % XMLLOC
,
746 '%s/xh_stbmp.cpp' % XMLLOC
,
747 '%s/xh_stbox.cpp' % XMLLOC
,
749 '%s/xh_stlin.cpp' % XMLLOC
,
750 '%s/xh_sttxt.cpp' % XMLLOC
,
751 '%s/xh_text.cpp' % XMLLOC
,
752 '%s/xh_toolb.cpp' % XMLLOC
,
753 '%s/xh_tree.cpp' % XMLLOC
,
755 '%s/xh_unkwn.cpp' % XMLLOC
,
756 '%s/xml.cpp' % XMLLOC
,
757 '%s/xmlres.cpp' % XMLLOC
,
758 '%s/xmlrsall.cpp' % XMLLOC
,
762 include_dirs
= xmlres_includes
,
763 define_macros
= defines
,
765 library_dirs
= libdirs
,
768 extra_compile_args
= cflags
,
769 extra_link_args
= lflags
,
772 wxpExtensions
.append(ext
)
776 #----------------------------------------------------------------------
777 # Define the GIZMOS extension module
778 #----------------------------------------------------------------------
780 if not GL_ONLY
and BUILD_GIZMOS
:
781 msg('Preparing GIZMOS...')
782 location
= 'contrib/gizmos'
783 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
784 GIZMOINC
= opj(location
, 'contrib/include')
786 swig_files
= ['gizmos.i']
788 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
789 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
791 gizmos_includes
= includes
[:]
792 gizmos_includes
.append(GIZMOINC
)
795 # make sure local copy of contrib files are up to date
797 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
798 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
800 ext
= Extension('gizmosc', [
801 '%s/dynamicsash.cpp' % GIZMOLOC
,
802 '%s/editlbox.cpp' % GIZMOLOC
,
803 #'%s/multicell.cpp' % GIZMOLOC,
804 '%s/splittree.cpp' % GIZMOLOC
,
805 '%s/ledctrl.cpp' % GIZMOLOC
,
808 include_dirs
= gizmos_includes
,
809 define_macros
= defines
,
811 library_dirs
= libdirs
,
814 extra_compile_args
= cflags
,
815 extra_link_args
= lflags
,
818 wxpExtensions
.append(ext
)
822 #----------------------------------------------------------------------
823 # Define the DLLWIDGET extension module
824 #----------------------------------------------------------------------
826 if not GL_ONLY
and BUILD_DLLWIDGET
:
827 msg('Preparing DLLWIDGET...')
828 location
= 'contrib/dllwidget'
829 swig_files
= ['dllwidget_.i']
831 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
832 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
834 # copy a contrib project specific py module to the main package dir
835 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
837 ext
= Extension('dllwidget_c', [
838 '%s/dllwidget.cpp' % location
,
841 include_dirs
= includes
,
842 define_macros
= defines
,
844 library_dirs
= libdirs
,
847 extra_compile_args
= cflags
,
848 extra_link_args
= lflags
,
851 wxpExtensions
.append(ext
)
854 #----------------------------------------------------------------------
856 #----------------------------------------------------------------------
858 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
859 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
860 glob
.glob("tools/XRCed/*.xrc") +
861 ["tools/XRCed/CHANGES",
863 "tools/XRCed/README"]),
869 #----------------------------------------------------------------------
870 # Do the Setup/Build/Install/Whatever
871 #----------------------------------------------------------------------
873 if __name__
== "__main__":
877 description
= DESCRIPTION
,
878 long_description
= LONG_DESCRIPTION
,
880 author_email
= AUTHOR_EMAIL
,
886 PKGDIR
+'.lib.editor',
887 PKGDIR
+'.lib.mixins',
888 PKGDIR
+'.lib.PyCrust',
891 ext_package
= PKGDIR
,
892 ext_modules
= wxpExtensions
,
894 options
= { 'build' : { 'build_base' : BUILD_BASE }
}
896 ##data_files = TOOLS,
901 setup(name
= "wxPython-gl",
903 description
= "wxGLCanvas class for wxPython",
905 author_email
= AUTHOR_EMAIL
,
909 py_modules
= [ "wxPython.glcanvas" ],
911 ext_package
= PKGDIR
,
912 ext_modules
= wxpExtensions
,
919 #----------------------------------------------------------------------
920 #----------------------------------------------------------------------