]>
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 that enables unknown wx widgets
37 # to be loaded from a DLL 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
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 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
51 # tree, otherwise will assume all needed files are
52 # available in the wxPython source distribution
54 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
55 # but you can set it to pass an alternate
56 # version of wx-config or alternate flags,
57 # eg. as required by the .deb in-tree build.
59 # Some MSW build settings
61 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
62 # (0 or 1 only) should probably find a way to
65 HYBRID
= 0 # If set and not debug or FINAL, then build a
66 # hybrid extension that can be used by the
67 # non-debug version of python, but contains
68 # debugging symbols for wxWindows and wxPython.
69 # wxWindows must have been built with /MD, not /MDd
70 # (using FINAL=hybrid will do it.)
72 WXDLLVER
= '233' # Version part of DLL name
75 #----------------------------------------------------------------------
78 if __name__
== "__main__":
82 path
= apply(os
.path
.join
, args
)
83 return os
.path
.normpath(path
)
94 #----------------------------------------------------------------------
96 #----------------------------------------------------------------------
101 force
= '--force' in sys
.argv
or '-f' in sys
.argv
102 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
104 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
107 msg("Compiling wxPython by Borland C/C++ Compiler")
109 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
110 # Version part of BCPP build LIBRARY name
111 WXDLLVER
="" # no dll ver path avaible
114 #----------------------------------------------------------------------
115 # Check for build flags on the command line
116 #----------------------------------------------------------------------
118 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
119 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
120 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
121 'FINAL', 'HYBRID', ]:
122 for x
in range(len(sys
.argv
)):
123 if string
.find(sys
.argv
[x
], flag
) == 0:
124 pos
= string
.find(sys
.argv
[x
], '=') + 1
126 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
129 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
130 for x
in range(len(sys
.argv
)):
131 if string
.find(sys
.argv
[x
], option
) == 0:
132 pos
= string
.find(sys
.argv
[x
], '=') + 1
134 vars()[option
] = sys
.argv
[x
][pos
:]
137 sys
.argv
= filter(None, sys
.argv
)
149 #----------------------------------------------------------------------
150 # Setup some platform specific stuff
151 #----------------------------------------------------------------------
154 # Set compile flags and such for MSVC. These values are derived
155 # from the wxWindows makefiles for MSVC, others will probably
157 WXDIR
= os
.environ
['WXWIN']
169 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
170 opj(WXDIR
, 'include'),
173 defines
= [ ('WIN32', None), # Some of these are no longer
174 ('__WIN32__', None), # necessary. Anybody know which?
176 ('__WINDOWS__', None),
177 ('WINVER', '0x0400'),
184 ('SWIG_GLOBAL', None),
185 ('HAVE_CONFIG_H', None),
186 ('WXP_USE_THREAD', '1'),
189 if bcpp_compiling
: # overwrite it
192 ('WINVER', '0x0400'),
197 ('SWIG_GLOBAL', None),
198 ('HAVE_CONFIG_H', None),
199 ('WXP_USE_THREAD', '1'),
201 ('WXUSE_DEFINE','1'),
206 if not FINAL
or HYBRID
:
207 defines
.append( ('__WXDEBUG__', None) )
209 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
210 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
214 libs
= ['wx'+WXBCPPLIBVER
]
216 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
217 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
218 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
219 'advapi32', 'wsock32']
223 # '/GX-' # workaround for internal compiler error in MSVC on some machines
228 if bcpp_compiling
: # overwrite it
229 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
230 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
231 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
232 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
236 if not FINAL
and HYBRID
and not bcpp_compiling
:
237 cflags
= cflags
+ ['/Od', '/Z7']
238 lflags
= ['/DEBUG', ]
240 elif bcpp_compiling
and not FINAL
:
241 cflags
= cflags
+ ['/Od', '/v', '/y']
242 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
246 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
247 # Flags and such for a Darwin (Max OS X) build of Python
249 WXDIR
= '..' # assumes IN_CVS_TREE
254 defines
= [('SWIG_GLOBAL', None),
255 ('HAVE_CONFIG_H', None),
256 ('WXP_USE_THREAD', '1'),
261 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
262 cflags
= string
.split(cflags
)
264 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
265 lflags
= string
.split(lflags
)
269 elif os
.name
== 'posix':
270 # Set flags for Unix type platforms
272 WXDIR
= '..' # assumes IN_CVS_TREE
273 WXPLAT
= '__WXGTK__' # and assumes GTK...
274 GENDIR
= 'gtk' # Need to allow for Motif eventually too
277 defines
= [('SWIG_GLOBAL', None),
278 ('HAVE_CONFIG_H', None),
279 ('WXP_USE_THREAD', '1'),
284 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
285 os
.popen('gtk-config --cflags', 'r').read()[:-1]
286 cflags
= string
.split(cflags
)
288 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
289 lflags
= string
.split(lflags
)
293 raise 'Sorry Charlie...'
296 #----------------------------------------------------------------------
297 # Check if the version file needs updated
298 #----------------------------------------------------------------------
300 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
301 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
305 #----------------------------------------------------------------------
307 #----------------------------------------------------------------------
310 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
313 #'-docstring', '-Sbefore',
314 '-I./src', '-D'+WXPLAT
,
316 swig_deps
= ['src/my_typemaps.i']
319 #----------------------------------------------------------------------
320 # Define the CORE extension module
321 #----------------------------------------------------------------------
324 msg('Preparing CORE...')
325 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
326 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
327 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
328 'printfw.i', 'sizers.i', 'clip_dnd.i',
329 'filesys.i', 'streams.i', 'utils.i'
332 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
333 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
335 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
336 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
339 if IN_CVS_TREE
: # update the licence files
341 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
342 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
346 rc_file
= ['src/wxc.rc']
351 ext
= Extension('wxc', ['src/helpers.cpp',
353 ] + rc_file
+ swig_sources
,
355 include_dirs
= includes
,
356 define_macros
= defines
,
358 library_dirs
= libdirs
,
361 extra_compile_args
= cflags
,
362 extra_link_args
= lflags
,
364 wxpExtensions
.append(ext
)
367 # Extension for the grid module
368 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
369 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
370 ext
= Extension('gridc', swig_sources
,
371 include_dirs
= includes
,
372 define_macros
= defines
,
373 library_dirs
= libdirs
,
375 extra_compile_args
= cflags
,
376 extra_link_args
= lflags
,
378 wxpExtensions
.append(ext
)
381 # Extension for the html modules
382 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
383 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
384 ext
= Extension('htmlc', swig_sources
,
385 include_dirs
= includes
,
386 define_macros
= defines
,
387 library_dirs
= libdirs
,
389 extra_compile_args
= cflags
,
390 extra_link_args
= lflags
,
392 wxpExtensions
.append(ext
)
395 # Extension for the calendar module
396 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
397 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
398 ext
= Extension('calendarc', swig_sources
,
399 include_dirs
= includes
,
400 define_macros
= defines
,
401 library_dirs
= libdirs
,
403 extra_compile_args
= cflags
,
404 extra_link_args
= lflags
,
406 wxpExtensions
.append(ext
)
409 # Extension for the help module
410 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
411 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
412 ext
= Extension('helpc', swig_sources
,
413 include_dirs
= includes
,
414 define_macros
= defines
,
415 library_dirs
= libdirs
,
417 extra_compile_args
= cflags
,
418 extra_link_args
= lflags
,
420 wxpExtensions
.append(ext
)
423 #----------------------------------------------------------------------
424 # Define the GLCanvas extension module
425 #----------------------------------------------------------------------
427 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
428 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
430 if BUILD_GLCANVAS
or GL_ONLY
:
431 msg('Preparing GLCANVAS...')
432 location
= 'contrib/glcanvas'
433 swig_files
= ['glcanvas.i']
436 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
437 USE_SWIG
, swig_force
, swig_args
)
440 if os
.name
== 'posix':
441 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
442 gl_lflags
= string
.split(gl_config
) + lflags
445 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
446 gl_libs
= libs
+ ['opengl32', 'glu32']
449 ext
= Extension('glcanvasc',
450 swig_sources
+ other_sources
,
452 include_dirs
= includes
,
453 define_macros
= defines
,
455 library_dirs
= libdirs
,
458 extra_compile_args
= cflags
,
459 extra_link_args
= gl_lflags
,
462 wxpExtensions
.append(ext
)
465 #----------------------------------------------------------------------
466 # Define the OGL extension module
467 #----------------------------------------------------------------------
469 if not GL_ONLY
and BUILD_OGL
:
470 msg('Preparing OGL...')
471 location
= 'contrib/ogl'
472 OGLLOC
= opj(location
, 'contrib/src/ogl')
473 OGLINC
= opj(location
, 'contrib/include')
475 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
478 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
479 USE_SWIG
, swig_force
, swig_args
)
482 # make sure local copy of contrib files are up to date
483 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
484 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
486 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
487 '%s/bmpshape.cpp' % OGLLOC
,
488 '%s/composit.cpp' % OGLLOC
,
489 '%s/divided.cpp' % OGLLOC
,
490 '%s/lines.cpp' % OGLLOC
,
491 '%s/misc.cpp' % OGLLOC
,
492 '%s/basic2.cpp' % OGLLOC
,
493 '%s/canvas.cpp' % OGLLOC
,
494 '%s/constrnt.cpp' % OGLLOC
,
495 '%s/drawn.cpp' % OGLLOC
,
496 '%s/mfutils.cpp' % OGLLOC
,
497 '%s/ogldiag.cpp' % OGLLOC
,
500 include_dirs
= [OGLINC
] + includes
,
501 define_macros
= defines
,
503 library_dirs
= libdirs
,
506 extra_compile_args
= cflags
,
507 extra_link_args
= lflags
,
510 wxpExtensions
.append(ext
)
514 #----------------------------------------------------------------------
515 # Define the STC extension module
516 #----------------------------------------------------------------------
518 if not GL_ONLY
and BUILD_STC
:
519 msg('Preparing STC...')
520 location
= 'contrib/stc'
521 STCLOC
= opj(location
, 'contrib/src/stc')
522 STCINC
= opj(location
, 'contrib/include')
523 STC_H
= opj(location
, 'contrib/include/wx/stc')
526 # Check if gen_iface needs to be run for the wxSTC sources
527 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
528 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
529 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
531 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
533 os
.chdir(opj(CTRB_SRC
, 'stc'))
539 # make sure local copy of contrib files are up to date
540 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
541 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
545 swig_files
= ['stc_.i']
546 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
547 USE_SWIG
, swig_force
,
548 swig_args
+ ['-I'+STC_H
, '-I'+location
],
549 [opj(STC_H
, 'stc.h')])
551 # copy a contrib project specific py module to the main package dir
552 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
554 # add some include dirs to the standard set
555 stc_includes
= includes
[:]
556 stc_includes
.append('%s/scintilla/include' % STCLOC
)
557 stc_includes
.append('%s/scintilla/src' % STCLOC
)
558 stc_includes
.append(STCINC
)
560 # and some macro definitions
561 stc_defines
= defines
[:]
562 stc_defines
.append( ('__WX__', None) )
563 stc_defines
.append( ('SCI_LEXER', None) )
566 ext
= Extension('stc_c',
567 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
568 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
569 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
570 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
571 '%s/scintilla/src/Document.cxx' % STCLOC
,
572 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
573 '%s/scintilla/src/Editor.cxx' % STCLOC
,
574 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
575 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
576 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
577 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
578 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
579 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
580 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
581 '%s/scintilla/src/Style.cxx' % STCLOC
,
582 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
583 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
584 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
585 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
587 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
588 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
589 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
590 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
591 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
592 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
593 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
594 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
595 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
596 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
597 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
598 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
599 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
600 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
601 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
602 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
604 '%s/PlatWX.cpp' % STCLOC
,
605 '%s/ScintillaWX.cpp' % STCLOC
,
606 '%s/stc.cpp' % STCLOC
,
609 include_dirs
= stc_includes
,
610 define_macros
= stc_defines
,
612 library_dirs
= libdirs
,
615 extra_compile_args
= cflags
,
616 extra_link_args
= lflags
,
619 wxpExtensions
.append(ext
)
623 #----------------------------------------------------------------------
624 # Define the IEWIN extension module (experimental)
625 #----------------------------------------------------------------------
627 if not GL_ONLY
and BUILD_IEWIN
:
628 msg('Preparing IEWIN...')
629 location
= 'contrib/iewin'
631 swig_files
= ['iewin.i', ]
633 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
634 USE_SWIG
, swig_force
, swig_args
)
637 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
640 include_dirs
= includes
,
641 define_macros
= defines
,
643 library_dirs
= libdirs
,
646 extra_compile_args
= cflags
,
647 extra_link_args
= lflags
,
650 wxpExtensions
.append(ext
)
653 #----------------------------------------------------------------------
654 # Define the XRC extension module
655 #----------------------------------------------------------------------
657 if not GL_ONLY
and BUILD_XRC
:
658 msg('Preparing XRC...')
659 location
= 'contrib/xrc'
660 XMLLOC
= opj(location
, 'contrib/src/xrc')
661 XMLINC
= opj(location
, 'contrib/include')
663 swig_files
= ['xrc.i']
665 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
666 USE_SWIG
, swig_force
, swig_args
)
668 xmlres_includes
= includes
[:]
669 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
670 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
671 xmlres_includes
.append(XMLINC
)
674 # make sure local copy of contrib files are up to date
676 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
677 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
679 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
680 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
681 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
683 '%s/xh_bmp.cpp' % XMLLOC
,
684 '%s/xh_bmpbt.cpp' % XMLLOC
,
685 '%s/xh_bttn.cpp' % XMLLOC
,
686 '%s/xh_cald.cpp' % XMLLOC
,
687 '%s/xh_chckb.cpp' % XMLLOC
,
689 '%s/xh_chckl.cpp' % XMLLOC
,
690 '%s/xh_choic.cpp' % XMLLOC
,
691 '%s/xh_combo.cpp' % XMLLOC
,
692 '%s/xh_dlg.cpp' % XMLLOC
,
693 '%s/xh_frame.cpp' % XMLLOC
,
695 '%s/xh_gauge.cpp' % XMLLOC
,
696 '%s/xh_gdctl.cpp' % XMLLOC
,
697 '%s/xh_html.cpp' % XMLLOC
,
698 '%s/xh_listb.cpp' % XMLLOC
,
699 '%s/xh_listc.cpp' % XMLLOC
,
700 '%s/xh_menu.cpp' % XMLLOC
,
702 '%s/xh_notbk.cpp' % XMLLOC
,
703 '%s/xh_panel.cpp' % XMLLOC
,
704 '%s/xh_radbt.cpp' % XMLLOC
,
705 '%s/xh_radbx.cpp' % XMLLOC
,
706 '%s/xh_scrol.cpp' % XMLLOC
,
708 '%s/xh_sizer.cpp' % XMLLOC
,
709 '%s/xh_slidr.cpp' % XMLLOC
,
710 '%s/xh_spin.cpp' % XMLLOC
,
711 '%s/xh_stbmp.cpp' % XMLLOC
,
712 '%s/xh_stbox.cpp' % XMLLOC
,
714 '%s/xh_stlin.cpp' % XMLLOC
,
715 '%s/xh_sttxt.cpp' % XMLLOC
,
716 '%s/xh_text.cpp' % XMLLOC
,
717 '%s/xh_toolb.cpp' % XMLLOC
,
718 '%s/xh_tree.cpp' % XMLLOC
,
720 '%s/xh_unkwn.cpp' % XMLLOC
,
721 '%s/xml.cpp' % XMLLOC
,
722 '%s/xmlres.cpp' % XMLLOC
,
723 '%s/xmlrsall.cpp' % XMLLOC
,
727 include_dirs
= xmlres_includes
,
728 define_macros
= defines
,
730 library_dirs
= libdirs
,
733 extra_compile_args
= cflags
,
734 extra_link_args
= lflags
,
737 wxpExtensions
.append(ext
)
741 #----------------------------------------------------------------------
742 # Define the GIZMOS extension module
743 #----------------------------------------------------------------------
745 if not GL_ONLY
and BUILD_GIZMOS
:
746 msg('Preparing GIZMOS...')
747 location
= 'contrib/gizmos'
748 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
749 GIZMOINC
= opj(location
, 'contrib/include')
751 swig_files
= ['gizmos.i']
753 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
754 USE_SWIG
, swig_force
, swig_args
)
756 gizmos_includes
= includes
[:]
757 gizmos_includes
.append(GIZMOINC
)
760 # make sure local copy of contrib files are up to date
762 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
763 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
765 ext
= Extension('gizmosc', [
766 '%s/dynamicsash.cpp' % GIZMOLOC
,
767 '%s/editlbox.cpp' % GIZMOLOC
,
768 #'%s/multicell.cpp' % GIZMOLOC,
769 '%s/splittree.cpp' % GIZMOLOC
,
770 '%s/ledctrl.cpp' % GIZMOLOC
,
773 include_dirs
= gizmos_includes
,
774 define_macros
= defines
,
776 library_dirs
= libdirs
,
779 extra_compile_args
= cflags
,
780 extra_link_args
= lflags
,
783 wxpExtensions
.append(ext
)
787 #----------------------------------------------------------------------
788 # Define the DLLWIDGET extension module
789 #----------------------------------------------------------------------
791 if not GL_ONLY
and BUILD_DLLWIDGET
:
792 msg('Preparing DLLWIDGET...')
793 location
= 'contrib/dllwidget'
794 swig_files
= ['dllwidget_.i']
796 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
797 USE_SWIG
, swig_force
, swig_args
)
799 # copy a contrib project specific py module to the main package dir
800 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
802 ext
= Extension('dllwidget_c', [
803 '%s/dllwidget.cpp' % location
,
806 include_dirs
= includes
,
807 define_macros
= defines
,
809 library_dirs
= libdirs
,
812 extra_compile_args
= cflags
,
813 extra_link_args
= lflags
,
816 wxpExtensions
.append(ext
)
819 #----------------------------------------------------------------------
821 #----------------------------------------------------------------------
823 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
824 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
825 glob
.glob("tools/XRCed/*.xrc") +
826 ["tools/XRCed/CHANGES",
828 "tools/XRCed/README"]),
834 #----------------------------------------------------------------------
835 # Do the Setup/Build/Install/Whatever
836 #----------------------------------------------------------------------
838 if __name__
== "__main__":
842 description
= DESCRIPTION
,
843 long_description
= LONG_DESCRIPTION
,
845 author_email
= AUTHOR_EMAIL
,
851 PKGDIR
+'.lib.editor',
852 PKGDIR
+'.lib.mixins',
853 PKGDIR
+'.lib.PyCrust',
856 ext_package
= PKGDIR
,
857 ext_modules
= wxpExtensions
,
859 ##data_files = TOOLS,
864 setup(name
= "wxPython-gl",
866 description
= "wxGLCanvas class for wxPython",
868 author_email
= AUTHOR_EMAIL
,
872 py_modules
= [ "wxPython.glcanvas" ],
874 ext_package
= PKGDIR
,
875 ext_modules
= wxpExtensions
,
882 #----------------------------------------------------------------------
883 #----------------------------------------------------------------------