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 that enables unknown wx widgets
37 # to be loaded from a DLL and to be used from Python.
39 BUILD_IEWIN
= 0 # Internet Explorer wrapper (experimental)
41 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 UNICODE
= 0 # This will pass the 'wxUSE_UNICODE' flag to SWIG and
50 # will ensure that the right headers are found and the
51 # right libs are linked.
53 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
54 # tree, otherwise will assume all needed files are
55 # available in the wxPython source distribution
57 UNDEF_NDEBUG
= 1 # Python 2.2 on Unix/Linux by default defines NDEBUG,
58 # and distutils will pick this up and use it on the
59 # compile command-line for the extensions. This could
60 # conflict with how wxWindows was built. If NDEBUG is
61 # set then wxWindows' __WXDEBUG__ setting will be turned
62 # off. If wxWindows was actually built with it turned
63 # on then you end up with mismatched class structures,
64 # and wxPython will crash.
66 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
67 # but you can set it to pass an alternate
68 # version of wx-config or alternate flags,
69 # eg. as required by the .deb in-tree build.
73 # Some MSW build settings
75 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
76 # (0 or 1 only) should probably find a way to
79 HYBRID
= 0 # If set and not debug or FINAL, then build a
80 # hybrid extension that can be used by the
81 # non-debug version of python, but contains
82 # debugging symbols for wxWindows and wxPython.
83 # wxWindows must have been built with /MD, not /MDd
84 # (using FINAL=hybrid will do it.)
86 WXDLLVER
= '233' # Version part of wxWindows DLL name
89 #----------------------------------------------------------------------
92 if __name__
== "__main__":
97 path
= apply(os
.path
.join
, args
)
98 return os
.path
.normpath(path
)
113 #----------------------------------------------------------------------
115 #----------------------------------------------------------------------
120 force
= '--force' in sys
.argv
or '-f' in sys
.argv
121 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
123 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
126 msg("Compiling wxPython by Borland C/C++ Compiler")
128 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
129 # Version part of BCPP build LIBRARY name
130 WXDLLVER
="" # no dll ver path avaible
133 #----------------------------------------------------------------------
134 # Check for build flags on the command line
135 #----------------------------------------------------------------------
137 # Boolean (int) flags
138 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
139 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
140 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'UNICODE', 'UNDEF_NDEBUG',
141 'FINAL', 'HYBRID', ]:
142 for x
in range(len(sys
.argv
)):
143 if string
.find(sys
.argv
[x
], flag
) == 0:
144 pos
= string
.find(sys
.argv
[x
], '=') + 1
146 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
150 for option
in ['WX_CONFIG', 'WXDLLVER', 'BUILD_BASE']:
151 for x
in range(len(sys
.argv
)):
152 if string
.find(sys
.argv
[x
], option
) == 0:
153 pos
= string
.find(sys
.argv
[x
], '=') + 1
155 vars()[option
] = sys
.argv
[x
][pos
:]
158 sys
.argv
= filter(None, sys
.argv
)
162 #----------------------------------------------------------------------
174 if UNICODE
and os
.name
!= 'nt':
175 print "UNICODE is currently only supported on Win32"
180 BUILD_BASE
= BUILD_BASE
+ '.unicode'
181 VERSION
= VERSION
+ 'u'
184 #----------------------------------------------------------------------
185 # Setup some platform specific stuff
186 #----------------------------------------------------------------------
189 # Set compile flags and such for MSVC. These values are derived
190 # from the wxWindows makefiles for MSVC, other compilers settings
191 # will probably vary...
192 if os
.environ
.has_key('WXWIN'):
193 WXDIR
= os
.environ
['WXWIN']
195 msg("WARNING: WXWIN not set in environment.")
196 WXDIR
= '..' # assumes in CVS tree
208 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
209 opj(WXDIR
, 'include'),
212 defines
= [ ('WIN32', None), # Some of these are no longer
213 ('__WIN32__', None), # necessary. Anybody know which?
215 ('__WINDOWS__', None),
216 ('WINVER', '0x0400'),
223 ('SWIG_GLOBAL', None),
224 ('HAVE_CONFIG_H', None),
225 ('WXP_USE_THREAD', '1'),
228 if bcpp_compiling
: # overwrite it
231 ('WINVER', '0x0400'),
236 ('SWIG_GLOBAL', None),
237 ('HAVE_CONFIG_H', None),
238 ('WXP_USE_THREAD', '1'),
240 ('WXUSE_DEFINE','1'),
245 if not FINAL
or HYBRID
:
246 defines
.append( ('__WXDEBUG__', None) )
248 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
249 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
253 libs
= ['wx'+WXBCPPLIBVER
]
255 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
256 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
257 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
258 'advapi32', 'wsock32']
262 # '/GX-' # workaround for internal compiler error in MSVC on some machines
267 if bcpp_compiling
: # overwrite it
268 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
269 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
270 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
271 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
275 if not FINAL
and HYBRID
and not bcpp_compiling
:
276 cflags
= cflags
+ ['/Od', '/Z7']
277 lflags
= ['/DEBUG', ]
279 elif bcpp_compiling
and not FINAL
:
280 cflags
= cflags
+ ['/Od', '/v', '/y']
281 lflags
= lflags
+ ['/v', ]
285 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
286 # Flags and such for a Darwin (Max OS X) build of Python
288 WXDIR
= '..' # assumes IN_CVS_TREE
293 defines
= [('SWIG_GLOBAL', None),
294 ('HAVE_CONFIG_H', None),
295 ('WXP_USE_THREAD', '1'),
300 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
301 cflags
= string
.split(cflags
)
303 cflags
.append('-UNDEBUG')
305 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
306 lflags
= string
.split(lflags
)
310 elif os
.name
== 'posix':
311 # Set flags for Unix type platforms
313 WXDIR
= '..' # assumes IN_CVS_TREE
314 WXPLAT
= '__WXGTK__' # and assumes GTK...
315 GENDIR
= 'gtk' # Need to allow for Motif eventually too
318 defines
= [('SWIG_GLOBAL', None),
319 ('HAVE_CONFIG_H', None),
320 ('WXP_USE_THREAD', '1'),
325 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
326 os
.popen('gtk-config --cflags', 'r').read()[:-1]
327 cflags
= string
.split(cflags
)
329 cflags
.append('-UNDEBUG')
331 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
332 lflags
= string
.split(lflags
)
336 raise 'Sorry Charlie...'
339 #----------------------------------------------------------------------
340 # Check if the version file needs updated
341 #----------------------------------------------------------------------
343 #if IN_CVS_TREE and newer('setup.py', 'src/__version__.py'):
344 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
348 #----------------------------------------------------------------------
350 #----------------------------------------------------------------------
353 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
356 #'-docstring', '-Sbefore',
357 '-I./src', '-D'+WXPLAT
,
360 swig_args
.append('-DwxUSE_UNICODE')
362 swig_deps
= ['src/my_typemaps.i']
365 #----------------------------------------------------------------------
366 # Define the CORE extension module
367 #----------------------------------------------------------------------
370 msg('Preparing CORE...')
371 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
372 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
373 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
374 'printfw.i', 'sizers.i', 'clip_dnd.i',
375 'filesys.i', 'streams.i', 'utils.i', 'fonts.i'
378 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
379 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
381 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
382 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
383 copy_file('src/wxc.pyd.manifest', PKGDIR
, update
=1, verbose
=0)
385 if IN_CVS_TREE
: # update the licence files
387 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
388 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
392 rc_file
= ['src/wxc.rc']
397 ext
= Extension('wxc', ['src/helpers.cpp',
399 ] + rc_file
+ swig_sources
,
401 include_dirs
= includes
,
402 define_macros
= defines
,
404 library_dirs
= libdirs
,
407 extra_compile_args
= cflags
,
408 extra_link_args
= lflags
,
410 wxpExtensions
.append(ext
)
413 # Extension for the grid module
414 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
415 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
416 ext
= Extension('gridc', swig_sources
,
417 include_dirs
= includes
,
418 define_macros
= defines
,
419 library_dirs
= libdirs
,
421 extra_compile_args
= cflags
,
422 extra_link_args
= lflags
,
424 wxpExtensions
.append(ext
)
427 # Extension for the html modules
428 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
429 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
430 ext
= Extension('htmlc', swig_sources
,
431 include_dirs
= includes
,
432 define_macros
= defines
,
433 library_dirs
= libdirs
,
435 extra_compile_args
= cflags
,
436 extra_link_args
= lflags
,
438 wxpExtensions
.append(ext
)
441 # Extension for the calendar module
442 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
443 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
444 ext
= Extension('calendarc', swig_sources
,
445 include_dirs
= includes
,
446 define_macros
= defines
,
447 library_dirs
= libdirs
,
449 extra_compile_args
= cflags
,
450 extra_link_args
= lflags
,
452 wxpExtensions
.append(ext
)
455 # Extension for the help module
456 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
457 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
458 ext
= Extension('helpc', swig_sources
,
459 include_dirs
= includes
,
460 define_macros
= defines
,
461 library_dirs
= libdirs
,
463 extra_compile_args
= cflags
,
464 extra_link_args
= lflags
,
466 wxpExtensions
.append(ext
)
469 #----------------------------------------------------------------------
470 # Define the GLCanvas extension module
471 #----------------------------------------------------------------------
473 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
474 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
476 if BUILD_GLCANVAS
or GL_ONLY
:
477 msg('Preparing GLCANVAS...')
478 location
= 'contrib/glcanvas'
479 swig_files
= ['glcanvas.i']
482 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
483 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
486 if os
.name
== 'posix':
487 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
488 gl_lflags
= string
.split(gl_config
) + lflags
491 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
492 gl_libs
= libs
+ ['opengl32', 'glu32']
495 ext
= Extension('glcanvasc',
496 swig_sources
+ other_sources
,
498 include_dirs
= includes
,
499 define_macros
= defines
,
501 library_dirs
= libdirs
,
504 extra_compile_args
= cflags
,
505 extra_link_args
= gl_lflags
,
508 wxpExtensions
.append(ext
)
511 #----------------------------------------------------------------------
512 # Define the OGL extension module
513 #----------------------------------------------------------------------
515 if not GL_ONLY
and BUILD_OGL
:
516 msg('Preparing OGL...')
517 location
= 'contrib/ogl'
518 OGLLOC
= opj(location
, 'contrib/src/ogl')
519 OGLINC
= opj(location
, 'contrib/include')
521 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
524 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
525 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
528 # make sure local copy of contrib files are up to date
529 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
530 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
532 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
533 '%s/bmpshape.cpp' % OGLLOC
,
534 '%s/composit.cpp' % OGLLOC
,
535 '%s/divided.cpp' % OGLLOC
,
536 '%s/lines.cpp' % OGLLOC
,
537 '%s/misc.cpp' % OGLLOC
,
538 '%s/basic2.cpp' % OGLLOC
,
539 '%s/canvas.cpp' % OGLLOC
,
540 '%s/constrnt.cpp' % OGLLOC
,
541 '%s/drawn.cpp' % OGLLOC
,
542 '%s/mfutils.cpp' % OGLLOC
,
543 '%s/ogldiag.cpp' % OGLLOC
,
546 include_dirs
= [OGLINC
] + includes
,
547 define_macros
= defines
,
549 library_dirs
= libdirs
,
552 extra_compile_args
= cflags
,
553 extra_link_args
= lflags
,
556 wxpExtensions
.append(ext
)
560 #----------------------------------------------------------------------
561 # Define the STC extension module
562 #----------------------------------------------------------------------
564 if not GL_ONLY
and BUILD_STC
:
565 msg('Preparing STC...')
566 location
= 'contrib/stc'
567 STCLOC
= opj(location
, 'contrib/src/stc')
568 STCINC
= opj(location
, 'contrib/include')
569 STC_H
= opj(location
, 'contrib/include/wx/stc')
572 # Check if gen_iface needs to be run for the wxSTC sources
573 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
574 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
575 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
577 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
579 os
.chdir(opj(CTRB_SRC
, 'stc'))
585 # make sure local copy of contrib files are up to date
586 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
587 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
591 swig_files
= ['stc_.i']
592 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
593 USE_SWIG
, swig_force
,
594 swig_args
+ ['-I'+STC_H
, '-I'+location
],
595 [opj(STC_H
, 'stc.h')] + swig_deps
)
597 # copy a contrib project specific py module to the main package dir
598 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
600 # add some include dirs to the standard set
601 stc_includes
= includes
[:]
602 stc_includes
.append('%s/scintilla/include' % STCLOC
)
603 stc_includes
.append('%s/scintilla/src' % STCLOC
)
604 stc_includes
.append(STCINC
)
606 # and some macro definitions
607 stc_defines
= defines
[:]
608 stc_defines
.append( ('__WX__', None) )
609 stc_defines
.append( ('SCI_LEXER', None) )
610 stc_defines
.append( ('LINK_LEXERS', None) )
613 ext
= Extension('stc_c',
614 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
615 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
616 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
617 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
618 '%s/scintilla/src/Document.cxx' % STCLOC
,
619 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
620 '%s/scintilla/src/Editor.cxx' % STCLOC
,
621 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
622 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
623 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
624 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
625 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
626 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
627 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
628 '%s/scintilla/src/Style.cxx' % STCLOC
,
629 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
630 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
631 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
632 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
634 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
635 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
636 '%s/scintilla/src/LexBaan.cxx' % STCLOC
,
637 '%s/scintilla/src/LexBullant.cxx' % STCLOC
,
638 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
639 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
640 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
641 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
642 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
643 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
644 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
645 '%s/scintilla/src/LexMatlab.cxx' % STCLOC
,
646 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
647 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
648 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
649 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
650 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
651 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
652 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
654 '%s/PlatWX.cpp' % STCLOC
,
655 '%s/ScintillaWX.cpp' % STCLOC
,
656 '%s/stc.cpp' % STCLOC
,
659 include_dirs
= stc_includes
,
660 define_macros
= stc_defines
,
662 library_dirs
= libdirs
,
665 extra_compile_args
= cflags
,
666 extra_link_args
= lflags
,
669 wxpExtensions
.append(ext
)
673 #----------------------------------------------------------------------
674 # Define the IEWIN extension module (experimental)
675 #----------------------------------------------------------------------
677 if not GL_ONLY
and BUILD_IEWIN
:
678 msg('Preparing IEWIN...')
679 location
= 'contrib/iewin'
681 swig_files
= ['iewin.i', ]
683 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
684 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
687 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
690 include_dirs
= includes
,
691 define_macros
= defines
,
693 library_dirs
= libdirs
,
696 extra_compile_args
= cflags
,
697 extra_link_args
= lflags
,
700 wxpExtensions
.append(ext
)
703 #----------------------------------------------------------------------
704 # Define the XRC extension module
705 #----------------------------------------------------------------------
707 if not GL_ONLY
and BUILD_XRC
:
708 msg('Preparing XRC...')
709 location
= 'contrib/xrc'
710 XMLLOC
= opj(location
, 'contrib/src/xrc')
711 XMLINC
= opj(location
, 'contrib/include')
713 swig_files
= ['xrc.i']
715 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
716 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
718 xmlres_includes
= includes
[:]
719 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
720 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
721 xmlres_includes
.append(XMLINC
)
724 # make sure local copy of contrib files are up to date
726 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
727 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
729 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
730 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
731 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
733 '%s/xh_bmp.cpp' % XMLLOC
,
734 '%s/xh_bmpbt.cpp' % XMLLOC
,
735 '%s/xh_bttn.cpp' % XMLLOC
,
736 '%s/xh_cald.cpp' % XMLLOC
,
737 '%s/xh_chckb.cpp' % XMLLOC
,
739 '%s/xh_chckl.cpp' % XMLLOC
,
740 '%s/xh_choic.cpp' % XMLLOC
,
741 '%s/xh_combo.cpp' % XMLLOC
,
742 '%s/xh_dlg.cpp' % XMLLOC
,
743 '%s/xh_frame.cpp' % XMLLOC
,
745 '%s/xh_gauge.cpp' % XMLLOC
,
746 '%s/xh_gdctl.cpp' % XMLLOC
,
747 '%s/xh_html.cpp' % XMLLOC
,
748 '%s/xh_listb.cpp' % XMLLOC
,
749 '%s/xh_listc.cpp' % XMLLOC
,
750 '%s/xh_menu.cpp' % XMLLOC
,
752 '%s/xh_notbk.cpp' % XMLLOC
,
753 '%s/xh_panel.cpp' % XMLLOC
,
754 '%s/xh_radbt.cpp' % XMLLOC
,
755 '%s/xh_radbx.cpp' % XMLLOC
,
756 '%s/xh_scrol.cpp' % XMLLOC
,
758 '%s/xh_sizer.cpp' % XMLLOC
,
759 '%s/xh_slidr.cpp' % XMLLOC
,
760 '%s/xh_spin.cpp' % XMLLOC
,
761 '%s/xh_stbmp.cpp' % XMLLOC
,
762 '%s/xh_stbox.cpp' % XMLLOC
,
764 '%s/xh_stlin.cpp' % XMLLOC
,
765 '%s/xh_sttxt.cpp' % XMLLOC
,
766 '%s/xh_text.cpp' % XMLLOC
,
767 '%s/xh_toolb.cpp' % XMLLOC
,
768 '%s/xh_tree.cpp' % XMLLOC
,
770 '%s/xh_unkwn.cpp' % XMLLOC
,
771 '%s/xml.cpp' % XMLLOC
,
772 '%s/xmlres.cpp' % XMLLOC
,
773 '%s/xmlrsall.cpp' % XMLLOC
,
777 include_dirs
= xmlres_includes
,
778 define_macros
= defines
,
780 library_dirs
= libdirs
,
783 extra_compile_args
= cflags
,
784 extra_link_args
= lflags
,
787 wxpExtensions
.append(ext
)
791 #----------------------------------------------------------------------
792 # Define the GIZMOS extension module
793 #----------------------------------------------------------------------
795 if not GL_ONLY
and BUILD_GIZMOS
:
796 msg('Preparing GIZMOS...')
797 location
= 'contrib/gizmos'
798 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
799 GIZMOINC
= opj(location
, 'contrib/include')
801 swig_files
= ['gizmos.i']
803 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
804 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
806 gizmos_includes
= includes
[:]
807 gizmos_includes
.append(GIZMOINC
)
810 # make sure local copy of contrib files are up to date
812 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
813 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
815 ext
= Extension('gizmosc', [
816 '%s/dynamicsash.cpp' % GIZMOLOC
,
817 '%s/editlbox.cpp' % GIZMOLOC
,
818 #'%s/multicell.cpp' % GIZMOLOC,
819 '%s/splittree.cpp' % GIZMOLOC
,
820 '%s/ledctrl.cpp' % GIZMOLOC
,
823 include_dirs
= gizmos_includes
,
824 define_macros
= defines
,
826 library_dirs
= libdirs
,
829 extra_compile_args
= cflags
,
830 extra_link_args
= lflags
,
833 wxpExtensions
.append(ext
)
837 #----------------------------------------------------------------------
838 # Define the DLLWIDGET extension module
839 #----------------------------------------------------------------------
841 if not GL_ONLY
and BUILD_DLLWIDGET
:
842 msg('Preparing DLLWIDGET...')
843 location
= 'contrib/dllwidget'
844 swig_files
= ['dllwidget_.i']
846 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
847 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
849 # copy a contrib project specific py module to the main package dir
850 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
852 ext
= Extension('dllwidget_c', [
853 '%s/dllwidget.cpp' % location
,
856 include_dirs
= includes
,
857 define_macros
= defines
,
859 library_dirs
= libdirs
,
862 extra_compile_args
= cflags
,
863 extra_link_args
= lflags
,
866 wxpExtensions
.append(ext
)
869 #----------------------------------------------------------------------
871 #----------------------------------------------------------------------
873 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
874 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
875 glob
.glob("tools/XRCed/*.xrc") +
876 ["tools/XRCed/CHANGES",
878 "tools/XRCed/README"]),
884 #----------------------------------------------------------------------
885 # Do the Setup/Build/Install/Whatever
886 #----------------------------------------------------------------------
888 if __name__
== "__main__":
892 description
= DESCRIPTION
,
893 long_description
= LONG_DESCRIPTION
,
895 author_email
= AUTHOR_EMAIL
,
901 PKGDIR
+'.lib.editor',
902 PKGDIR
+'.lib.mixins',
903 PKGDIR
+'.lib.PyCrust',
906 ext_package
= PKGDIR
,
907 ext_modules
= wxpExtensions
,
909 options
= { 'build' : { 'build_base' : BUILD_BASE }
}
911 ##data_files = TOOLS,
916 setup(name
= "wxPython-gl",
918 description
= "wxGLCanvas class for wxPython",
920 author_email
= AUTHOR_EMAIL
,
924 py_modules
= [ "wxPython.glcanvas" ],
926 ext_package
= PKGDIR
,
927 ext_modules
= wxpExtensions
,
934 #----------------------------------------------------------------------
935 #----------------------------------------------------------------------