]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/setup.py
2 #----------------------------------------------------------------------
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_IEWIN
= 0 # Internet Explorer wrapper (experimental)
35 BUILD_XRC
= 1 # XML based resource system
36 BUILD_GIZMOS
= 1 # Build a module for the gizmos contrib library
39 CORE_ONLY
= 0 # if true, don't build any of the above
40 GL_ONLY
= 0 # Only used when making the -gl RPM. See the "b" script
41 # for the ugly details
43 USE_SWIG
= 0 # Should we actually execute SWIG, or just use the
44 # files already in the distribution?
46 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
47 # tree, otherwise will assume all needed files are
48 # available in the wxPython source distribution
50 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
51 # but you can set it to pass an alternate
52 # version of wx-config or alternate flags,
53 # eg. as required by the .deb in-tree build.
55 # Some MSW build settings
57 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
58 # (0 or 1 only) should probably find a way to
61 HYBRID
= 0 # If set and not debug or FINAL, then build a
62 # hybrid extension that can be used by the
63 # non-debug version of python, but contains
64 # debugging symbols for wxWindows and wxPython.
65 # wxWindows must have been built with /MD, not /MDd
66 # (using FINAL=hybrid will do it.)
68 WXDLLVER
= '232' # Version part of DLL name
71 #----------------------------------------------------------------------
74 if __name__
== "__main__":
78 path
= apply(os
.path
.join
, args
)
79 return os
.path
.normpath(path
)
90 #----------------------------------------------------------------------
92 #----------------------------------------------------------------------
97 force
= '--force' in sys
.argv
or '-f' in sys
.argv
98 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
100 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
103 msg("Compiling wxPython by Borland C/C++ Compiler")
105 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
106 # Version part of BCPP build LIBRARY name
107 WXDLLVER
="" # no dll ver path avaible
110 #----------------------------------------------------------------------
111 # Check for build flags on the command line
112 #----------------------------------------------------------------------
114 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
115 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
116 'FINAL', 'HYBRID', ]:
117 for x
in range(len(sys
.argv
)):
118 if string
.find(sys
.argv
[x
], flag
) == 0:
119 pos
= string
.find(sys
.argv
[x
], '=') + 1
121 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
124 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
125 for x
in range(len(sys
.argv
)):
126 if string
.find(sys
.argv
[x
], option
) == 0:
127 pos
= string
.find(sys
.argv
[x
], '=') + 1
129 vars()[option
] = sys
.argv
[x
][pos
:]
132 sys
.argv
= filter(None, sys
.argv
)
141 #----------------------------------------------------------------------
142 # Setup some platform specific stuff
143 #----------------------------------------------------------------------
146 # Set compile flags and such for MSVC. These values are derived
147 # from the wxWindows makefiles for MSVC, others will probably
149 WXDIR
= os
.environ
['WXWIN']
161 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
162 opj(WXDIR
, 'include'),
165 defines
= [ ('WIN32', None), # Some of these are no longer
166 ('__WIN32__', None), # necessary. Anybody know which?
168 ('__WINDOWS__', None),
169 ('WINVER', '0x0400'),
176 ('SWIG_GLOBAL', None),
177 ('HAVE_CONFIG_H', None),
178 ('WXP_USE_THREAD', '1'),
181 if bcpp_compiling
: # overwrite it
184 ('WINVER', '0x0400'),
189 ('SWIG_GLOBAL', None),
190 ('HAVE_CONFIG_H', None),
191 ('WXP_USE_THREAD', '1'),
193 ('WXUSE_DEFINE','1'),
198 if not FINAL
or HYBRID
:
199 defines
.append( ('__WXDEBUG__', None) )
201 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
202 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
206 libs
= ['wx'+WXBCPPLIBVER
]
208 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
209 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
210 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
211 'advapi32', 'wsock32']
214 cflags
= [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines
218 if bcpp_compiling
: # overwrite it
219 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
220 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
221 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
222 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
226 if not FINAL
and HYBRID
and not bcpp_compiling
:
227 cflags
= cflags
+ ['/Od', '/Z7']
228 lflags
= ['/DEBUG', ]
230 elif bcpp_compiling
and not FINAL
:
231 cflags
= cflags
+ ['/Od', '/v', '/y']
232 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
236 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
237 # Flags and such for a Darwin (Max OS X) build of Python
239 WXDIR
= '..' # assumes IN_CVS_TREE
244 defines
= [('SWIG_GLOBAL', None),
245 ('HAVE_CONFIG_H', None),
246 ('WXP_USE_THREAD', '1'),
251 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
252 cflags
= string
.split(cflags
)
254 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
255 lflags
= string
.split(lflags
)
259 elif os
.name
== 'posix':
260 # Set flags for Unix type platforms
262 WXDIR
= '..' # assumes IN_CVS_TREE
263 WXPLAT
= '__WXGTK__' # and assumes GTK...
264 GENDIR
= 'gtk' # Need to allow for Motif eventually too
267 defines
= [('SWIG_GLOBAL', None),
268 ('HAVE_CONFIG_H', None),
269 ('WXP_USE_THREAD', '1'),
274 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
275 os
.popen('gtk-config --cflags', 'r').read()[:-1]
276 cflags
= string
.split(cflags
)
278 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
279 lflags
= string
.split(lflags
)
283 raise 'Sorry Charlie...'
286 #----------------------------------------------------------------------
287 # Check if the version file needs updated
288 #----------------------------------------------------------------------
290 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
291 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
295 #----------------------------------------------------------------------
297 #----------------------------------------------------------------------
300 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
303 #'-docstring', '-Sbefore',
304 '-I./src', '-D'+WXPLAT
,
306 swig_deps
= ['src/my_typemaps.i']
309 #----------------------------------------------------------------------
310 # Define the CORE extension module
311 #----------------------------------------------------------------------
314 msg('Preparing CORE...')
315 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
316 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
317 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
318 'printfw.i', 'sizers.i', 'clip_dnd.i',
319 'filesys.i', 'streams.i',
320 ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
323 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
324 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
326 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
327 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
330 if IN_CVS_TREE
: # update the licence files
332 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
333 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
337 rc_file
= ['src/wxc.rc']
342 ext
= Extension('wxc', ['src/helpers.cpp',
344 ] + rc_file
+ swig_sources
,
346 include_dirs
= includes
,
347 define_macros
= defines
,
349 library_dirs
= libdirs
,
352 extra_compile_args
= cflags
,
353 extra_link_args
= lflags
,
355 wxpExtensions
.append(ext
)
358 # Extension for the grid module
359 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
360 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
361 ext
= Extension('gridc', swig_sources
,
362 include_dirs
= includes
,
363 define_macros
= defines
,
364 library_dirs
= libdirs
,
366 extra_compile_args
= cflags
,
367 extra_link_args
= lflags
,
369 wxpExtensions
.append(ext
)
372 # Extension for the html modules
373 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
374 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
375 ext
= Extension('htmlc', swig_sources
,
376 include_dirs
= includes
,
377 define_macros
= defines
,
378 library_dirs
= libdirs
,
380 extra_compile_args
= cflags
,
381 extra_link_args
= lflags
,
383 wxpExtensions
.append(ext
)
386 # Extension for the utils module
387 swig_sources
= run_swig(['utils.i'], 'src', GENDIR
, PKGDIR
,
388 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
389 ext
= Extension('utilsc', swig_sources
,
390 include_dirs
= includes
,
391 define_macros
= defines
,
392 library_dirs
= libdirs
,
394 extra_compile_args
= cflags
,
395 extra_link_args
= lflags
,
397 wxpExtensions
.append(ext
)
400 # Extension for the calendar module
401 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
402 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
403 ext
= Extension('calendarc', swig_sources
,
404 include_dirs
= includes
,
405 define_macros
= defines
,
406 library_dirs
= libdirs
,
408 extra_compile_args
= cflags
,
409 extra_link_args
= lflags
,
411 wxpExtensions
.append(ext
)
414 # Extension for the help module
415 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
416 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
417 ext
= Extension('helpc', swig_sources
,
418 include_dirs
= includes
,
419 define_macros
= defines
,
420 library_dirs
= libdirs
,
422 extra_compile_args
= cflags
,
423 extra_link_args
= lflags
,
425 wxpExtensions
.append(ext
)
428 #----------------------------------------------------------------------
429 # Define the GLCanvas extension module
430 #----------------------------------------------------------------------
432 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
433 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
435 if BUILD_GLCANVAS
or GL_ONLY
:
436 msg('Preparing GLCANVAS...')
437 location
= 'contrib/glcanvas'
438 swig_files
= ['glcanvas.i']
441 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
442 USE_SWIG
, swig_force
, swig_args
)
445 if os
.name
== 'posix':
446 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
447 gl_lflags
= string
.split(gl_config
) + lflags
450 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
451 gl_libs
= libs
+ ['opengl32', 'glu32']
454 ext
= Extension('glcanvasc',
455 swig_sources
+ other_sources
,
457 include_dirs
= includes
,
458 define_macros
= defines
,
460 library_dirs
= libdirs
,
463 extra_compile_args
= cflags
,
464 extra_link_args
= gl_lflags
,
467 wxpExtensions
.append(ext
)
470 #----------------------------------------------------------------------
471 # Define the OGL extension module
472 #----------------------------------------------------------------------
474 if not GL_ONLY
and BUILD_OGL
:
475 msg('Preparing OGL...')
476 location
= 'contrib/ogl'
477 OGLLOC
= opj(location
, 'contrib/src/ogl')
478 OGLINC
= opj(location
, 'contrib/include')
480 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
483 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
484 USE_SWIG
, swig_force
, swig_args
)
487 # make sure local copy of contrib files are up to date
488 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
489 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
491 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
492 '%s/bmpshape.cpp' % OGLLOC
,
493 '%s/composit.cpp' % OGLLOC
,
494 '%s/divided.cpp' % OGLLOC
,
495 '%s/lines.cpp' % OGLLOC
,
496 '%s/misc.cpp' % OGLLOC
,
497 '%s/basic2.cpp' % OGLLOC
,
498 '%s/canvas.cpp' % OGLLOC
,
499 '%s/constrnt.cpp' % OGLLOC
,
500 '%s/drawn.cpp' % OGLLOC
,
501 '%s/mfutils.cpp' % OGLLOC
,
502 '%s/ogldiag.cpp' % OGLLOC
,
505 include_dirs
= [OGLINC
] + includes
,
506 define_macros
= defines
,
508 library_dirs
= libdirs
,
511 extra_compile_args
= cflags
,
512 extra_link_args
= lflags
,
515 wxpExtensions
.append(ext
)
519 #----------------------------------------------------------------------
520 # Define the STC extension module
521 #----------------------------------------------------------------------
523 if not GL_ONLY
and BUILD_STC
:
524 msg('Preparing STC...')
525 location
= 'contrib/stc'
526 STCLOC
= opj(location
, 'contrib/src/stc')
527 STCINC
= opj(location
, 'contrib/include')
528 STC_H
= opj(location
, 'contrib/include/wx/stc')
531 # Check if gen_iface needs to be run for the wxSTC sources
532 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
533 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
534 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
536 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
538 os
.chdir(opj(CTRB_SRC
, 'stc'))
544 # make sure local copy of contrib files are up to date
545 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
546 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
550 swig_files
= ['stc_.i']
551 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
552 USE_SWIG
, swig_force
,
553 swig_args
+ ['-I'+STC_H
, '-I'+location
],
554 [opj(STC_H
, 'stc.h')])
556 # copy a project specific py module to the main package dir
557 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
559 # add some include dirs to the standard set
560 stc_includes
= includes
[:]
561 stc_includes
.append('%s/scintilla/include' % STCLOC
)
562 stc_includes
.append('%s/scintilla/src' % STCLOC
)
563 stc_includes
.append(STCINC
)
565 # and some macro definitions
566 stc_defines
= defines
[:]
567 stc_defines
.append( ('__WX__', None) )
568 stc_defines
.append( ('SCI_LEXER', None) )
571 ext
= Extension('stc_c',
572 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
573 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
574 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
575 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
576 '%s/scintilla/src/Document.cxx' % STCLOC
,
577 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
578 '%s/scintilla/src/Editor.cxx' % STCLOC
,
579 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
580 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
581 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
582 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
583 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
584 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
585 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
586 '%s/scintilla/src/Style.cxx' % STCLOC
,
587 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
588 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
589 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
590 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
592 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
593 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
594 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
595 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
596 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
597 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
598 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
599 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
600 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
601 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
602 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
603 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
604 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
605 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
606 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
607 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
609 '%s/PlatWX.cpp' % STCLOC
,
610 '%s/ScintillaWX.cpp' % STCLOC
,
611 '%s/stc.cpp' % STCLOC
,
614 include_dirs
= stc_includes
,
615 define_macros
= stc_defines
,
617 library_dirs
= libdirs
,
620 extra_compile_args
= cflags
,
621 extra_link_args
= lflags
,
624 wxpExtensions
.append(ext
)
628 #----------------------------------------------------------------------
629 # Define the IEWIN extension module (experimental)
630 #----------------------------------------------------------------------
632 if not GL_ONLY
and BUILD_IEWIN
:
633 msg('Preparing IEWIN...')
634 location
= 'contrib/iewin'
636 swig_files
= ['iewin.i', ]
638 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
639 USE_SWIG
, swig_force
, swig_args
)
642 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
645 include_dirs
= includes
,
646 define_macros
= defines
,
648 library_dirs
= libdirs
,
651 extra_compile_args
= cflags
,
652 extra_link_args
= lflags
,
655 wxpExtensions
.append(ext
)
658 #----------------------------------------------------------------------
659 # Define the XRC extension module
660 #----------------------------------------------------------------------
662 if not GL_ONLY
and BUILD_XRC
:
663 msg('Preparing XRC...')
664 location
= 'contrib/xrc'
665 XMLLOC
= opj(location
, 'contrib/src/xrc')
666 XMLINC
= opj(location
, 'contrib/include')
668 swig_files
= ['xrc.i']
670 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
671 USE_SWIG
, swig_force
, swig_args
)
673 xmlres_includes
= includes
[:]
674 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
675 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
676 xmlres_includes
.append(XMLINC
)
679 # make sure local copy of contrib files are up to date
681 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
682 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
684 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
685 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
686 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
688 '%s/xh_bmp.cpp' % XMLLOC
,
689 '%s/xh_bmpbt.cpp' % XMLLOC
,
690 '%s/xh_bttn.cpp' % XMLLOC
,
691 '%s/xh_cald.cpp' % XMLLOC
,
692 '%s/xh_chckb.cpp' % XMLLOC
,
694 '%s/xh_chckl.cpp' % XMLLOC
,
695 '%s/xh_choic.cpp' % XMLLOC
,
696 '%s/xh_combo.cpp' % XMLLOC
,
697 '%s/xh_dlg.cpp' % XMLLOC
,
698 '%s/xh_frame.cpp' % XMLLOC
,
700 '%s/xh_gauge.cpp' % XMLLOC
,
701 '%s/xh_html.cpp' % XMLLOC
,
702 '%s/xh_listb.cpp' % XMLLOC
,
703 '%s/xh_listc.cpp' % XMLLOC
,
704 '%s/xh_menu.cpp' % XMLLOC
,
706 '%s/xh_notbk.cpp' % XMLLOC
,
707 '%s/xh_panel.cpp' % XMLLOC
,
708 '%s/xh_radbt.cpp' % XMLLOC
,
709 '%s/xh_radbx.cpp' % XMLLOC
,
710 '%s/xh_scrol.cpp' % XMLLOC
,
712 '%s/xh_sizer.cpp' % XMLLOC
,
713 '%s/xh_slidr.cpp' % XMLLOC
,
714 '%s/xh_spin.cpp' % XMLLOC
,
715 '%s/xh_stbmp.cpp' % XMLLOC
,
716 '%s/xh_stbox.cpp' % XMLLOC
,
718 '%s/xh_stlin.cpp' % XMLLOC
,
719 '%s/xh_sttxt.cpp' % XMLLOC
,
720 '%s/xh_text.cpp' % XMLLOC
,
721 '%s/xh_toolb.cpp' % XMLLOC
,
722 '%s/xh_tree.cpp' % XMLLOC
,
724 '%s/xh_unkwn.cpp' % XMLLOC
,
725 '%s/xml.cpp' % XMLLOC
,
726 '%s/xmlbin.cpp' % XMLLOC
,
727 '%s/xmlbinz.cpp' % XMLLOC
,
728 '%s/xmlexpat.cpp' % XMLLOC
,
730 '%s/xmlres.cpp' % XMLLOC
,
731 '%s/xmlrsall.cpp' % XMLLOC
,
732 '%s/xmlwrite.cpp' % XMLLOC
,
736 include_dirs
= xmlres_includes
,
737 define_macros
= defines
,
739 library_dirs
= libdirs
,
742 extra_compile_args
= cflags
,
743 extra_link_args
= lflags
,
746 wxpExtensions
.append(ext
)
750 #----------------------------------------------------------------------
751 # Define the GIZMOS extension module
752 #----------------------------------------------------------------------
754 if not GL_ONLY
and BUILD_GIZMOS
:
755 msg('Preparing GIZMOS...')
756 location
= 'contrib/gizmos'
757 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
758 GIZMOINC
= opj(location
, 'contrib/include')
760 swig_files
= ['gizmos.i']
762 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
763 USE_SWIG
, swig_force
, swig_args
)
765 gizmos_includes
= includes
[:]
766 gizmos_includes
.append(GIZMOINC
)
769 # make sure local copy of contrib files are up to date
771 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
772 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
774 ext
= Extension('gizmosc', [
775 '%s/dynamicsash.cpp' % GIZMOLOC
,
776 '%s/editlbox.cpp' % GIZMOLOC
,
777 '%s/multicell.cpp' % GIZMOLOC
,
778 '%s/splittree.cpp' % GIZMOLOC
,
781 include_dirs
= gizmos_includes
,
782 define_macros
= defines
,
784 library_dirs
= libdirs
,
787 extra_compile_args
= cflags
,
788 extra_link_args
= lflags
,
791 wxpExtensions
.append(ext
)
796 #----------------------------------------------------------------------
797 # Do the Setup/Build/Install/Whatever
798 #----------------------------------------------------------------------
800 if __name__
== "__main__":
804 description
= DESCRIPTION
,
805 long_description
= LONG_DESCRIPTION
,
807 author_email
= AUTHOR_EMAIL
,
813 PKGDIR
+'.lib.editor',
817 ext_package
= PKGDIR
,
818 ext_modules
= wxpExtensions
,
823 setup(name
= "wxPython-gl",
825 description
= "wxGLCanvas class for wxPython",
827 author_email
= AUTHOR_EMAIL
,
831 py_modules
= [ "wxPython.glcanvas" ],
833 ext_package
= PKGDIR
,
834 ext_modules
= wxpExtensions
,
840 #----------------------------------------------------------------------
841 #----------------------------------------------------------------------