]>
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_XRC
= 1 # XML based resource system
35 BUILD_GIZMOS
= 1 # Build a module for the gizmos contrib library
37 BUILD_IEWIN
= 0 # Internet Explorer wrapper (experimental)
40 CORE_ONLY
= 0 # if true, don't build any of the above
41 GL_ONLY
= 0 # Only used when making the -gl RPM. See the "b" script
42 # for the ugly details
44 USE_SWIG
= 0 # Should we actually execute SWIG, or just use the
45 # files already in the distribution?
47 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
48 # tree, otherwise will assume all needed files are
49 # available in the wxPython source distribution
51 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
52 # but you can set it to pass an alternate
53 # version of wx-config or alternate flags,
54 # eg. as required by the .deb in-tree build.
56 # Some MSW build settings
58 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
59 # (0 or 1 only) should probably find a way to
62 HYBRID
= 0 # If set and not debug or FINAL, then build a
63 # hybrid extension that can be used by the
64 # non-debug version of python, but contains
65 # debugging symbols for wxWindows and wxPython.
66 # wxWindows must have been built with /MD, not /MDd
67 # (using FINAL=hybrid will do it.)
69 WXDLLVER
= '232' # Version part of DLL name
72 #----------------------------------------------------------------------
75 if __name__
== "__main__":
79 path
= apply(os
.path
.join
, args
)
80 return os
.path
.normpath(path
)
91 #----------------------------------------------------------------------
93 #----------------------------------------------------------------------
98 force
= '--force' in sys
.argv
or '-f' in sys
.argv
99 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
101 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
104 msg("Compiling wxPython by Borland C/C++ Compiler")
106 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
107 # Version part of BCPP build LIBRARY name
108 WXDLLVER
="" # no dll ver path avaible
111 #----------------------------------------------------------------------
112 # Check for build flags on the command line
113 #----------------------------------------------------------------------
115 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
116 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
117 'FINAL', 'HYBRID', ]:
118 for x
in range(len(sys
.argv
)):
119 if string
.find(sys
.argv
[x
], flag
) == 0:
120 pos
= string
.find(sys
.argv
[x
], '=') + 1
122 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
125 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
126 for x
in range(len(sys
.argv
)):
127 if string
.find(sys
.argv
[x
], option
) == 0:
128 pos
= string
.find(sys
.argv
[x
], '=') + 1
130 vars()[option
] = sys
.argv
[x
][pos
:]
133 sys
.argv
= filter(None, sys
.argv
)
142 #----------------------------------------------------------------------
143 # Setup some platform specific stuff
144 #----------------------------------------------------------------------
147 # Set compile flags and such for MSVC. These values are derived
148 # from the wxWindows makefiles for MSVC, others will probably
150 WXDIR
= os
.environ
['WXWIN']
162 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
163 opj(WXDIR
, 'include'),
166 defines
= [ ('WIN32', None), # Some of these are no longer
167 ('__WIN32__', None), # necessary. Anybody know which?
169 ('__WINDOWS__', None),
170 ('WINVER', '0x0400'),
177 ('SWIG_GLOBAL', None),
178 ('HAVE_CONFIG_H', None),
179 ('WXP_USE_THREAD', '1'),
182 if bcpp_compiling
: # overwrite it
185 ('WINVER', '0x0400'),
190 ('SWIG_GLOBAL', None),
191 ('HAVE_CONFIG_H', None),
192 ('WXP_USE_THREAD', '1'),
194 ('WXUSE_DEFINE','1'),
199 if not FINAL
or HYBRID
:
200 defines
.append( ('__WXDEBUG__', None) )
202 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
203 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
207 libs
= ['wx'+WXBCPPLIBVER
]
209 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
210 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
211 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
212 'advapi32', 'wsock32']
215 cflags
= [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines
219 if bcpp_compiling
: # overwrite it
220 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
221 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
222 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
223 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
227 if not FINAL
and HYBRID
and not bcpp_compiling
:
228 cflags
= cflags
+ ['/Od', '/Z7']
229 lflags
= ['/DEBUG', ]
231 elif bcpp_compiling
and not FINAL
:
232 cflags
= cflags
+ ['/Od', '/v', '/y']
233 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
237 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
238 # Flags and such for a Darwin (Max OS X) build of Python
240 WXDIR
= '..' # assumes IN_CVS_TREE
245 defines
= [('SWIG_GLOBAL', None),
246 ('HAVE_CONFIG_H', None),
247 ('WXP_USE_THREAD', '1'),
252 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
253 cflags
= string
.split(cflags
)
255 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
256 lflags
= string
.split(lflags
)
260 elif os
.name
== 'posix':
261 # Set flags for Unix type platforms
263 WXDIR
= '..' # assumes IN_CVS_TREE
264 WXPLAT
= '__WXGTK__' # and assumes GTK...
265 GENDIR
= 'gtk' # Need to allow for Motif eventually too
268 defines
= [('SWIG_GLOBAL', None),
269 ('HAVE_CONFIG_H', None),
270 ('WXP_USE_THREAD', '1'),
275 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
276 os
.popen('gtk-config --cflags', 'r').read()[:-1]
277 cflags
= string
.split(cflags
)
279 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
280 lflags
= string
.split(lflags
)
284 raise 'Sorry Charlie...'
287 #----------------------------------------------------------------------
288 # Check if the version file needs updated
289 #----------------------------------------------------------------------
291 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
292 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
296 #----------------------------------------------------------------------
298 #----------------------------------------------------------------------
301 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
304 #'-docstring', '-Sbefore',
305 '-I./src', '-D'+WXPLAT
,
307 swig_deps
= ['src/my_typemaps.i']
310 #----------------------------------------------------------------------
311 # Define the CORE extension module
312 #----------------------------------------------------------------------
315 msg('Preparing CORE...')
316 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
317 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
318 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
319 'printfw.i', 'sizers.i', 'clip_dnd.i',
320 'filesys.i', 'streams.i',
321 ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
324 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
325 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
327 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
328 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
331 if IN_CVS_TREE
: # update the licence files
333 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
334 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
338 rc_file
= ['src/wxc.rc']
343 ext
= Extension('wxc', ['src/helpers.cpp',
345 ] + rc_file
+ swig_sources
,
347 include_dirs
= includes
,
348 define_macros
= defines
,
350 library_dirs
= libdirs
,
353 extra_compile_args
= cflags
,
354 extra_link_args
= lflags
,
356 wxpExtensions
.append(ext
)
359 # Extension for the grid module
360 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
361 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
362 ext
= Extension('gridc', swig_sources
,
363 include_dirs
= includes
,
364 define_macros
= defines
,
365 library_dirs
= libdirs
,
367 extra_compile_args
= cflags
,
368 extra_link_args
= lflags
,
370 wxpExtensions
.append(ext
)
373 # Extension for the html modules
374 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
375 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
376 ext
= Extension('htmlc', swig_sources
,
377 include_dirs
= includes
,
378 define_macros
= defines
,
379 library_dirs
= libdirs
,
381 extra_compile_args
= cflags
,
382 extra_link_args
= lflags
,
384 wxpExtensions
.append(ext
)
387 # Extension for the utils module
388 swig_sources
= run_swig(['utils.i'], 'src', GENDIR
, PKGDIR
,
389 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
390 ext
= Extension('utilsc', swig_sources
,
391 include_dirs
= includes
,
392 define_macros
= defines
,
393 library_dirs
= libdirs
,
395 extra_compile_args
= cflags
,
396 extra_link_args
= lflags
,
398 wxpExtensions
.append(ext
)
401 # Extension for the calendar module
402 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
403 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
404 ext
= Extension('calendarc', swig_sources
,
405 include_dirs
= includes
,
406 define_macros
= defines
,
407 library_dirs
= libdirs
,
409 extra_compile_args
= cflags
,
410 extra_link_args
= lflags
,
412 wxpExtensions
.append(ext
)
415 # Extension for the help module
416 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
417 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
418 ext
= Extension('helpc', swig_sources
,
419 include_dirs
= includes
,
420 define_macros
= defines
,
421 library_dirs
= libdirs
,
423 extra_compile_args
= cflags
,
424 extra_link_args
= lflags
,
426 wxpExtensions
.append(ext
)
429 #----------------------------------------------------------------------
430 # Define the GLCanvas extension module
431 #----------------------------------------------------------------------
433 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
434 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
436 if BUILD_GLCANVAS
or GL_ONLY
:
437 msg('Preparing GLCANVAS...')
438 location
= 'contrib/glcanvas'
439 swig_files
= ['glcanvas.i']
442 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
443 USE_SWIG
, swig_force
, swig_args
)
446 if os
.name
== 'posix':
447 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
448 gl_lflags
= string
.split(gl_config
) + lflags
451 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
452 gl_libs
= libs
+ ['opengl32', 'glu32']
455 ext
= Extension('glcanvasc',
456 swig_sources
+ other_sources
,
458 include_dirs
= includes
,
459 define_macros
= defines
,
461 library_dirs
= libdirs
,
464 extra_compile_args
= cflags
,
465 extra_link_args
= gl_lflags
,
468 wxpExtensions
.append(ext
)
471 #----------------------------------------------------------------------
472 # Define the OGL extension module
473 #----------------------------------------------------------------------
475 if not GL_ONLY
and BUILD_OGL
:
476 msg('Preparing OGL...')
477 location
= 'contrib/ogl'
478 OGLLOC
= opj(location
, 'contrib/src/ogl')
479 OGLINC
= opj(location
, 'contrib/include')
481 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
484 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
485 USE_SWIG
, swig_force
, swig_args
)
488 # make sure local copy of contrib files are up to date
489 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
490 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
492 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
493 '%s/bmpshape.cpp' % OGLLOC
,
494 '%s/composit.cpp' % OGLLOC
,
495 '%s/divided.cpp' % OGLLOC
,
496 '%s/lines.cpp' % OGLLOC
,
497 '%s/misc.cpp' % OGLLOC
,
498 '%s/basic2.cpp' % OGLLOC
,
499 '%s/canvas.cpp' % OGLLOC
,
500 '%s/constrnt.cpp' % OGLLOC
,
501 '%s/drawn.cpp' % OGLLOC
,
502 '%s/mfutils.cpp' % OGLLOC
,
503 '%s/ogldiag.cpp' % OGLLOC
,
506 include_dirs
= [OGLINC
] + includes
,
507 define_macros
= defines
,
509 library_dirs
= libdirs
,
512 extra_compile_args
= cflags
,
513 extra_link_args
= lflags
,
516 wxpExtensions
.append(ext
)
520 #----------------------------------------------------------------------
521 # Define the STC extension module
522 #----------------------------------------------------------------------
524 if not GL_ONLY
and BUILD_STC
:
525 msg('Preparing STC...')
526 location
= 'contrib/stc'
527 STCLOC
= opj(location
, 'contrib/src/stc')
528 STCINC
= opj(location
, 'contrib/include')
529 STC_H
= opj(location
, 'contrib/include/wx/stc')
532 # Check if gen_iface needs to be run for the wxSTC sources
533 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
534 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
535 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
537 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
539 os
.chdir(opj(CTRB_SRC
, 'stc'))
545 # make sure local copy of contrib files are up to date
546 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
547 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
551 swig_files
= ['stc_.i']
552 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
553 USE_SWIG
, swig_force
,
554 swig_args
+ ['-I'+STC_H
, '-I'+location
],
555 [opj(STC_H
, 'stc.h')])
557 # copy a project specific py module to the main package dir
558 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
560 # add some include dirs to the standard set
561 stc_includes
= includes
[:]
562 stc_includes
.append('%s/scintilla/include' % STCLOC
)
563 stc_includes
.append('%s/scintilla/src' % STCLOC
)
564 stc_includes
.append(STCINC
)
566 # and some macro definitions
567 stc_defines
= defines
[:]
568 stc_defines
.append( ('__WX__', None) )
569 stc_defines
.append( ('SCI_LEXER', None) )
572 ext
= Extension('stc_c',
573 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
574 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
575 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
576 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
577 '%s/scintilla/src/Document.cxx' % STCLOC
,
578 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
579 '%s/scintilla/src/Editor.cxx' % STCLOC
,
580 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
581 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
582 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
583 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
584 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
585 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
586 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
587 '%s/scintilla/src/Style.cxx' % STCLOC
,
588 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
589 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
590 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
591 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
593 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
594 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
595 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
596 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
597 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
598 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
599 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
600 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
601 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
602 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
603 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
604 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
605 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
606 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
607 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
608 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
610 '%s/PlatWX.cpp' % STCLOC
,
611 '%s/ScintillaWX.cpp' % STCLOC
,
612 '%s/stc.cpp' % STCLOC
,
615 include_dirs
= stc_includes
,
616 define_macros
= stc_defines
,
618 library_dirs
= libdirs
,
621 extra_compile_args
= cflags
,
622 extra_link_args
= lflags
,
625 wxpExtensions
.append(ext
)
629 #----------------------------------------------------------------------
630 # Define the IEWIN extension module (experimental)
631 #----------------------------------------------------------------------
633 if not GL_ONLY
and BUILD_IEWIN
:
634 msg('Preparing IEWIN...')
635 location
= 'contrib/iewin'
637 swig_files
= ['iewin.i', ]
639 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
640 USE_SWIG
, swig_force
, swig_args
)
643 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
646 include_dirs
= includes
,
647 define_macros
= defines
,
649 library_dirs
= libdirs
,
652 extra_compile_args
= cflags
,
653 extra_link_args
= lflags
,
656 wxpExtensions
.append(ext
)
659 #----------------------------------------------------------------------
660 # Define the XRC extension module
661 #----------------------------------------------------------------------
663 if not GL_ONLY
and BUILD_XRC
:
664 msg('Preparing XRC...')
665 location
= 'contrib/xrc'
666 XMLLOC
= opj(location
, 'contrib/src/xrc')
667 XMLINC
= opj(location
, 'contrib/include')
669 swig_files
= ['xrc.i']
671 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
672 USE_SWIG
, swig_force
, swig_args
)
674 xmlres_includes
= includes
[:]
675 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
676 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
677 xmlres_includes
.append(XMLINC
)
680 # make sure local copy of contrib files are up to date
682 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
683 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
685 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
686 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
687 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
689 '%s/xh_bmp.cpp' % XMLLOC
,
690 '%s/xh_bmpbt.cpp' % XMLLOC
,
691 '%s/xh_bttn.cpp' % XMLLOC
,
692 '%s/xh_cald.cpp' % XMLLOC
,
693 '%s/xh_chckb.cpp' % XMLLOC
,
695 '%s/xh_chckl.cpp' % XMLLOC
,
696 '%s/xh_choic.cpp' % XMLLOC
,
697 '%s/xh_combo.cpp' % XMLLOC
,
698 '%s/xh_dlg.cpp' % XMLLOC
,
699 '%s/xh_frame.cpp' % XMLLOC
,
701 '%s/xh_gauge.cpp' % XMLLOC
,
702 '%s/xh_html.cpp' % XMLLOC
,
703 '%s/xh_listb.cpp' % XMLLOC
,
704 '%s/xh_listc.cpp' % XMLLOC
,
705 '%s/xh_menu.cpp' % XMLLOC
,
707 '%s/xh_notbk.cpp' % XMLLOC
,
708 '%s/xh_panel.cpp' % XMLLOC
,
709 '%s/xh_radbt.cpp' % XMLLOC
,
710 '%s/xh_radbx.cpp' % XMLLOC
,
711 '%s/xh_scrol.cpp' % XMLLOC
,
713 '%s/xh_sizer.cpp' % XMLLOC
,
714 '%s/xh_slidr.cpp' % XMLLOC
,
715 '%s/xh_spin.cpp' % XMLLOC
,
716 '%s/xh_stbmp.cpp' % XMLLOC
,
717 '%s/xh_stbox.cpp' % XMLLOC
,
719 '%s/xh_stlin.cpp' % XMLLOC
,
720 '%s/xh_sttxt.cpp' % XMLLOC
,
721 '%s/xh_text.cpp' % XMLLOC
,
722 '%s/xh_toolb.cpp' % XMLLOC
,
723 '%s/xh_tree.cpp' % XMLLOC
,
725 '%s/xh_unkwn.cpp' % XMLLOC
,
726 '%s/xml.cpp' % XMLLOC
,
727 '%s/xmlbin.cpp' % XMLLOC
,
728 '%s/xmlbinz.cpp' % XMLLOC
,
729 '%s/xmlexpat.cpp' % XMLLOC
,
731 '%s/xmlres.cpp' % XMLLOC
,
732 '%s/xmlrsall.cpp' % XMLLOC
,
733 '%s/xmlwrite.cpp' % XMLLOC
,
737 include_dirs
= xmlres_includes
,
738 define_macros
= defines
,
740 library_dirs
= libdirs
,
743 extra_compile_args
= cflags
,
744 extra_link_args
= lflags
,
747 wxpExtensions
.append(ext
)
751 #----------------------------------------------------------------------
752 # Define the GIZMOS extension module
753 #----------------------------------------------------------------------
755 if not GL_ONLY
and BUILD_GIZMOS
:
756 msg('Preparing GIZMOS...')
757 location
= 'contrib/gizmos'
758 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
759 GIZMOINC
= opj(location
, 'contrib/include')
761 swig_files
= ['gizmos.i']
763 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
764 USE_SWIG
, swig_force
, swig_args
)
766 gizmos_includes
= includes
[:]
767 gizmos_includes
.append(GIZMOINC
)
770 # make sure local copy of contrib files are up to date
772 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
773 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
775 ext
= Extension('gizmosc', [
776 '%s/dynamicsash.cpp' % GIZMOLOC
,
777 '%s/editlbox.cpp' % GIZMOLOC
,
778 '%s/multicell.cpp' % GIZMOLOC
,
779 '%s/splittree.cpp' % GIZMOLOC
,
782 include_dirs
= gizmos_includes
,
783 define_macros
= defines
,
785 library_dirs
= libdirs
,
788 extra_compile_args
= cflags
,
789 extra_link_args
= lflags
,
792 wxpExtensions
.append(ext
)
797 #----------------------------------------------------------------------
798 # Do the Setup/Build/Install/Whatever
799 #----------------------------------------------------------------------
801 if __name__
== "__main__":
805 description
= DESCRIPTION
,
806 long_description
= LONG_DESCRIPTION
,
808 author_email
= AUTHOR_EMAIL
,
814 PKGDIR
+'.lib.editor',
818 ext_package
= PKGDIR
,
819 ext_modules
= wxpExtensions
,
824 setup(name
= "wxPython-gl",
826 description
= "wxGLCanvas class for wxPython",
828 author_email
= AUTHOR_EMAIL
,
832 py_modules
= [ "wxPython.glcanvas" ],
834 ext_package
= PKGDIR
,
835 ext_modules
= wxpExtensions
,
841 #----------------------------------------------------------------------
842 #----------------------------------------------------------------------