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 LICENSE
= "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 that enables unknown wx widgets
37 # to be loaded from a DLL and to be used from Python.
39 # Internet Explorer wrapper (experimental)
40 BUILD_IEWIN
= (os
.name
== 'nt')
42 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 UNDEF_NDEBUG
= 1 # Python 2.2 on Unix/Linux by default defines NDEBUG,
59 # and distutils will pick this up and use it on the
60 # compile command-line for the extensions. This could
61 # conflict with how wxWindows was built. If NDEBUG is
62 # set then wxWindows' __WXDEBUG__ setting will be turned
63 # off. If wxWindows was actually built with it turned
64 # on then you end up with mismatched class structures,
65 # and wxPython will crash.
67 NO_SCRIPTS
= 0 # Don't install the tool scripts
70 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
71 # but you can set it to pass an alternate
72 # version of wx-config or alternate flags,
73 # eg. as required by the .deb in-tree build.
77 # Some MSW build settings
79 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
80 # (0 or 1 only) should probably find a way to
83 HYBRID
= 0 # If set and not debug or FINAL, then build a
84 # hybrid extension that can be used by the
85 # non-debug version of python, but contains
86 # debugging symbols for wxWindows and wxPython.
87 # wxWindows must have been built with /MD, not /MDd
88 # (using FINAL=hybrid will do it.)
90 WXDLLVER
= '233' # Version part of wxWindows DLL name
93 #----------------------------------------------------------------------
96 if __name__
== "__main__":
101 path
= apply(os
.path
.join
, args
)
102 return os
.path
.normpath(path
)
117 #----------------------------------------------------------------------
119 #----------------------------------------------------------------------
124 force
= '--force' in sys
.argv
or '-f' in sys
.argv
125 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
127 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
130 msg("Compiling wxPython by Borland C/C++ Compiler")
132 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
133 # Version part of BCPP build LIBRARY name
134 WXDLLVER
="" # no dll ver path avaible
137 #----------------------------------------------------------------------
138 # Check for build flags on the command line
139 #----------------------------------------------------------------------
141 # Boolean (int) flags
142 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
143 'BUILD_GIZMOS', 'BUILD_DLLWIDGET', 'BUILD_IEWIN',
144 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'UNICODE',
145 'UNDEF_NDEBUG', 'NO_SCRIPTS',
146 'FINAL', 'HYBRID', ]:
147 for x
in range(len(sys
.argv
)):
148 if string
.find(sys
.argv
[x
], flag
) == 0:
149 pos
= string
.find(sys
.argv
[x
], '=') + 1
151 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
155 for option
in ['WX_CONFIG', 'WXDLLVER', 'BUILD_BASE']:
156 for x
in range(len(sys
.argv
)):
157 if string
.find(sys
.argv
[x
], option
) == 0:
158 pos
= string
.find(sys
.argv
[x
], '=') + 1
160 vars()[option
] = sys
.argv
[x
][pos
:]
163 sys
.argv
= filter(None, sys
.argv
)
167 #----------------------------------------------------------------------
180 if UNICODE
and os
.name
!= 'nt':
181 print "UNICODE is currently only supported on Win32"
186 BUILD_BASE
= BUILD_BASE
+ '.unicode'
187 VERSION
= VERSION
+ 'u'
190 #----------------------------------------------------------------------
191 # Setup some platform specific stuff
192 #----------------------------------------------------------------------
195 # Set compile flags and such for MSVC. These values are derived
196 # from the wxWindows makefiles for MSVC, other compilers settings
197 # will probably vary...
198 if os
.environ
.has_key('WXWIN'):
199 WXDIR
= os
.environ
['WXWIN']
201 msg("WARNING: WXWIN not set in environment.")
202 WXDIR
= '..' # assumes in CVS tree
214 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
215 opj(WXDIR
, 'include'),
218 defines
= [ ('WIN32', None), # Some of these are no longer
219 ('__WIN32__', None), # necessary. Anybody know which?
221 ('__WINDOWS__', None),
222 ('WINVER', '0x0400'),
229 ('SWIG_GLOBAL', None),
230 ('HAVE_CONFIG_H', None),
231 ('WXP_USE_THREAD', '1'),
234 if bcpp_compiling
: # overwrite it
237 ('WINVER', '0x0400'),
242 ('SWIG_GLOBAL', None),
243 ('HAVE_CONFIG_H', None),
244 ('WXP_USE_THREAD', '1'),
246 ('WXUSE_DEFINE','1'),
251 if not FINAL
or HYBRID
:
252 defines
.append( ('__WXDEBUG__', None) )
254 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
255 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
259 libs
= ['wx'+WXBCPPLIBVER
]
261 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
262 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
263 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
264 'advapi32', 'wsock32']
268 # '/GX-' # workaround for internal compiler error in MSVC on some machines
273 if bcpp_compiling
: # overwrite it
274 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
275 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
276 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
277 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
281 if not FINAL
and HYBRID
and not bcpp_compiling
:
282 cflags
= cflags
+ ['/Od', '/Z7']
283 lflags
= ['/DEBUG', ]
285 elif bcpp_compiling
and not FINAL
:
286 cflags
= cflags
+ ['/Od', '/v', '/y']
287 lflags
= lflags
+ ['/v', ]
291 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
292 # Flags and such for a Darwin (Max OS X) build of Python
294 WXDIR
= '..' # assumes IN_CVS_TREE
299 defines
= [('SWIG_GLOBAL', None),
300 ('HAVE_CONFIG_H', None),
301 ('WXP_USE_THREAD', '1'),
306 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
307 cflags
= string
.split(cflags
)
309 cflags
.append('-UNDEBUG')
311 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
312 lflags
= string
.split(lflags
)
317 elif os
.name
== 'posix':
318 # Set flags for Unix type platforms
320 WXDIR
= '..' # assumes IN_CVS_TREE
321 WXPLAT
= '__WXGTK__' # and assumes GTK...
322 GENDIR
= 'gtk' # Need to allow for Motif eventually too
325 defines
= [('SWIG_GLOBAL', None),
326 ('HAVE_CONFIG_H', None),
327 ('WXP_USE_THREAD', '1'),
332 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
333 os
.popen('gtk-config --cflags', 'r').read()[:-1]
334 cflags
= string
.split(cflags
)
336 cflags
.append('-UNDEBUG')
338 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
339 lflags
= string
.split(lflags
)
343 raise 'Sorry Charlie...'
346 #----------------------------------------------------------------------
347 # Check if the version file needs updated
348 #----------------------------------------------------------------------
350 #if IN_CVS_TREE and newer('setup.py', 'src/__version__.py'):
351 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
355 #----------------------------------------------------------------------
357 #----------------------------------------------------------------------
360 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
363 #'-docstring', '-Sbefore',
364 '-I./src', '-D'+WXPLAT
,
367 swig_args
.append('-DwxUSE_UNICODE')
369 swig_deps
= ['src/my_typemaps.i']
372 #----------------------------------------------------------------------
373 # Define the CORE extension module
374 #----------------------------------------------------------------------
377 msg('Preparing CORE...')
378 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
379 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
380 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
381 'printfw.i', 'sizers.i', 'clip_dnd.i',
382 'filesys.i', 'streams.i', 'utils.i', 'fonts.i'
385 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
386 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
388 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
389 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
390 copy_file('src/wxc.pyd.manifest', PKGDIR
, update
=1, verbose
=0)
392 if IN_CVS_TREE
: # update the license files
394 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
395 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
399 rc_file
= ['src/wxc.rc']
404 ext
= Extension('wxc', ['src/helpers.cpp',
406 ] + rc_file
+ swig_sources
,
408 include_dirs
= includes
,
409 define_macros
= defines
,
411 library_dirs
= libdirs
,
414 extra_compile_args
= cflags
,
415 extra_link_args
= lflags
,
417 wxpExtensions
.append(ext
)
420 # Extension for the grid module
421 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
422 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
423 ext
= Extension('gridc', swig_sources
,
424 include_dirs
= includes
,
425 define_macros
= defines
,
426 library_dirs
= libdirs
,
428 extra_compile_args
= cflags
,
429 extra_link_args
= lflags
,
431 wxpExtensions
.append(ext
)
434 # Extension for the html modules
435 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
436 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
437 ext
= Extension('htmlc', swig_sources
,
438 include_dirs
= includes
,
439 define_macros
= defines
,
440 library_dirs
= libdirs
,
442 extra_compile_args
= cflags
,
443 extra_link_args
= lflags
,
445 wxpExtensions
.append(ext
)
448 # Extension for the calendar module
449 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
450 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
451 ext
= Extension('calendarc', swig_sources
,
452 include_dirs
= includes
,
453 define_macros
= defines
,
454 library_dirs
= libdirs
,
456 extra_compile_args
= cflags
,
457 extra_link_args
= lflags
,
459 wxpExtensions
.append(ext
)
462 # Extension for the help module
463 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
464 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
465 ext
= Extension('helpc', swig_sources
,
466 include_dirs
= includes
,
467 define_macros
= defines
,
468 library_dirs
= libdirs
,
470 extra_compile_args
= cflags
,
471 extra_link_args
= lflags
,
473 wxpExtensions
.append(ext
)
476 #----------------------------------------------------------------------
477 # Define the GLCanvas extension module
478 #----------------------------------------------------------------------
480 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
481 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
483 if BUILD_GLCANVAS
or GL_ONLY
:
484 msg('Preparing GLCANVAS...')
485 location
= 'contrib/glcanvas'
486 swig_files
= ['glcanvas.i']
489 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
490 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
493 if os
.name
== 'posix':
494 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
495 gl_lflags
= string
.split(gl_config
) + lflags
498 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
499 gl_libs
= libs
+ ['opengl32', 'glu32']
502 ext
= Extension('glcanvasc',
503 swig_sources
+ other_sources
,
505 include_dirs
= includes
,
506 define_macros
= defines
,
508 library_dirs
= libdirs
,
511 extra_compile_args
= cflags
,
512 extra_link_args
= gl_lflags
,
515 wxpExtensions
.append(ext
)
518 #----------------------------------------------------------------------
519 # Define the OGL extension module
520 #----------------------------------------------------------------------
522 if not GL_ONLY
and BUILD_OGL
:
523 msg('Preparing OGL...')
524 location
= 'contrib/ogl'
525 OGLLOC
= opj(location
, 'contrib/src/ogl')
526 OGLINC
= opj(location
, 'contrib/include')
528 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
531 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
532 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
535 # make sure local copy of contrib files are up to date
536 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
537 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
539 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
540 '%s/bmpshape.cpp' % OGLLOC
,
541 '%s/composit.cpp' % OGLLOC
,
542 '%s/divided.cpp' % OGLLOC
,
543 '%s/lines.cpp' % OGLLOC
,
544 '%s/misc.cpp' % OGLLOC
,
545 '%s/basic2.cpp' % OGLLOC
,
546 '%s/canvas.cpp' % OGLLOC
,
547 '%s/constrnt.cpp' % OGLLOC
,
548 '%s/drawn.cpp' % OGLLOC
,
549 '%s/mfutils.cpp' % OGLLOC
,
550 '%s/ogldiag.cpp' % OGLLOC
,
553 include_dirs
= [OGLINC
] + includes
,
554 define_macros
= defines
,
556 library_dirs
= libdirs
,
559 extra_compile_args
= cflags
,
560 extra_link_args
= lflags
,
563 wxpExtensions
.append(ext
)
567 #----------------------------------------------------------------------
568 # Define the STC extension module
569 #----------------------------------------------------------------------
571 if not GL_ONLY
and BUILD_STC
:
572 msg('Preparing STC...')
573 location
= 'contrib/stc'
574 STCLOC
= opj(location
, 'contrib/src/stc')
575 STCINC
= opj(location
, 'contrib/include')
576 STC_H
= opj(location
, 'contrib/include/wx/stc')
579 # Check if gen_iface needs to be run for the wxSTC sources
580 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
581 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
582 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
584 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
586 os
.chdir(opj(CTRB_SRC
, 'stc'))
592 # make sure local copy of contrib files are up to date
593 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
594 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
598 swig_files
= ['stc_.i']
599 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
600 USE_SWIG
, swig_force
,
601 swig_args
+ ['-I'+STC_H
, '-I'+location
],
602 [opj(STC_H
, 'stc.h')] + swig_deps
)
604 # copy a contrib project specific py module to the main package dir
605 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
607 # add some include dirs to the standard set
608 stc_includes
= includes
[:]
609 stc_includes
.append('%s/scintilla/include' % STCLOC
)
610 stc_includes
.append('%s/scintilla/src' % STCLOC
)
611 stc_includes
.append(STCINC
)
613 # and some macro definitions
614 stc_defines
= defines
[:]
615 stc_defines
.append( ('__WX__', None) )
616 stc_defines
.append( ('SCI_LEXER', None) )
617 stc_defines
.append( ('LINK_LEXERS', None) )
620 ext
= Extension('stc_c',
621 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
622 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
623 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
624 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
625 '%s/scintilla/src/Document.cxx' % STCLOC
,
626 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
627 '%s/scintilla/src/Editor.cxx' % STCLOC
,
628 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
629 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
630 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
631 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
632 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
633 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
634 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
635 '%s/scintilla/src/Style.cxx' % STCLOC
,
636 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
637 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
638 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
639 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
641 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
642 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
643 '%s/scintilla/src/LexBaan.cxx' % STCLOC
,
644 '%s/scintilla/src/LexBullant.cxx' % STCLOC
,
645 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
646 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
647 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
648 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
649 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
650 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
651 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
652 '%s/scintilla/src/LexMatlab.cxx' % STCLOC
,
653 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
654 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
655 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
656 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
657 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
658 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
659 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
661 '%s/PlatWX.cpp' % STCLOC
,
662 '%s/ScintillaWX.cpp' % STCLOC
,
663 '%s/stc.cpp' % STCLOC
,
666 include_dirs
= stc_includes
,
667 define_macros
= stc_defines
,
669 library_dirs
= libdirs
,
672 extra_compile_args
= cflags
,
673 extra_link_args
= lflags
,
676 wxpExtensions
.append(ext
)
680 #----------------------------------------------------------------------
681 # Define the IEWIN extension module (experimental)
682 #----------------------------------------------------------------------
684 if not GL_ONLY
and BUILD_IEWIN
:
685 msg('Preparing IEWIN...')
686 location
= 'contrib/iewin'
688 swig_files
= ['iewin.i', ]
690 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
691 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
694 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
695 '%s/wxactivex.cpp' % location
,
698 include_dirs
= includes
,
699 define_macros
= defines
,
701 library_dirs
= libdirs
,
704 extra_compile_args
= cflags
,
705 extra_link_args
= lflags
,
708 wxpExtensions
.append(ext
)
711 #----------------------------------------------------------------------
712 # Define the XRC extension module
713 #----------------------------------------------------------------------
715 if not GL_ONLY
and BUILD_XRC
:
716 msg('Preparing XRC...')
717 location
= 'contrib/xrc'
718 XMLLOC
= opj(location
, 'contrib/src/xrc')
719 XMLINC
= opj(location
, 'contrib/include')
721 swig_files
= ['xrc.i']
723 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
724 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
726 xmlres_includes
= includes
[:]
727 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
728 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
729 xmlres_includes
.append(XMLINC
)
732 # make sure local copy of contrib files are up to date
734 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
735 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
737 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
738 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
739 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
741 '%s/xh_bmp.cpp' % XMLLOC
,
742 '%s/xh_bmpbt.cpp' % XMLLOC
,
743 '%s/xh_bttn.cpp' % XMLLOC
,
744 '%s/xh_cald.cpp' % XMLLOC
,
745 '%s/xh_chckb.cpp' % XMLLOC
,
747 '%s/xh_chckl.cpp' % XMLLOC
,
748 '%s/xh_choic.cpp' % XMLLOC
,
749 '%s/xh_combo.cpp' % XMLLOC
,
750 '%s/xh_dlg.cpp' % XMLLOC
,
751 '%s/xh_frame.cpp' % XMLLOC
,
753 '%s/xh_gauge.cpp' % XMLLOC
,
754 '%s/xh_gdctl.cpp' % XMLLOC
,
755 '%s/xh_html.cpp' % XMLLOC
,
756 '%s/xh_listb.cpp' % XMLLOC
,
757 '%s/xh_listc.cpp' % XMLLOC
,
758 '%s/xh_menu.cpp' % XMLLOC
,
760 '%s/xh_notbk.cpp' % XMLLOC
,
761 '%s/xh_panel.cpp' % XMLLOC
,
762 '%s/xh_radbt.cpp' % XMLLOC
,
763 '%s/xh_radbx.cpp' % XMLLOC
,
764 '%s/xh_scrol.cpp' % XMLLOC
,
766 '%s/xh_sizer.cpp' % XMLLOC
,
767 '%s/xh_slidr.cpp' % XMLLOC
,
768 '%s/xh_spin.cpp' % XMLLOC
,
769 '%s/xh_stbmp.cpp' % XMLLOC
,
770 '%s/xh_stbox.cpp' % XMLLOC
,
772 '%s/xh_stlin.cpp' % XMLLOC
,
773 '%s/xh_sttxt.cpp' % XMLLOC
,
774 '%s/xh_text.cpp' % XMLLOC
,
775 '%s/xh_toolb.cpp' % XMLLOC
,
776 '%s/xh_tree.cpp' % XMLLOC
,
778 '%s/xh_unkwn.cpp' % XMLLOC
,
779 '%s/xml.cpp' % XMLLOC
,
780 '%s/xmlres.cpp' % XMLLOC
,
781 '%s/xmlrsall.cpp' % XMLLOC
,
785 include_dirs
= xmlres_includes
,
786 define_macros
= defines
,
788 library_dirs
= libdirs
,
791 extra_compile_args
= cflags
,
792 extra_link_args
= lflags
,
795 wxpExtensions
.append(ext
)
799 #----------------------------------------------------------------------
800 # Define the GIZMOS extension module
801 #----------------------------------------------------------------------
803 if not GL_ONLY
and BUILD_GIZMOS
:
804 msg('Preparing GIZMOS...')
805 location
= 'contrib/gizmos'
806 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
807 GIZMOINC
= opj(location
, 'contrib/include')
809 swig_files
= ['gizmos.i']
811 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
812 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
814 gizmos_includes
= includes
[:]
815 gizmos_includes
.append(GIZMOINC
)
818 # make sure local copy of contrib files are up to date
820 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
821 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
823 ext
= Extension('gizmosc', [
824 '%s/dynamicsash.cpp' % GIZMOLOC
,
825 '%s/editlbox.cpp' % GIZMOLOC
,
826 #'%s/multicell.cpp' % GIZMOLOC,
827 '%s/splittree.cpp' % GIZMOLOC
,
828 '%s/ledctrl.cpp' % GIZMOLOC
,
831 include_dirs
= gizmos_includes
,
832 define_macros
= defines
,
834 library_dirs
= libdirs
,
837 extra_compile_args
= cflags
,
838 extra_link_args
= lflags
,
841 wxpExtensions
.append(ext
)
845 #----------------------------------------------------------------------
846 # Define the DLLWIDGET extension module
847 #----------------------------------------------------------------------
849 if not GL_ONLY
and BUILD_DLLWIDGET
:
850 msg('Preparing DLLWIDGET...')
851 location
= 'contrib/dllwidget'
852 swig_files
= ['dllwidget_.i']
854 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
855 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
857 # copy a contrib project specific py module to the main package dir
858 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
860 ext
= Extension('dllwidget_c', [
861 '%s/dllwidget.cpp' % location
,
864 include_dirs
= includes
,
865 define_macros
= defines
,
867 library_dirs
= libdirs
,
870 extra_compile_args
= cflags
,
871 extra_link_args
= lflags
,
874 wxpExtensions
.append(ext
)
877 #----------------------------------------------------------------------
879 #----------------------------------------------------------------------
881 ## TOOLS = [("wxPython/tools", glob.glob("tools/*.py")),
882 ## ("wxPython/tools/XRCed", glob.glob("tools/XRCed/*.py") +
883 ## glob.glob("tools/XRCed/*.xrc") +
884 ## ["tools/XRCed/CHANGES",
885 ## "tools/XRCed/TODO",
886 ## "tools/XRCed/README"]),
893 SCRIPTS
= [opj('scripts/img2png'),
894 opj('scripts/img2xpm'),
895 opj('scripts/img2py'),
896 opj('scripts/xrced'),
897 opj('scripts/pyshell'),
898 opj('scripts/pycrust'),
902 #----------------------------------------------------------------------
903 # Do the Setup/Build/Install/Whatever
904 #----------------------------------------------------------------------
906 if __name__
== "__main__":
910 description
= DESCRIPTION
,
911 long_description
= LONG_DESCRIPTION
,
913 author_email
= AUTHOR_EMAIL
,
919 PKGDIR
+'.lib.editor',
920 PKGDIR
+'.lib.mixins',
921 PKGDIR
+'.lib.PyCrust',
923 PKGDIR
+'.tools.XRCed',
926 ext_package
= PKGDIR
,
927 ext_modules
= wxpExtensions
,
929 options
= { 'build' : { 'build_base' : BUILD_BASE }
},
931 ##data_files = TOOLS,
937 setup(name
= "wxPython-gl",
939 description
= "wxGLCanvas class for wxPython",
941 author_email
= AUTHOR_EMAIL
,
945 py_modules
= [ "wxPython.glcanvas" ],
947 ext_package
= PKGDIR
,
948 ext_modules
= wxpExtensions
,
955 #----------------------------------------------------------------------
956 #----------------------------------------------------------------------