]>
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
= '233' # 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', 'utils.i'
329 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
330 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
332 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
333 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
336 if IN_CVS_TREE
: # update the licence files
338 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
339 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
343 rc_file
= ['src/wxc.rc']
348 ext
= Extension('wxc', ['src/helpers.cpp',
350 ] + rc_file
+ swig_sources
,
352 include_dirs
= includes
,
353 define_macros
= defines
,
355 library_dirs
= libdirs
,
358 extra_compile_args
= cflags
,
359 extra_link_args
= lflags
,
361 wxpExtensions
.append(ext
)
364 # Extension for the grid module
365 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
366 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
367 ext
= Extension('gridc', swig_sources
,
368 include_dirs
= includes
,
369 define_macros
= defines
,
370 library_dirs
= libdirs
,
372 extra_compile_args
= cflags
,
373 extra_link_args
= lflags
,
375 wxpExtensions
.append(ext
)
378 # Extension for the html modules
379 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
380 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
381 ext
= Extension('htmlc', swig_sources
,
382 include_dirs
= includes
,
383 define_macros
= defines
,
384 library_dirs
= libdirs
,
386 extra_compile_args
= cflags
,
387 extra_link_args
= lflags
,
389 wxpExtensions
.append(ext
)
392 # Extension for the calendar module
393 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
394 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
395 ext
= Extension('calendarc', swig_sources
,
396 include_dirs
= includes
,
397 define_macros
= defines
,
398 library_dirs
= libdirs
,
400 extra_compile_args
= cflags
,
401 extra_link_args
= lflags
,
403 wxpExtensions
.append(ext
)
406 # Extension for the help module
407 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
408 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
409 ext
= Extension('helpc', swig_sources
,
410 include_dirs
= includes
,
411 define_macros
= defines
,
412 library_dirs
= libdirs
,
414 extra_compile_args
= cflags
,
415 extra_link_args
= lflags
,
417 wxpExtensions
.append(ext
)
420 #----------------------------------------------------------------------
421 # Define the GLCanvas extension module
422 #----------------------------------------------------------------------
424 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
425 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
427 if BUILD_GLCANVAS
or GL_ONLY
:
428 msg('Preparing GLCANVAS...')
429 location
= 'contrib/glcanvas'
430 swig_files
= ['glcanvas.i']
433 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
434 USE_SWIG
, swig_force
, swig_args
)
437 if os
.name
== 'posix':
438 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
439 gl_lflags
= string
.split(gl_config
) + lflags
442 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
443 gl_libs
= libs
+ ['opengl32', 'glu32']
446 ext
= Extension('glcanvasc',
447 swig_sources
+ other_sources
,
449 include_dirs
= includes
,
450 define_macros
= defines
,
452 library_dirs
= libdirs
,
455 extra_compile_args
= cflags
,
456 extra_link_args
= gl_lflags
,
459 wxpExtensions
.append(ext
)
462 #----------------------------------------------------------------------
463 # Define the OGL extension module
464 #----------------------------------------------------------------------
466 if not GL_ONLY
and BUILD_OGL
:
467 msg('Preparing OGL...')
468 location
= 'contrib/ogl'
469 OGLLOC
= opj(location
, 'contrib/src/ogl')
470 OGLINC
= opj(location
, 'contrib/include')
472 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
475 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
476 USE_SWIG
, swig_force
, swig_args
)
479 # make sure local copy of contrib files are up to date
480 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
481 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
483 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
484 '%s/bmpshape.cpp' % OGLLOC
,
485 '%s/composit.cpp' % OGLLOC
,
486 '%s/divided.cpp' % OGLLOC
,
487 '%s/lines.cpp' % OGLLOC
,
488 '%s/misc.cpp' % OGLLOC
,
489 '%s/basic2.cpp' % OGLLOC
,
490 '%s/canvas.cpp' % OGLLOC
,
491 '%s/constrnt.cpp' % OGLLOC
,
492 '%s/drawn.cpp' % OGLLOC
,
493 '%s/mfutils.cpp' % OGLLOC
,
494 '%s/ogldiag.cpp' % OGLLOC
,
497 include_dirs
= [OGLINC
] + includes
,
498 define_macros
= defines
,
500 library_dirs
= libdirs
,
503 extra_compile_args
= cflags
,
504 extra_link_args
= lflags
,
507 wxpExtensions
.append(ext
)
511 #----------------------------------------------------------------------
512 # Define the STC extension module
513 #----------------------------------------------------------------------
515 if not GL_ONLY
and BUILD_STC
:
516 msg('Preparing STC...')
517 location
= 'contrib/stc'
518 STCLOC
= opj(location
, 'contrib/src/stc')
519 STCINC
= opj(location
, 'contrib/include')
520 STC_H
= opj(location
, 'contrib/include/wx/stc')
523 # Check if gen_iface needs to be run for the wxSTC sources
524 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
525 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
526 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
528 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
530 os
.chdir(opj(CTRB_SRC
, 'stc'))
536 # make sure local copy of contrib files are up to date
537 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
538 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
542 swig_files
= ['stc_.i']
543 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
544 USE_SWIG
, swig_force
,
545 swig_args
+ ['-I'+STC_H
, '-I'+location
],
546 [opj(STC_H
, 'stc.h')])
548 # copy a contrib project specific py module to the main package dir
549 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
551 # add some include dirs to the standard set
552 stc_includes
= includes
[:]
553 stc_includes
.append('%s/scintilla/include' % STCLOC
)
554 stc_includes
.append('%s/scintilla/src' % STCLOC
)
555 stc_includes
.append(STCINC
)
557 # and some macro definitions
558 stc_defines
= defines
[:]
559 stc_defines
.append( ('__WX__', None) )
560 stc_defines
.append( ('SCI_LEXER', None) )
563 ext
= Extension('stc_c',
564 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
565 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
566 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
567 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
568 '%s/scintilla/src/Document.cxx' % STCLOC
,
569 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
570 '%s/scintilla/src/Editor.cxx' % STCLOC
,
571 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
572 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
573 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
574 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
575 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
576 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
577 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
578 '%s/scintilla/src/Style.cxx' % STCLOC
,
579 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
580 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
581 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
582 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
584 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
585 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
586 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
587 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
588 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
589 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
590 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
591 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
592 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
593 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
594 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
595 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
596 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
597 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
598 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
599 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
601 '%s/PlatWX.cpp' % STCLOC
,
602 '%s/ScintillaWX.cpp' % STCLOC
,
603 '%s/stc.cpp' % STCLOC
,
606 include_dirs
= stc_includes
,
607 define_macros
= stc_defines
,
609 library_dirs
= libdirs
,
612 extra_compile_args
= cflags
,
613 extra_link_args
= lflags
,
616 wxpExtensions
.append(ext
)
620 #----------------------------------------------------------------------
621 # Define the IEWIN extension module (experimental)
622 #----------------------------------------------------------------------
624 if not GL_ONLY
and BUILD_IEWIN
:
625 msg('Preparing IEWIN...')
626 location
= 'contrib/iewin'
628 swig_files
= ['iewin.i', ]
630 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
631 USE_SWIG
, swig_force
, swig_args
)
634 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
637 include_dirs
= includes
,
638 define_macros
= defines
,
640 library_dirs
= libdirs
,
643 extra_compile_args
= cflags
,
644 extra_link_args
= lflags
,
647 wxpExtensions
.append(ext
)
650 #----------------------------------------------------------------------
651 # Define the XRC extension module
652 #----------------------------------------------------------------------
654 if not GL_ONLY
and BUILD_XRC
:
655 msg('Preparing XRC...')
656 location
= 'contrib/xrc'
657 XMLLOC
= opj(location
, 'contrib/src/xrc')
658 XMLINC
= opj(location
, 'contrib/include')
660 swig_files
= ['xrc.i']
662 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
663 USE_SWIG
, swig_force
, swig_args
)
665 xmlres_includes
= includes
[:]
666 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
667 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
668 xmlres_includes
.append(XMLINC
)
671 # make sure local copy of contrib files are up to date
673 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
674 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
676 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
677 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
678 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
680 '%s/xh_bmp.cpp' % XMLLOC
,
681 '%s/xh_bmpbt.cpp' % XMLLOC
,
682 '%s/xh_bttn.cpp' % XMLLOC
,
683 '%s/xh_cald.cpp' % XMLLOC
,
684 '%s/xh_chckb.cpp' % XMLLOC
,
686 '%s/xh_chckl.cpp' % XMLLOC
,
687 '%s/xh_choic.cpp' % XMLLOC
,
688 '%s/xh_combo.cpp' % XMLLOC
,
689 '%s/xh_dlg.cpp' % XMLLOC
,
690 '%s/xh_frame.cpp' % XMLLOC
,
692 '%s/xh_gauge.cpp' % XMLLOC
,
693 '%s/xh_gdctl.cpp' % XMLLOC
,
694 '%s/xh_html.cpp' % XMLLOC
,
695 '%s/xh_listb.cpp' % XMLLOC
,
696 '%s/xh_listc.cpp' % XMLLOC
,
697 '%s/xh_menu.cpp' % XMLLOC
,
699 '%s/xh_notbk.cpp' % XMLLOC
,
700 '%s/xh_panel.cpp' % XMLLOC
,
701 '%s/xh_radbt.cpp' % XMLLOC
,
702 '%s/xh_radbx.cpp' % XMLLOC
,
703 '%s/xh_scrol.cpp' % XMLLOC
,
705 '%s/xh_sizer.cpp' % XMLLOC
,
706 '%s/xh_slidr.cpp' % XMLLOC
,
707 '%s/xh_spin.cpp' % XMLLOC
,
708 '%s/xh_stbmp.cpp' % XMLLOC
,
709 '%s/xh_stbox.cpp' % XMLLOC
,
711 '%s/xh_stlin.cpp' % XMLLOC
,
712 '%s/xh_sttxt.cpp' % XMLLOC
,
713 '%s/xh_text.cpp' % XMLLOC
,
714 '%s/xh_toolb.cpp' % XMLLOC
,
715 '%s/xh_tree.cpp' % XMLLOC
,
717 '%s/xh_unkwn.cpp' % XMLLOC
,
718 '%s/xml.cpp' % XMLLOC
,
719 '%s/xmlres.cpp' % XMLLOC
,
720 '%s/xmlrsall.cpp' % XMLLOC
,
724 include_dirs
= xmlres_includes
,
725 define_macros
= defines
,
727 library_dirs
= libdirs
,
730 extra_compile_args
= cflags
,
731 extra_link_args
= lflags
,
734 wxpExtensions
.append(ext
)
738 #----------------------------------------------------------------------
739 # Define the GIZMOS extension module
740 #----------------------------------------------------------------------
742 if not GL_ONLY
and BUILD_GIZMOS
:
743 msg('Preparing GIZMOS...')
744 location
= 'contrib/gizmos'
745 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
746 GIZMOINC
= opj(location
, 'contrib/include')
748 swig_files
= ['gizmos.i']
750 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
751 USE_SWIG
, swig_force
, swig_args
)
753 gizmos_includes
= includes
[:]
754 gizmos_includes
.append(GIZMOINC
)
757 # make sure local copy of contrib files are up to date
759 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
760 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
762 ext
= Extension('gizmosc', [
763 '%s/dynamicsash.cpp' % GIZMOLOC
,
764 '%s/editlbox.cpp' % GIZMOLOC
,
765 #'%s/multicell.cpp' % GIZMOLOC,
766 '%s/splittree.cpp' % GIZMOLOC
,
767 '%s/ledctrl.cpp' % GIZMOLOC
,
770 include_dirs
= gizmos_includes
,
771 define_macros
= defines
,
773 library_dirs
= libdirs
,
776 extra_compile_args
= cflags
,
777 extra_link_args
= lflags
,
780 wxpExtensions
.append(ext
)
784 #----------------------------------------------------------------------
785 # Define the DLLWIDGET extension module
786 #----------------------------------------------------------------------
788 if not GL_ONLY
and BUILD_DLLWIDGET
:
789 msg('Preparing DLLWIDGET...')
790 location
= 'contrib/dllwidget'
791 swig_files
= ['dllwidget_.i']
793 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
794 USE_SWIG
, swig_force
, swig_args
)
796 # copy a contrib project specific py module to the main package dir
797 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
799 ext
= Extension('dllwidget_c', [
800 '%s/dllwidget.cpp' % location
,
803 include_dirs
= includes
,
804 define_macros
= defines
,
806 library_dirs
= libdirs
,
809 extra_compile_args
= cflags
,
810 extra_link_args
= lflags
,
813 wxpExtensions
.append(ext
)
816 #----------------------------------------------------------------------
818 #----------------------------------------------------------------------
820 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
821 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
822 glob
.glob("tools/XRCed/*.xrc") +
823 ["tools/XRCed/CHANGES",
825 "tools/XRCed/README"]),
831 #----------------------------------------------------------------------
832 # Do the Setup/Build/Install/Whatever
833 #----------------------------------------------------------------------
835 if __name__
== "__main__":
839 description
= DESCRIPTION
,
840 long_description
= LONG_DESCRIPTION
,
842 author_email
= AUTHOR_EMAIL
,
848 PKGDIR
+'.lib.editor',
849 PKGDIR
+'.lib.mixins',
850 PKGDIR
+'.lib.PyCrust',
853 ext_package
= PKGDIR
,
854 ext_modules
= wxpExtensions
,
856 ##data_files = TOOLS,
861 setup(name
= "wxPython-gl",
863 description
= "wxGLCanvas class for wxPython",
865 author_email
= AUTHOR_EMAIL
,
869 py_modules
= [ "wxPython.glcanvas" ],
871 ext_package
= PKGDIR
,
872 ext_modules
= wxpExtensions
,
879 #----------------------------------------------------------------------
880 #----------------------------------------------------------------------