]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/setup.py
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 the gizmos contrib library
38 BUILD_IEWIN
= 0 # Internet Explorer wrapper (experimental)
40 CORE_ONLY
= 0 # if true, don't build any of the above
43 GL_ONLY
= 0 # Only used when making the -gl RPM. See the "b" script
44 # for the ugly details
46 USE_SWIG
= 0 # Should we actually execute SWIG, or just use the
47 # files already in the distribution?
49 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
50 # tree, otherwise will assume all needed files are
51 # available in the wxPython source distribution
53 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
54 # but you can set it to pass an alternate
55 # version of wx-config or alternate flags,
56 # eg. as required by the .deb in-tree build.
58 # Some MSW build settings
60 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
61 # (0 or 1 only) should probably find a way to
64 HYBRID
= 0 # If set and not debug or FINAL, then build a
65 # hybrid extension that can be used by the
66 # non-debug version of python, but contains
67 # debugging symbols for wxWindows and wxPython.
68 # wxWindows must have been built with /MD, not /MDd
69 # (using FINAL=hybrid will do it.)
71 WXDLLVER
= '232' # Version part of DLL name
74 #----------------------------------------------------------------------
77 if __name__
== "__main__":
81 path
= apply(os
.path
.join
, args
)
82 return os
.path
.normpath(path
)
93 #----------------------------------------------------------------------
95 #----------------------------------------------------------------------
100 force
= '--force' in sys
.argv
or '-f' in sys
.argv
101 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
103 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
106 msg("Compiling wxPython by Borland C/C++ Compiler")
108 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
109 # Version part of BCPP build LIBRARY name
110 WXDLLVER
="" # no dll ver path avaible
113 #----------------------------------------------------------------------
114 # Check for build flags on the command line
115 #----------------------------------------------------------------------
117 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
118 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
119 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
120 'FINAL', 'HYBRID', ]:
121 for x
in range(len(sys
.argv
)):
122 if string
.find(sys
.argv
[x
], flag
) == 0:
123 pos
= string
.find(sys
.argv
[x
], '=') + 1
125 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
128 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
129 for x
in range(len(sys
.argv
)):
130 if string
.find(sys
.argv
[x
], option
) == 0:
131 pos
= string
.find(sys
.argv
[x
], '=') + 1
133 vars()[option
] = sys
.argv
[x
][pos
:]
136 sys
.argv
= filter(None, sys
.argv
)
148 #----------------------------------------------------------------------
149 # Setup some platform specific stuff
150 #----------------------------------------------------------------------
153 # Set compile flags and such for MSVC. These values are derived
154 # from the wxWindows makefiles for MSVC, others will probably
156 WXDIR
= os
.environ
['WXWIN']
168 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
169 opj(WXDIR
, 'include'),
172 defines
= [ ('WIN32', None), # Some of these are no longer
173 ('__WIN32__', None), # necessary. Anybody know which?
175 ('__WINDOWS__', None),
176 ('WINVER', '0x0400'),
183 ('SWIG_GLOBAL', None),
184 ('HAVE_CONFIG_H', None),
185 ('WXP_USE_THREAD', '1'),
188 if bcpp_compiling
: # overwrite it
191 ('WINVER', '0x0400'),
196 ('SWIG_GLOBAL', None),
197 ('HAVE_CONFIG_H', None),
198 ('WXP_USE_THREAD', '1'),
200 ('WXUSE_DEFINE','1'),
205 if not FINAL
or HYBRID
:
206 defines
.append( ('__WXDEBUG__', None) )
208 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
209 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
213 libs
= ['wx'+WXBCPPLIBVER
]
215 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
216 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
217 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
218 'advapi32', 'wsock32']
221 cflags
= [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines
225 if bcpp_compiling
: # overwrite it
226 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
227 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
228 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
229 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
233 if not FINAL
and HYBRID
and not bcpp_compiling
:
234 cflags
= cflags
+ ['/Od', '/Z7']
235 lflags
= ['/DEBUG', ]
237 elif bcpp_compiling
and not FINAL
:
238 cflags
= cflags
+ ['/Od', '/v', '/y']
239 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
243 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
244 # Flags and such for a Darwin (Max OS X) build of Python
246 WXDIR
= '..' # assumes IN_CVS_TREE
251 defines
= [('SWIG_GLOBAL', None),
252 ('HAVE_CONFIG_H', None),
253 ('WXP_USE_THREAD', '1'),
258 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
259 cflags
= string
.split(cflags
)
261 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
262 lflags
= string
.split(lflags
)
266 elif os
.name
== 'posix':
267 # Set flags for Unix type platforms
269 WXDIR
= '..' # assumes IN_CVS_TREE
270 WXPLAT
= '__WXGTK__' # and assumes GTK...
271 GENDIR
= 'gtk' # Need to allow for Motif eventually too
274 defines
= [('SWIG_GLOBAL', None),
275 ('HAVE_CONFIG_H', None),
276 ('WXP_USE_THREAD', '1'),
281 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
282 os
.popen('gtk-config --cflags', 'r').read()[:-1]
283 cflags
= string
.split(cflags
)
285 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
286 lflags
= string
.split(lflags
)
290 raise 'Sorry Charlie...'
293 #----------------------------------------------------------------------
294 # Check if the version file needs updated
295 #----------------------------------------------------------------------
297 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
298 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
302 #----------------------------------------------------------------------
304 #----------------------------------------------------------------------
307 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
310 #'-docstring', '-Sbefore',
311 '-I./src', '-D'+WXPLAT
,
313 swig_deps
= ['src/my_typemaps.i']
316 #----------------------------------------------------------------------
317 # Define the CORE extension module
318 #----------------------------------------------------------------------
321 msg('Preparing CORE...')
322 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
323 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
324 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
325 'printfw.i', 'sizers.i', 'clip_dnd.i',
326 'filesys.i', 'streams.i',
327 ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
330 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
331 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
333 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
334 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
337 if IN_CVS_TREE
: # update the licence files
339 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
340 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
344 rc_file
= ['src/wxc.rc']
349 ext
= Extension('wxc', ['src/helpers.cpp',
351 ] + rc_file
+ swig_sources
,
353 include_dirs
= includes
,
354 define_macros
= defines
,
356 library_dirs
= libdirs
,
359 extra_compile_args
= cflags
,
360 extra_link_args
= lflags
,
362 wxpExtensions
.append(ext
)
365 # Extension for the grid module
366 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
367 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
368 ext
= Extension('gridc', swig_sources
,
369 include_dirs
= includes
,
370 define_macros
= defines
,
371 library_dirs
= libdirs
,
373 extra_compile_args
= cflags
,
374 extra_link_args
= lflags
,
376 wxpExtensions
.append(ext
)
379 # Extension for the html modules
380 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
381 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
382 ext
= Extension('htmlc', swig_sources
,
383 include_dirs
= includes
,
384 define_macros
= defines
,
385 library_dirs
= libdirs
,
387 extra_compile_args
= cflags
,
388 extra_link_args
= lflags
,
390 wxpExtensions
.append(ext
)
393 # Extension for the utils module
394 swig_sources
= run_swig(['utils.i'], 'src', GENDIR
, PKGDIR
,
395 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
396 ext
= Extension('utilsc', swig_sources
,
397 include_dirs
= includes
,
398 define_macros
= defines
,
399 library_dirs
= libdirs
,
401 extra_compile_args
= cflags
,
402 extra_link_args
= lflags
,
404 wxpExtensions
.append(ext
)
407 # Extension for the calendar module
408 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
409 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
410 ext
= Extension('calendarc', swig_sources
,
411 include_dirs
= includes
,
412 define_macros
= defines
,
413 library_dirs
= libdirs
,
415 extra_compile_args
= cflags
,
416 extra_link_args
= lflags
,
418 wxpExtensions
.append(ext
)
421 # Extension for the help module
422 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
423 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
424 ext
= Extension('helpc', swig_sources
,
425 include_dirs
= includes
,
426 define_macros
= defines
,
427 library_dirs
= libdirs
,
429 extra_compile_args
= cflags
,
430 extra_link_args
= lflags
,
432 wxpExtensions
.append(ext
)
435 #----------------------------------------------------------------------
436 # Define the GLCanvas extension module
437 #----------------------------------------------------------------------
439 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
440 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
442 if BUILD_GLCANVAS
or GL_ONLY
:
443 msg('Preparing GLCANVAS...')
444 location
= 'contrib/glcanvas'
445 swig_files
= ['glcanvas.i']
448 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
449 USE_SWIG
, swig_force
, swig_args
)
452 if os
.name
== 'posix':
453 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
454 gl_lflags
= string
.split(gl_config
) + lflags
457 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
458 gl_libs
= libs
+ ['opengl32', 'glu32']
461 ext
= Extension('glcanvasc',
462 swig_sources
+ other_sources
,
464 include_dirs
= includes
,
465 define_macros
= defines
,
467 library_dirs
= libdirs
,
470 extra_compile_args
= cflags
,
471 extra_link_args
= gl_lflags
,
474 wxpExtensions
.append(ext
)
477 #----------------------------------------------------------------------
478 # Define the OGL extension module
479 #----------------------------------------------------------------------
481 if not GL_ONLY
and BUILD_OGL
:
482 msg('Preparing OGL...')
483 location
= 'contrib/ogl'
484 OGLLOC
= opj(location
, 'contrib/src/ogl')
485 OGLINC
= opj(location
, 'contrib/include')
487 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
490 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
491 USE_SWIG
, swig_force
, swig_args
)
494 # make sure local copy of contrib files are up to date
495 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
496 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
498 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
499 '%s/bmpshape.cpp' % OGLLOC
,
500 '%s/composit.cpp' % OGLLOC
,
501 '%s/divided.cpp' % OGLLOC
,
502 '%s/lines.cpp' % OGLLOC
,
503 '%s/misc.cpp' % OGLLOC
,
504 '%s/basic2.cpp' % OGLLOC
,
505 '%s/canvas.cpp' % OGLLOC
,
506 '%s/constrnt.cpp' % OGLLOC
,
507 '%s/drawn.cpp' % OGLLOC
,
508 '%s/mfutils.cpp' % OGLLOC
,
509 '%s/ogldiag.cpp' % OGLLOC
,
512 include_dirs
= [OGLINC
] + includes
,
513 define_macros
= defines
,
515 library_dirs
= libdirs
,
518 extra_compile_args
= cflags
,
519 extra_link_args
= lflags
,
522 wxpExtensions
.append(ext
)
526 #----------------------------------------------------------------------
527 # Define the STC extension module
528 #----------------------------------------------------------------------
530 if not GL_ONLY
and BUILD_STC
:
531 msg('Preparing STC...')
532 location
= 'contrib/stc'
533 STCLOC
= opj(location
, 'contrib/src/stc')
534 STCINC
= opj(location
, 'contrib/include')
535 STC_H
= opj(location
, 'contrib/include/wx/stc')
538 # Check if gen_iface needs to be run for the wxSTC sources
539 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
540 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
541 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
543 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
545 os
.chdir(opj(CTRB_SRC
, 'stc'))
551 # make sure local copy of contrib files are up to date
552 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
553 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
557 swig_files
= ['stc_.i']
558 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
559 USE_SWIG
, swig_force
,
560 swig_args
+ ['-I'+STC_H
, '-I'+location
],
561 [opj(STC_H
, 'stc.h')])
563 # copy a contrib project specific py module to the main package dir
564 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
566 # add some include dirs to the standard set
567 stc_includes
= includes
[:]
568 stc_includes
.append('%s/scintilla/include' % STCLOC
)
569 stc_includes
.append('%s/scintilla/src' % STCLOC
)
570 stc_includes
.append(STCINC
)
572 # and some macro definitions
573 stc_defines
= defines
[:]
574 stc_defines
.append( ('__WX__', None) )
575 stc_defines
.append( ('SCI_LEXER', None) )
578 ext
= Extension('stc_c',
579 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
580 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
581 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
582 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
583 '%s/scintilla/src/Document.cxx' % STCLOC
,
584 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
585 '%s/scintilla/src/Editor.cxx' % STCLOC
,
586 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
587 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
588 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
589 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
590 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
591 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
592 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
593 '%s/scintilla/src/Style.cxx' % STCLOC
,
594 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
595 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
596 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
597 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
599 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
600 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
601 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
602 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
603 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
604 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
605 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
606 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
607 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
608 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
609 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
610 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
611 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
612 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
613 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
614 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
616 '%s/PlatWX.cpp' % STCLOC
,
617 '%s/ScintillaWX.cpp' % STCLOC
,
618 '%s/stc.cpp' % STCLOC
,
621 include_dirs
= stc_includes
,
622 define_macros
= stc_defines
,
624 library_dirs
= libdirs
,
627 extra_compile_args
= cflags
,
628 extra_link_args
= lflags
,
631 wxpExtensions
.append(ext
)
635 #----------------------------------------------------------------------
636 # Define the IEWIN extension module (experimental)
637 #----------------------------------------------------------------------
639 if not GL_ONLY
and BUILD_IEWIN
:
640 msg('Preparing IEWIN...')
641 location
= 'contrib/iewin'
643 swig_files
= ['iewin.i', ]
645 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
646 USE_SWIG
, swig_force
, swig_args
)
649 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
652 include_dirs
= includes
,
653 define_macros
= defines
,
655 library_dirs
= libdirs
,
658 extra_compile_args
= cflags
,
659 extra_link_args
= lflags
,
662 wxpExtensions
.append(ext
)
665 #----------------------------------------------------------------------
666 # Define the XRC extension module
667 #----------------------------------------------------------------------
669 if not GL_ONLY
and BUILD_XRC
:
670 msg('Preparing XRC...')
671 location
= 'contrib/xrc'
672 XMLLOC
= opj(location
, 'contrib/src/xrc')
673 XMLINC
= opj(location
, 'contrib/include')
675 swig_files
= ['xrc.i']
677 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
678 USE_SWIG
, swig_force
, swig_args
)
680 xmlres_includes
= includes
[:]
681 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
682 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
683 xmlres_includes
.append(XMLINC
)
686 # make sure local copy of contrib files are up to date
688 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
689 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
691 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
692 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
693 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
695 '%s/xh_bmp.cpp' % XMLLOC
,
696 '%s/xh_bmpbt.cpp' % XMLLOC
,
697 '%s/xh_bttn.cpp' % XMLLOC
,
698 '%s/xh_cald.cpp' % XMLLOC
,
699 '%s/xh_chckb.cpp' % XMLLOC
,
701 '%s/xh_chckl.cpp' % XMLLOC
,
702 '%s/xh_choic.cpp' % XMLLOC
,
703 '%s/xh_combo.cpp' % XMLLOC
,
704 '%s/xh_dlg.cpp' % XMLLOC
,
705 '%s/xh_frame.cpp' % XMLLOC
,
707 '%s/xh_gauge.cpp' % XMLLOC
,
708 '%s/xh_html.cpp' % XMLLOC
,
709 '%s/xh_listb.cpp' % XMLLOC
,
710 '%s/xh_listc.cpp' % XMLLOC
,
711 '%s/xh_menu.cpp' % XMLLOC
,
713 '%s/xh_notbk.cpp' % XMLLOC
,
714 '%s/xh_panel.cpp' % XMLLOC
,
715 '%s/xh_radbt.cpp' % XMLLOC
,
716 '%s/xh_radbx.cpp' % XMLLOC
,
717 '%s/xh_scrol.cpp' % XMLLOC
,
719 '%s/xh_sizer.cpp' % XMLLOC
,
720 '%s/xh_slidr.cpp' % XMLLOC
,
721 '%s/xh_spin.cpp' % XMLLOC
,
722 '%s/xh_stbmp.cpp' % XMLLOC
,
723 '%s/xh_stbox.cpp' % XMLLOC
,
725 '%s/xh_stlin.cpp' % XMLLOC
,
726 '%s/xh_sttxt.cpp' % XMLLOC
,
727 '%s/xh_text.cpp' % XMLLOC
,
728 '%s/xh_toolb.cpp' % XMLLOC
,
729 '%s/xh_tree.cpp' % XMLLOC
,
731 '%s/xh_unkwn.cpp' % XMLLOC
,
732 '%s/xml.cpp' % XMLLOC
,
733 '%s/xmlbin.cpp' % XMLLOC
,
734 '%s/xmlbinz.cpp' % XMLLOC
,
735 '%s/xmlexpat.cpp' % XMLLOC
,
737 '%s/xmlres.cpp' % XMLLOC
,
738 '%s/xmlrsall.cpp' % XMLLOC
,
739 '%s/xmlwrite.cpp' % XMLLOC
,
743 include_dirs
= xmlres_includes
,
744 define_macros
= defines
,
746 library_dirs
= libdirs
,
749 extra_compile_args
= cflags
,
750 extra_link_args
= lflags
,
753 wxpExtensions
.append(ext
)
757 #----------------------------------------------------------------------
758 # Define the GIZMOS extension module
759 #----------------------------------------------------------------------
761 if not GL_ONLY
and BUILD_GIZMOS
:
762 msg('Preparing GIZMOS...')
763 location
= 'contrib/gizmos'
764 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
765 GIZMOINC
= opj(location
, 'contrib/include')
767 swig_files
= ['gizmos.i']
769 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
770 USE_SWIG
, swig_force
, swig_args
)
772 gizmos_includes
= includes
[:]
773 gizmos_includes
.append(GIZMOINC
)
776 # make sure local copy of contrib files are up to date
778 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
779 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
781 ext
= Extension('gizmosc', [
782 '%s/dynamicsash.cpp' % GIZMOLOC
,
783 '%s/editlbox.cpp' % GIZMOLOC
,
784 #'%s/multicell.cpp' % GIZMOLOC,
785 '%s/splittree.cpp' % GIZMOLOC
,
786 '%s/ledctrl.cpp' % GIZMOLOC
,
789 include_dirs
= gizmos_includes
,
790 define_macros
= defines
,
792 library_dirs
= libdirs
,
795 extra_compile_args
= cflags
,
796 extra_link_args
= lflags
,
799 wxpExtensions
.append(ext
)
803 #----------------------------------------------------------------------
804 # Define the DLLWIDGET extension module
805 #----------------------------------------------------------------------
807 if not GL_ONLY
and BUILD_DLLWIDGET
:
808 msg('Preparing DLLWIDGET...')
809 location
= 'contrib/dllwidget'
810 swig_files
= ['dllwidget_.i']
812 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
813 USE_SWIG
, swig_force
, swig_args
)
815 # copy a contrib project specific py module to the main package dir
816 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
818 ext
= Extension('dllwidget_c', [
819 '%s/dllwidget.cpp' % location
,
822 include_dirs
= includes
,
823 define_macros
= defines
,
825 library_dirs
= libdirs
,
828 extra_compile_args
= cflags
,
829 extra_link_args
= lflags
,
832 wxpExtensions
.append(ext
)
835 #----------------------------------------------------------------------
837 #----------------------------------------------------------------------
839 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
840 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
841 glob
.glob("tools/XRCed/*.xrc") +
842 ["tools/XRCed/CHANGES",
844 "tools/XRCed/README"]),
850 #----------------------------------------------------------------------
851 # Do the Setup/Build/Install/Whatever
852 #----------------------------------------------------------------------
854 if __name__
== "__main__":
858 description
= DESCRIPTION
,
859 long_description
= LONG_DESCRIPTION
,
861 author_email
= AUTHOR_EMAIL
,
867 PKGDIR
+'.lib.editor',
868 PKGDIR
+'.lib.mixins',
869 PKGDIR
+'.lib.PyCrust',
872 ext_package
= PKGDIR
,
873 ext_modules
= wxpExtensions
,
875 ##data_files = TOOLS,
880 setup(name
= "wxPython-gl",
882 description
= "wxGLCanvas class for wxPython",
884 author_email
= AUTHOR_EMAIL
,
888 py_modules
= [ "wxPython.glcanvas" ],
890 ext_package
= PKGDIR
,
891 ext_modules
= wxpExtensions
,
898 #----------------------------------------------------------------------
899 #----------------------------------------------------------------------