]>
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 USE_UNICODE
= 0 # This will pass the 'wxUSE_UNICODE' flag to SWIG.
51 # At the moment only tested for 'CORE_ONLY = 1'
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 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
58 # but you can set it to pass an alternate
59 # version of wx-config or alternate flags,
60 # eg. as required by the .deb in-tree build.
62 # Some MSW build settings
64 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
65 # (0 or 1 only) should probably find a way to
68 HYBRID
= 0 # If set and not debug or FINAL, then build a
69 # hybrid extension that can be used by the
70 # non-debug version of python, but contains
71 # debugging symbols for wxWindows and wxPython.
72 # wxWindows must have been built with /MD, not /MDd
73 # (using FINAL=hybrid will do it.)
75 WXDLLVER
= '233' # Version part of DLL name
78 #----------------------------------------------------------------------
81 if __name__
== "__main__":
85 path
= apply(os
.path
.join
, args
)
86 return os
.path
.normpath(path
)
100 #----------------------------------------------------------------------
102 #----------------------------------------------------------------------
107 force
= '--force' in sys
.argv
or '-f' in sys
.argv
108 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
110 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
113 msg("Compiling wxPython by Borland C/C++ Compiler")
115 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
116 # Version part of BCPP build LIBRARY name
117 WXDLLVER
="" # no dll ver path avaible
120 #----------------------------------------------------------------------
121 # Check for build flags on the command line
122 #----------------------------------------------------------------------
124 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
125 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
126 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE', 'USE_UNICODE',
127 'FINAL', 'HYBRID', ]:
128 for x
in range(len(sys
.argv
)):
129 if string
.find(sys
.argv
[x
], flag
) == 0:
130 pos
= string
.find(sys
.argv
[x
], '=') + 1
132 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
135 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
136 for x
in range(len(sys
.argv
)):
137 if string
.find(sys
.argv
[x
], option
) == 0:
138 pos
= string
.find(sys
.argv
[x
], '=') + 1
140 vars()[option
] = sys
.argv
[x
][pos
:]
143 sys
.argv
= filter(None, sys
.argv
)
147 #----------------------------------------------------------------------
159 if USE_UNICODE
and os
.name
!= 'nt':
160 print "UNICODE is currently only supported on Win32"
163 #----------------------------------------------------------------------
164 # Setup some platform specific stuff
165 #----------------------------------------------------------------------
168 # Set compile flags and such for MSVC. These values are derived
169 # from the wxWindows makefiles for MSVC, others will probably
171 WXDIR
= os
.environ
['WXWIN']
183 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
184 opj(WXDIR
, 'include'),
187 defines
= [ ('WIN32', None), # Some of these are no longer
188 ('__WIN32__', None), # necessary. Anybody know which?
190 ('__WINDOWS__', None),
191 ('WINVER', '0x0400'),
198 ('SWIG_GLOBAL', None),
199 ('HAVE_CONFIG_H', None),
200 ('WXP_USE_THREAD', '1'),
203 if bcpp_compiling
: # overwrite it
206 ('WINVER', '0x0400'),
211 ('SWIG_GLOBAL', None),
212 ('HAVE_CONFIG_H', None),
213 ('WXP_USE_THREAD', '1'),
215 ('WXUSE_DEFINE','1'),
220 if not FINAL
or HYBRID
:
221 defines
.append( ('__WXDEBUG__', None) )
223 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
224 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
228 libs
= ['wx'+WXBCPPLIBVER
]
230 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
231 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
232 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
233 'advapi32', 'wsock32']
237 # '/GX-' # workaround for internal compiler error in MSVC on some machines
242 if bcpp_compiling
: # overwrite it
243 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
244 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
245 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
246 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
250 if not FINAL
and HYBRID
and not bcpp_compiling
:
251 cflags
= cflags
+ ['/Od', '/Z7']
252 lflags
= ['/DEBUG', ]
254 elif bcpp_compiling
and not FINAL
:
255 cflags
= cflags
+ ['/Od', '/v', '/y']
256 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
260 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
261 # Flags and such for a Darwin (Max OS X) build of Python
263 WXDIR
= '..' # assumes IN_CVS_TREE
268 defines
= [('SWIG_GLOBAL', None),
269 ('HAVE_CONFIG_H', None),
270 ('WXP_USE_THREAD', '1'),
275 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
276 cflags
= string
.split(cflags
)
278 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
279 lflags
= string
.split(lflags
)
283 elif os
.name
== 'posix':
284 # Set flags for Unix type platforms
286 WXDIR
= '..' # assumes IN_CVS_TREE
287 WXPLAT
= '__WXGTK__' # and assumes GTK...
288 GENDIR
= 'gtk' # Need to allow for Motif eventually too
291 defines
= [('SWIG_GLOBAL', None),
292 ('HAVE_CONFIG_H', None),
293 ('WXP_USE_THREAD', '1'),
298 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
299 os
.popen('gtk-config --cflags', 'r').read()[:-1]
300 cflags
= string
.split(cflags
)
302 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
303 lflags
= string
.split(lflags
)
307 raise 'Sorry Charlie...'
310 #----------------------------------------------------------------------
311 # Check if the version file needs updated
312 #----------------------------------------------------------------------
314 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
315 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
319 #----------------------------------------------------------------------
321 #----------------------------------------------------------------------
324 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
327 #'-docstring', '-Sbefore',
328 '-I./src', '-D'+WXPLAT
,
331 swig_args
.append('-DwxUSE_UNICODE')
333 swig_deps
= ['src/my_typemaps.i']
336 #----------------------------------------------------------------------
337 # Define the CORE extension module
338 #----------------------------------------------------------------------
341 msg('Preparing CORE...')
342 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
343 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
344 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
345 'printfw.i', 'sizers.i', 'clip_dnd.i',
346 'filesys.i', 'streams.i', 'utils.i'
349 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
350 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
352 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
353 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
356 if IN_CVS_TREE
: # update the licence files
358 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
359 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
363 rc_file
= ['src/wxc.rc']
368 ext
= Extension('wxc', ['src/helpers.cpp',
370 ] + rc_file
+ swig_sources
,
372 include_dirs
= includes
,
373 define_macros
= defines
,
375 library_dirs
= libdirs
,
378 extra_compile_args
= cflags
,
379 extra_link_args
= lflags
,
381 wxpExtensions
.append(ext
)
384 # Extension for the grid module
385 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
386 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
387 ext
= Extension('gridc', swig_sources
,
388 include_dirs
= includes
,
389 define_macros
= defines
,
390 library_dirs
= libdirs
,
392 extra_compile_args
= cflags
,
393 extra_link_args
= lflags
,
395 wxpExtensions
.append(ext
)
398 # Extension for the html modules
399 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
400 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
401 ext
= Extension('htmlc', swig_sources
,
402 include_dirs
= includes
,
403 define_macros
= defines
,
404 library_dirs
= libdirs
,
406 extra_compile_args
= cflags
,
407 extra_link_args
= lflags
,
409 wxpExtensions
.append(ext
)
412 # Extension for the calendar module
413 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
414 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
415 ext
= Extension('calendarc', swig_sources
,
416 include_dirs
= includes
,
417 define_macros
= defines
,
418 library_dirs
= libdirs
,
420 extra_compile_args
= cflags
,
421 extra_link_args
= lflags
,
423 wxpExtensions
.append(ext
)
426 # Extension for the help module
427 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
428 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
429 ext
= Extension('helpc', swig_sources
,
430 include_dirs
= includes
,
431 define_macros
= defines
,
432 library_dirs
= libdirs
,
434 extra_compile_args
= cflags
,
435 extra_link_args
= lflags
,
437 wxpExtensions
.append(ext
)
440 #----------------------------------------------------------------------
441 # Define the GLCanvas extension module
442 #----------------------------------------------------------------------
444 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
445 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
447 if BUILD_GLCANVAS
or GL_ONLY
:
448 msg('Preparing GLCANVAS...')
449 location
= 'contrib/glcanvas'
450 swig_files
= ['glcanvas.i']
453 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
454 USE_SWIG
, swig_force
, swig_args
)
457 if os
.name
== 'posix':
458 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
459 gl_lflags
= string
.split(gl_config
) + lflags
462 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
463 gl_libs
= libs
+ ['opengl32', 'glu32']
466 ext
= Extension('glcanvasc',
467 swig_sources
+ other_sources
,
469 include_dirs
= includes
,
470 define_macros
= defines
,
472 library_dirs
= libdirs
,
475 extra_compile_args
= cflags
,
476 extra_link_args
= gl_lflags
,
479 wxpExtensions
.append(ext
)
482 #----------------------------------------------------------------------
483 # Define the OGL extension module
484 #----------------------------------------------------------------------
486 if not GL_ONLY
and BUILD_OGL
:
487 msg('Preparing OGL...')
488 location
= 'contrib/ogl'
489 OGLLOC
= opj(location
, 'contrib/src/ogl')
490 OGLINC
= opj(location
, 'contrib/include')
492 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
495 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
496 USE_SWIG
, swig_force
, swig_args
)
499 # make sure local copy of contrib files are up to date
500 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
501 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
503 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
504 '%s/bmpshape.cpp' % OGLLOC
,
505 '%s/composit.cpp' % OGLLOC
,
506 '%s/divided.cpp' % OGLLOC
,
507 '%s/lines.cpp' % OGLLOC
,
508 '%s/misc.cpp' % OGLLOC
,
509 '%s/basic2.cpp' % OGLLOC
,
510 '%s/canvas.cpp' % OGLLOC
,
511 '%s/constrnt.cpp' % OGLLOC
,
512 '%s/drawn.cpp' % OGLLOC
,
513 '%s/mfutils.cpp' % OGLLOC
,
514 '%s/ogldiag.cpp' % OGLLOC
,
517 include_dirs
= [OGLINC
] + includes
,
518 define_macros
= defines
,
520 library_dirs
= libdirs
,
523 extra_compile_args
= cflags
,
524 extra_link_args
= lflags
,
527 wxpExtensions
.append(ext
)
531 #----------------------------------------------------------------------
532 # Define the STC extension module
533 #----------------------------------------------------------------------
535 if not GL_ONLY
and BUILD_STC
:
536 msg('Preparing STC...')
537 location
= 'contrib/stc'
538 STCLOC
= opj(location
, 'contrib/src/stc')
539 STCINC
= opj(location
, 'contrib/include')
540 STC_H
= opj(location
, 'contrib/include/wx/stc')
543 # Check if gen_iface needs to be run for the wxSTC sources
544 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
545 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
546 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
548 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
550 os
.chdir(opj(CTRB_SRC
, 'stc'))
556 # make sure local copy of contrib files are up to date
557 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
558 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
562 swig_files
= ['stc_.i']
563 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
564 USE_SWIG
, swig_force
,
565 swig_args
+ ['-I'+STC_H
, '-I'+location
],
566 [opj(STC_H
, 'stc.h')])
568 # copy a contrib project specific py module to the main package dir
569 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
571 # add some include dirs to the standard set
572 stc_includes
= includes
[:]
573 stc_includes
.append('%s/scintilla/include' % STCLOC
)
574 stc_includes
.append('%s/scintilla/src' % STCLOC
)
575 stc_includes
.append(STCINC
)
577 # and some macro definitions
578 stc_defines
= defines
[:]
579 stc_defines
.append( ('__WX__', None) )
580 stc_defines
.append( ('SCI_LEXER', None) )
583 ext
= Extension('stc_c',
584 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
585 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
586 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
587 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
588 '%s/scintilla/src/Document.cxx' % STCLOC
,
589 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
590 '%s/scintilla/src/Editor.cxx' % STCLOC
,
591 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
592 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
593 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
594 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
595 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
596 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
597 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
598 '%s/scintilla/src/Style.cxx' % STCLOC
,
599 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
600 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
601 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
602 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
604 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
605 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
606 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
607 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
608 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
609 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
610 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
611 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
612 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
613 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
614 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
615 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
616 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
617 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
618 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
619 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
621 '%s/PlatWX.cpp' % STCLOC
,
622 '%s/ScintillaWX.cpp' % STCLOC
,
623 '%s/stc.cpp' % STCLOC
,
626 include_dirs
= stc_includes
,
627 define_macros
= stc_defines
,
629 library_dirs
= libdirs
,
632 extra_compile_args
= cflags
,
633 extra_link_args
= lflags
,
636 wxpExtensions
.append(ext
)
640 #----------------------------------------------------------------------
641 # Define the IEWIN extension module (experimental)
642 #----------------------------------------------------------------------
644 if not GL_ONLY
and BUILD_IEWIN
:
645 msg('Preparing IEWIN...')
646 location
= 'contrib/iewin'
648 swig_files
= ['iewin.i', ]
650 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
651 USE_SWIG
, swig_force
, swig_args
)
654 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
657 include_dirs
= includes
,
658 define_macros
= defines
,
660 library_dirs
= libdirs
,
663 extra_compile_args
= cflags
,
664 extra_link_args
= lflags
,
667 wxpExtensions
.append(ext
)
670 #----------------------------------------------------------------------
671 # Define the XRC extension module
672 #----------------------------------------------------------------------
674 if not GL_ONLY
and BUILD_XRC
:
675 msg('Preparing XRC...')
676 location
= 'contrib/xrc'
677 XMLLOC
= opj(location
, 'contrib/src/xrc')
678 XMLINC
= opj(location
, 'contrib/include')
680 swig_files
= ['xrc.i']
682 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
683 USE_SWIG
, swig_force
, swig_args
)
685 xmlres_includes
= includes
[:]
686 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
687 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
688 xmlres_includes
.append(XMLINC
)
691 # make sure local copy of contrib files are up to date
693 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
694 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
696 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
697 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
698 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
700 '%s/xh_bmp.cpp' % XMLLOC
,
701 '%s/xh_bmpbt.cpp' % XMLLOC
,
702 '%s/xh_bttn.cpp' % XMLLOC
,
703 '%s/xh_cald.cpp' % XMLLOC
,
704 '%s/xh_chckb.cpp' % XMLLOC
,
706 '%s/xh_chckl.cpp' % XMLLOC
,
707 '%s/xh_choic.cpp' % XMLLOC
,
708 '%s/xh_combo.cpp' % XMLLOC
,
709 '%s/xh_dlg.cpp' % XMLLOC
,
710 '%s/xh_frame.cpp' % XMLLOC
,
712 '%s/xh_gauge.cpp' % XMLLOC
,
713 '%s/xh_gdctl.cpp' % XMLLOC
,
714 '%s/xh_html.cpp' % XMLLOC
,
715 '%s/xh_listb.cpp' % XMLLOC
,
716 '%s/xh_listc.cpp' % XMLLOC
,
717 '%s/xh_menu.cpp' % XMLLOC
,
719 '%s/xh_notbk.cpp' % XMLLOC
,
720 '%s/xh_panel.cpp' % XMLLOC
,
721 '%s/xh_radbt.cpp' % XMLLOC
,
722 '%s/xh_radbx.cpp' % XMLLOC
,
723 '%s/xh_scrol.cpp' % XMLLOC
,
725 '%s/xh_sizer.cpp' % XMLLOC
,
726 '%s/xh_slidr.cpp' % XMLLOC
,
727 '%s/xh_spin.cpp' % XMLLOC
,
728 '%s/xh_stbmp.cpp' % XMLLOC
,
729 '%s/xh_stbox.cpp' % XMLLOC
,
731 '%s/xh_stlin.cpp' % XMLLOC
,
732 '%s/xh_sttxt.cpp' % XMLLOC
,
733 '%s/xh_text.cpp' % XMLLOC
,
734 '%s/xh_toolb.cpp' % XMLLOC
,
735 '%s/xh_tree.cpp' % XMLLOC
,
737 '%s/xh_unkwn.cpp' % XMLLOC
,
738 '%s/xml.cpp' % XMLLOC
,
739 '%s/xmlres.cpp' % XMLLOC
,
740 '%s/xmlrsall.cpp' % XMLLOC
,
744 include_dirs
= xmlres_includes
,
745 define_macros
= defines
,
747 library_dirs
= libdirs
,
750 extra_compile_args
= cflags
,
751 extra_link_args
= lflags
,
754 wxpExtensions
.append(ext
)
758 #----------------------------------------------------------------------
759 # Define the GIZMOS extension module
760 #----------------------------------------------------------------------
762 if not GL_ONLY
and BUILD_GIZMOS
:
763 msg('Preparing GIZMOS...')
764 location
= 'contrib/gizmos'
765 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
766 GIZMOINC
= opj(location
, 'contrib/include')
768 swig_files
= ['gizmos.i']
770 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
771 USE_SWIG
, swig_force
, swig_args
)
773 gizmos_includes
= includes
[:]
774 gizmos_includes
.append(GIZMOINC
)
777 # make sure local copy of contrib files are up to date
779 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
780 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
782 ext
= Extension('gizmosc', [
783 '%s/dynamicsash.cpp' % GIZMOLOC
,
784 '%s/editlbox.cpp' % GIZMOLOC
,
785 #'%s/multicell.cpp' % GIZMOLOC,
786 '%s/splittree.cpp' % GIZMOLOC
,
787 '%s/ledctrl.cpp' % GIZMOLOC
,
790 include_dirs
= gizmos_includes
,
791 define_macros
= defines
,
793 library_dirs
= libdirs
,
796 extra_compile_args
= cflags
,
797 extra_link_args
= lflags
,
800 wxpExtensions
.append(ext
)
804 #----------------------------------------------------------------------
805 # Define the DLLWIDGET extension module
806 #----------------------------------------------------------------------
808 if not GL_ONLY
and BUILD_DLLWIDGET
:
809 msg('Preparing DLLWIDGET...')
810 location
= 'contrib/dllwidget'
811 swig_files
= ['dllwidget_.i']
813 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
814 USE_SWIG
, swig_force
, swig_args
)
816 # copy a contrib project specific py module to the main package dir
817 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
819 ext
= Extension('dllwidget_c', [
820 '%s/dllwidget.cpp' % location
,
823 include_dirs
= includes
,
824 define_macros
= defines
,
826 library_dirs
= libdirs
,
829 extra_compile_args
= cflags
,
830 extra_link_args
= lflags
,
833 wxpExtensions
.append(ext
)
836 #----------------------------------------------------------------------
838 #----------------------------------------------------------------------
840 TOOLS
= [("wxPython/tools", glob
.glob("tools/*.py")),
841 ("wxPython/tools/XRCed", glob
.glob("tools/XRCed/*.py") +
842 glob
.glob("tools/XRCed/*.xrc") +
843 ["tools/XRCed/CHANGES",
845 "tools/XRCed/README"]),
851 #----------------------------------------------------------------------
852 # Do the Setup/Build/Install/Whatever
853 #----------------------------------------------------------------------
855 if __name__
== "__main__":
859 description
= DESCRIPTION
,
860 long_description
= LONG_DESCRIPTION
,
862 author_email
= AUTHOR_EMAIL
,
868 PKGDIR
+'.lib.editor',
869 PKGDIR
+'.lib.mixins',
870 PKGDIR
+'.lib.PyCrust',
873 ext_package
= PKGDIR
,
874 ext_modules
= wxpExtensions
,
876 ##data_files = TOOLS,
881 setup(name
= "wxPython-gl",
883 description
= "wxGLCanvas class for wxPython",
885 author_email
= AUTHOR_EMAIL
,
889 py_modules
= [ "wxPython.glcanvas" ],
891 ext_package
= PKGDIR
,
892 ext_modules
= wxpExtensions
,
899 #----------------------------------------------------------------------
900 #----------------------------------------------------------------------