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 # 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 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
68 # but you can set it to pass an alternate
69 # version of wx-config or alternate flags,
70 # eg. as required by the .deb in-tree build.
74 # Some MSW build settings
76 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
77 # (0 or 1 only) should probably find a way to
80 HYBRID
= 0 # If set and not debug or FINAL, then build a
81 # hybrid extension that can be used by the
82 # non-debug version of python, but contains
83 # debugging symbols for wxWindows and wxPython.
84 # wxWindows must have been built with /MD, not /MDd
85 # (using FINAL=hybrid will do it.)
87 WXDLLVER
= '233' # Version part of wxWindows DLL name
90 #----------------------------------------------------------------------
93 if __name__
== "__main__":
98 path
= apply(os
.path
.join
, args
)
99 return os
.path
.normpath(path
)
114 #----------------------------------------------------------------------
116 #----------------------------------------------------------------------
121 force
= '--force' in sys
.argv
or '-f' in sys
.argv
122 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
124 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
127 msg("Compiling wxPython by Borland C/C++ Compiler")
129 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
130 # Version part of BCPP build LIBRARY name
131 WXDLLVER
="" # no dll ver path avaible
134 #----------------------------------------------------------------------
135 # Check for build flags on the command line
136 #----------------------------------------------------------------------
138 # Boolean (int) flags
139 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
140 'BUILD_GIZMOS', 'BUILD_DLLWIDGET', 'BUILD_IEWIN',
141 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'UNICODE', 'UNDEF_NDEBUG',
142 'FINAL', 'HYBRID', ]:
143 for x
in range(len(sys
.argv
)):
144 if string
.find(sys
.argv
[x
], flag
) == 0:
145 pos
= string
.find(sys
.argv
[x
], '=') + 1
147 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
151 for option
in ['WX_CONFIG', 'WXDLLVER', 'BUILD_BASE']:
152 for x
in range(len(sys
.argv
)):
153 if string
.find(sys
.argv
[x
], option
) == 0:
154 pos
= string
.find(sys
.argv
[x
], '=') + 1
156 vars()[option
] = sys
.argv
[x
][pos
:]
159 sys
.argv
= filter(None, sys
.argv
)
163 #----------------------------------------------------------------------
176 if UNICODE
and os
.name
!= 'nt':
177 print "UNICODE is currently only supported on Win32"
182 BUILD_BASE
= BUILD_BASE
+ '.unicode'
183 VERSION
= VERSION
+ 'u'
186 #----------------------------------------------------------------------
187 # Setup some platform specific stuff
188 #----------------------------------------------------------------------
191 # Set compile flags and such for MSVC. These values are derived
192 # from the wxWindows makefiles for MSVC, other compilers settings
193 # will probably vary...
194 if os
.environ
.has_key('WXWIN'):
195 WXDIR
= os
.environ
['WXWIN']
197 msg("WARNING: WXWIN not set in environment.")
198 WXDIR
= '..' # assumes in CVS tree
210 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
211 opj(WXDIR
, 'include'),
214 defines
= [ ('WIN32', None), # Some of these are no longer
215 ('__WIN32__', None), # necessary. Anybody know which?
217 ('__WINDOWS__', None),
218 ('WINVER', '0x0400'),
225 ('SWIG_GLOBAL', None),
226 ('HAVE_CONFIG_H', None),
227 ('WXP_USE_THREAD', '1'),
230 if bcpp_compiling
: # overwrite it
233 ('WINVER', '0x0400'),
238 ('SWIG_GLOBAL', None),
239 ('HAVE_CONFIG_H', None),
240 ('WXP_USE_THREAD', '1'),
242 ('WXUSE_DEFINE','1'),
247 if not FINAL
or HYBRID
:
248 defines
.append( ('__WXDEBUG__', None) )
250 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
251 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
255 libs
= ['wx'+WXBCPPLIBVER
]
257 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
258 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
259 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
260 'advapi32', 'wsock32']
264 # '/GX-' # workaround for internal compiler error in MSVC on some machines
269 if bcpp_compiling
: # overwrite it
270 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
271 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
272 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
273 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
277 if not FINAL
and HYBRID
and not bcpp_compiling
:
278 cflags
= cflags
+ ['/Od', '/Z7']
279 lflags
= ['/DEBUG', ]
281 elif bcpp_compiling
and not FINAL
:
282 cflags
= cflags
+ ['/Od', '/v', '/y']
283 lflags
= lflags
+ ['/v', ]
287 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
288 # Flags and such for a Darwin (Max OS X) build of Python
290 WXDIR
= '..' # assumes IN_CVS_TREE
295 defines
= [('SWIG_GLOBAL', None),
296 ('HAVE_CONFIG_H', None),
297 ('WXP_USE_THREAD', '1'),
302 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
303 cflags
= string
.split(cflags
)
305 cflags
.append('-UNDEBUG')
307 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
308 lflags
= string
.split(lflags
)
312 elif os
.name
== 'posix':
313 # Set flags for Unix type platforms
315 WXDIR
= '..' # assumes IN_CVS_TREE
316 WXPLAT
= '__WXGTK__' # and assumes GTK...
317 GENDIR
= 'gtk' # Need to allow for Motif eventually too
320 defines
= [('SWIG_GLOBAL', None),
321 ('HAVE_CONFIG_H', None),
322 ('WXP_USE_THREAD', '1'),
327 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
328 os
.popen('gtk-config --cflags', 'r').read()[:-1]
329 cflags
= string
.split(cflags
)
331 cflags
.append('-UNDEBUG')
333 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
334 lflags
= string
.split(lflags
)
338 raise 'Sorry Charlie...'
341 #----------------------------------------------------------------------
342 # Check if the version file needs updated
343 #----------------------------------------------------------------------
345 #if IN_CVS_TREE and newer('setup.py', 'src/__version__.py'):
346 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
350 #----------------------------------------------------------------------
352 #----------------------------------------------------------------------
355 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
358 #'-docstring', '-Sbefore',
359 '-I./src', '-D'+WXPLAT
,
362 swig_args
.append('-DwxUSE_UNICODE')
364 swig_deps
= ['src/my_typemaps.i']
367 #----------------------------------------------------------------------
368 # Define the CORE extension module
369 #----------------------------------------------------------------------
372 msg('Preparing CORE...')
373 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
374 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
375 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
376 'printfw.i', 'sizers.i', 'clip_dnd.i',
377 'filesys.i', 'streams.i', 'utils.i', 'fonts.i'
380 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
381 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
383 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
384 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
385 copy_file('src/wxc.pyd.manifest', PKGDIR
, update
=1, verbose
=0)
387 if IN_CVS_TREE
: # update the licence files
389 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
390 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
394 rc_file
= ['src/wxc.rc']
399 ext
= Extension('wxc', ['src/helpers.cpp',
401 ] + rc_file
+ swig_sources
,
403 include_dirs
= includes
,
404 define_macros
= defines
,
406 library_dirs
= libdirs
,
409 extra_compile_args
= cflags
,
410 extra_link_args
= lflags
,
412 wxpExtensions
.append(ext
)
415 # Extension for the grid module
416 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
417 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
418 ext
= Extension('gridc', 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 # Extension for the html modules
430 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
431 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
432 ext
= Extension('htmlc', swig_sources
,
433 include_dirs
= includes
,
434 define_macros
= defines
,
435 library_dirs
= libdirs
,
437 extra_compile_args
= cflags
,
438 extra_link_args
= lflags
,
440 wxpExtensions
.append(ext
)
443 # Extension for the calendar module
444 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
445 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
446 ext
= Extension('calendarc', swig_sources
,
447 include_dirs
= includes
,
448 define_macros
= defines
,
449 library_dirs
= libdirs
,
451 extra_compile_args
= cflags
,
452 extra_link_args
= lflags
,
454 wxpExtensions
.append(ext
)
457 # Extension for the help module
458 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
459 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
460 ext
= Extension('helpc', swig_sources
,
461 include_dirs
= includes
,
462 define_macros
= defines
,
463 library_dirs
= libdirs
,
465 extra_compile_args
= cflags
,
466 extra_link_args
= lflags
,
468 wxpExtensions
.append(ext
)
471 #----------------------------------------------------------------------
472 # Define the GLCanvas extension module
473 #----------------------------------------------------------------------
475 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
476 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
478 if BUILD_GLCANVAS
or GL_ONLY
:
479 msg('Preparing GLCANVAS...')
480 location
= 'contrib/glcanvas'
481 swig_files
= ['glcanvas.i']
484 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
485 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
488 if os
.name
== 'posix':
489 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
490 gl_lflags
= string
.split(gl_config
) + lflags
493 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
494 gl_libs
= libs
+ ['opengl32', 'glu32']
497 ext
= Extension('glcanvasc',
498 swig_sources
+ other_sources
,
500 include_dirs
= includes
,
501 define_macros
= defines
,
503 library_dirs
= libdirs
,
506 extra_compile_args
= cflags
,
507 extra_link_args
= gl_lflags
,
510 wxpExtensions
.append(ext
)
513 #----------------------------------------------------------------------
514 # Define the OGL extension module
515 #----------------------------------------------------------------------
517 if not GL_ONLY
and BUILD_OGL
:
518 msg('Preparing OGL...')
519 location
= 'contrib/ogl'
520 OGLLOC
= opj(location
, 'contrib/src/ogl')
521 OGLINC
= opj(location
, 'contrib/include')
523 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
526 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
527 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
530 # make sure local copy of contrib files are up to date
531 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
532 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
534 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
535 '%s/bmpshape.cpp' % OGLLOC
,
536 '%s/composit.cpp' % OGLLOC
,
537 '%s/divided.cpp' % OGLLOC
,
538 '%s/lines.cpp' % OGLLOC
,
539 '%s/misc.cpp' % OGLLOC
,
540 '%s/basic2.cpp' % OGLLOC
,
541 '%s/canvas.cpp' % OGLLOC
,
542 '%s/constrnt.cpp' % OGLLOC
,
543 '%s/drawn.cpp' % OGLLOC
,
544 '%s/mfutils.cpp' % OGLLOC
,
545 '%s/ogldiag.cpp' % OGLLOC
,
548 include_dirs
= [OGLINC
] + includes
,
549 define_macros
= defines
,
551 library_dirs
= libdirs
,
554 extra_compile_args
= cflags
,
555 extra_link_args
= lflags
,
558 wxpExtensions
.append(ext
)
562 #----------------------------------------------------------------------
563 # Define the STC extension module
564 #----------------------------------------------------------------------
566 if not GL_ONLY
and BUILD_STC
:
567 msg('Preparing STC...')
568 location
= 'contrib/stc'
569 STCLOC
= opj(location
, 'contrib/src/stc')
570 STCINC
= opj(location
, 'contrib/include')
571 STC_H
= opj(location
, 'contrib/include/wx/stc')
574 # Check if gen_iface needs to be run for the wxSTC sources
575 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
576 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
577 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
579 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
581 os
.chdir(opj(CTRB_SRC
, 'stc'))
587 # make sure local copy of contrib files are up to date
588 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
589 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
593 swig_files
= ['stc_.i']
594 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
595 USE_SWIG
, swig_force
,
596 swig_args
+ ['-I'+STC_H
, '-I'+location
],
597 [opj(STC_H
, 'stc.h')] + swig_deps
)
599 # copy a contrib project specific py module to the main package dir
600 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
602 # add some include dirs to the standard set
603 stc_includes
= includes
[:]
604 stc_includes
.append('%s/scintilla/include' % STCLOC
)
605 stc_includes
.append('%s/scintilla/src' % STCLOC
)
606 stc_includes
.append(STCINC
)
608 # and some macro definitions
609 stc_defines
= defines
[:]
610 stc_defines
.append( ('__WX__', None) )
611 stc_defines
.append( ('SCI_LEXER', None) )
612 stc_defines
.append( ('LINK_LEXERS', None) )
615 ext
= Extension('stc_c',
616 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
617 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
618 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
619 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
620 '%s/scintilla/src/Document.cxx' % STCLOC
,
621 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
622 '%s/scintilla/src/Editor.cxx' % STCLOC
,
623 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
624 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
625 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
626 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
627 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
628 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
629 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
630 '%s/scintilla/src/Style.cxx' % STCLOC
,
631 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
632 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
633 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
634 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
636 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
637 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
638 '%s/scintilla/src/LexBaan.cxx' % STCLOC
,
639 '%s/scintilla/src/LexBullant.cxx' % STCLOC
,
640 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
641 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
642 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
643 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
644 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
645 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
646 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
647 '%s/scintilla/src/LexMatlab.cxx' % STCLOC
,
648 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
649 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
650 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
651 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
652 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
653 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
654 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
656 '%s/PlatWX.cpp' % STCLOC
,
657 '%s/ScintillaWX.cpp' % STCLOC
,
658 '%s/stc.cpp' % STCLOC
,
661 include_dirs
= stc_includes
,
662 define_macros
= stc_defines
,
664 library_dirs
= libdirs
,
667 extra_compile_args
= cflags
,
668 extra_link_args
= lflags
,
671 wxpExtensions
.append(ext
)
675 #----------------------------------------------------------------------
676 # Define the IEWIN extension module (experimental)
677 #----------------------------------------------------------------------
679 if not GL_ONLY
and BUILD_IEWIN
:
680 msg('Preparing IEWIN...')
681 location
= 'contrib/iewin'
683 swig_files
= ['iewin.i', ]
685 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
686 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
689 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
690 '%s/wxactivex.cpp' % location
,
693 include_dirs
= includes
,
694 define_macros
= defines
,
696 library_dirs
= libdirs
,
699 extra_compile_args
= cflags
,
700 extra_link_args
= lflags
,
703 wxpExtensions
.append(ext
)
706 #----------------------------------------------------------------------
707 # Define the XRC extension module
708 #----------------------------------------------------------------------
710 if not GL_ONLY
and BUILD_XRC
:
711 msg('Preparing XRC...')
712 location
= 'contrib/xrc'
713 XMLLOC
= opj(location
, 'contrib/src/xrc')
714 XMLINC
= opj(location
, 'contrib/include')
716 swig_files
= ['xrc.i']
718 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
719 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
721 xmlres_includes
= includes
[:]
722 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
723 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
724 xmlres_includes
.append(XMLINC
)
727 # make sure local copy of contrib files are up to date
729 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
730 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
732 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
733 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
734 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
736 '%s/xh_bmp.cpp' % XMLLOC
,
737 '%s/xh_bmpbt.cpp' % XMLLOC
,
738 '%s/xh_bttn.cpp' % XMLLOC
,
739 '%s/xh_cald.cpp' % XMLLOC
,
740 '%s/xh_chckb.cpp' % XMLLOC
,
742 '%s/xh_chckl.cpp' % XMLLOC
,
743 '%s/xh_choic.cpp' % XMLLOC
,
744 '%s/xh_combo.cpp' % XMLLOC
,
745 '%s/xh_dlg.cpp' % XMLLOC
,
746 '%s/xh_frame.cpp' % XMLLOC
,
748 '%s/xh_gauge.cpp' % XMLLOC
,
749 '%s/xh_gdctl.cpp' % XMLLOC
,
750 '%s/xh_html.cpp' % XMLLOC
,
751 '%s/xh_listb.cpp' % XMLLOC
,
752 '%s/xh_listc.cpp' % XMLLOC
,
753 '%s/xh_menu.cpp' % XMLLOC
,
755 '%s/xh_notbk.cpp' % XMLLOC
,
756 '%s/xh_panel.cpp' % XMLLOC
,
757 '%s/xh_radbt.cpp' % XMLLOC
,
758 '%s/xh_radbx.cpp' % XMLLOC
,
759 '%s/xh_scrol.cpp' % XMLLOC
,
761 '%s/xh_sizer.cpp' % XMLLOC
,
762 '%s/xh_slidr.cpp' % XMLLOC
,
763 '%s/xh_spin.cpp' % XMLLOC
,
764 '%s/xh_stbmp.cpp' % XMLLOC
,
765 '%s/xh_stbox.cpp' % XMLLOC
,
767 '%s/xh_stlin.cpp' % XMLLOC
,
768 '%s/xh_sttxt.cpp' % XMLLOC
,
769 '%s/xh_text.cpp' % XMLLOC
,
770 '%s/xh_toolb.cpp' % XMLLOC
,
771 '%s/xh_tree.cpp' % XMLLOC
,
773 '%s/xh_unkwn.cpp' % XMLLOC
,
774 '%s/xml.cpp' % XMLLOC
,
775 '%s/xmlres.cpp' % XMLLOC
,
776 '%s/xmlrsall.cpp' % XMLLOC
,
780 include_dirs
= xmlres_includes
,
781 define_macros
= defines
,
783 library_dirs
= libdirs
,
786 extra_compile_args
= cflags
,
787 extra_link_args
= lflags
,
790 wxpExtensions
.append(ext
)
794 #----------------------------------------------------------------------
795 # Define the GIZMOS extension module
796 #----------------------------------------------------------------------
798 if not GL_ONLY
and BUILD_GIZMOS
:
799 msg('Preparing GIZMOS...')
800 location
= 'contrib/gizmos'
801 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
802 GIZMOINC
= opj(location
, 'contrib/include')
804 swig_files
= ['gizmos.i']
806 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
807 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
809 gizmos_includes
= includes
[:]
810 gizmos_includes
.append(GIZMOINC
)
813 # make sure local copy of contrib files are up to date
815 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
816 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
818 ext
= Extension('gizmosc', [
819 '%s/dynamicsash.cpp' % GIZMOLOC
,
820 '%s/editlbox.cpp' % GIZMOLOC
,
821 #'%s/multicell.cpp' % GIZMOLOC,
822 '%s/splittree.cpp' % GIZMOLOC
,
823 '%s/ledctrl.cpp' % GIZMOLOC
,
826 include_dirs
= gizmos_includes
,
827 define_macros
= defines
,
829 library_dirs
= libdirs
,
832 extra_compile_args
= cflags
,
833 extra_link_args
= lflags
,
836 wxpExtensions
.append(ext
)
840 #----------------------------------------------------------------------
841 # Define the DLLWIDGET extension module
842 #----------------------------------------------------------------------
844 if not GL_ONLY
and BUILD_DLLWIDGET
:
845 msg('Preparing DLLWIDGET...')
846 location
= 'contrib/dllwidget'
847 swig_files
= ['dllwidget_.i']
849 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
850 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
852 # copy a contrib project specific py module to the main package dir
853 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
855 ext
= Extension('dllwidget_c', [
856 '%s/dllwidget.cpp' % location
,
859 include_dirs
= includes
,
860 define_macros
= defines
,
862 library_dirs
= libdirs
,
865 extra_compile_args
= cflags
,
866 extra_link_args
= lflags
,
869 wxpExtensions
.append(ext
)
872 #----------------------------------------------------------------------
874 #----------------------------------------------------------------------
876 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
877 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
878 glob
.glob("tools/XRCed/*.xrc") +
879 ["tools/XRCed/CHANGES",
881 "tools/XRCed/README"]),
887 #----------------------------------------------------------------------
888 # Do the Setup/Build/Install/Whatever
889 #----------------------------------------------------------------------
891 if __name__
== "__main__":
895 description
= DESCRIPTION
,
896 long_description
= LONG_DESCRIPTION
,
898 author_email
= AUTHOR_EMAIL
,
904 PKGDIR
+'.lib.editor',
905 PKGDIR
+'.lib.mixins',
906 PKGDIR
+'.lib.PyCrust',
909 ext_package
= PKGDIR
,
910 ext_modules
= wxpExtensions
,
912 options
= { 'build' : { 'build_base' : BUILD_BASE }
}
914 ##data_files = TOOLS,
919 setup(name
= "wxPython-gl",
921 description
= "wxGLCanvas class for wxPython",
923 author_email
= AUTHOR_EMAIL
,
927 py_modules
= [ "wxPython.glcanvas" ],
929 ext_package
= PKGDIR
,
930 ext_modules
= wxpExtensions
,
937 #----------------------------------------------------------------------
938 #----------------------------------------------------------------------