]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/setup.py
2 #----------------------------------------------------------------------
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 the gizmos contrib library
38 BUILD_IEWIN
= 0 # Internet Explorer wrapper (experimental)
40 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 IN_CVS_TREE
= 0 # Set to true if building in a full wxWindows CVS
50 # tree, otherwise will assume all needed files are
51 # available in the wxPython source distribution
53 WX_CONFIG
= "wx-config" # Usually you shouldn't need to touch this,
54 # but you can set it to pass an alternate
55 # version of wx-config or alternate flags,
56 # eg. as required by the .deb in-tree build.
58 # Some MSW build settings
60 FINAL
= 1 # Mirrors use of same flag in wx makefiles,
61 # (0 or 1 only) should probably find a way to
64 HYBRID
= 0 # If set and not debug or FINAL, then build a
65 # hybrid extension that can be used by the
66 # non-debug version of python, but contains
67 # debugging symbols for wxWindows and wxPython.
68 # wxWindows must have been built with /MD, not /MDd
69 # (using FINAL=hybrid will do it.)
71 WXDLLVER
= '232' # Version part of DLL name
74 #----------------------------------------------------------------------
77 if __name__
== "__main__":
81 path
= apply(os
.path
.join
, args
)
82 return os
.path
.normpath(path
)
93 #----------------------------------------------------------------------
95 #----------------------------------------------------------------------
100 force
= '--force' in sys
.argv
or '-f' in sys
.argv
101 debug
= '--debug' in sys
.argv
or '-g' in sys
.argv
103 bcpp_compiling
= '-c' in sys
.argv
and 'my_bcpp' in sys
.argv
# Bad heuristic
106 msg("Compiling wxPython by Borland C/C++ Compiler")
108 WXBCPPLIBVER
= string
.replace(WXDLLVER
,"_","")
109 # Version part of BCPP build LIBRARY name
110 WXDLLVER
="" # no dll ver path avaible
113 #----------------------------------------------------------------------
114 # Check for build flags on the command line
115 #----------------------------------------------------------------------
117 for flag
in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
118 'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
119 'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
120 'FINAL', 'HYBRID', ]:
121 for x
in range(len(sys
.argv
)):
122 if string
.find(sys
.argv
[x
], flag
) == 0:
123 pos
= string
.find(sys
.argv
[x
], '=') + 1
125 vars()[flag
] = eval(sys
.argv
[x
][pos
:])
128 for option
in ['WX_CONFIG', 'WXDLLVER', ]:
129 for x
in range(len(sys
.argv
)):
130 if string
.find(sys
.argv
[x
], option
) == 0:
131 pos
= string
.find(sys
.argv
[x
], '=') + 1
133 vars()[option
] = sys
.argv
[x
][pos
:]
136 sys
.argv
= filter(None, sys
.argv
)
145 #----------------------------------------------------------------------
146 # Setup some platform specific stuff
147 #----------------------------------------------------------------------
150 # Set compile flags and such for MSVC. These values are derived
151 # from the wxWindows makefiles for MSVC, others will probably
153 WXDIR
= os
.environ
['WXWIN']
165 opj(WXDIR
, 'lib', 'mswdll' + libFlag()),
166 opj(WXDIR
, 'include'),
169 defines
= [ ('WIN32', None), # Some of these are no longer
170 ('__WIN32__', None), # necessary. Anybody know which?
172 ('__WINDOWS__', None),
173 ('WINVER', '0x0400'),
180 ('SWIG_GLOBAL', None),
181 ('HAVE_CONFIG_H', None),
182 ('WXP_USE_THREAD', '1'),
185 if bcpp_compiling
: # overwrite it
188 ('WINVER', '0x0400'),
193 ('SWIG_GLOBAL', None),
194 ('HAVE_CONFIG_H', None),
195 ('WXP_USE_THREAD', '1'),
197 ('WXUSE_DEFINE','1'),
202 if not FINAL
or HYBRID
:
203 defines
.append( ('__WXDEBUG__', None) )
205 libdirs
= [opj(WXDIR
, 'lib'), 'build\\ilib']
206 wxdll
= 'wxmsw' + WXDLLVER
+ libFlag()
210 libs
= ['wx'+WXBCPPLIBVER
]
212 libs
= libs
+ ['kernel32', 'user32', 'gdi32', 'comdlg32',
213 'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
214 'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
215 'advapi32', 'wsock32']
218 cflags
= [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines
222 if bcpp_compiling
: # overwrite it
223 cflags
= ['-5', '-VF', ### To support MSVC spurious semicolons in the class scope
224 ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
225 '-Hc', '-H=' + opj(WXDIR
, '\src\msw\wx32.csm'),
226 '@' + opj(WXDIR
, '\src\msw\wxwin32.cfg')
230 if not FINAL
and HYBRID
and not bcpp_compiling
:
231 cflags
= cflags
+ ['/Od', '/Z7']
232 lflags
= ['/DEBUG', ]
234 elif bcpp_compiling
and not FINAL
:
235 cflags
= cflags
+ ['/Od', '/v', '/y']
236 lflags
= lflags
+ ['/v', ] ## '/PDB:NONE']
240 elif os
.name
== 'posix' and sys
.platform
[:6] == "darwin":
241 # Flags and such for a Darwin (Max OS X) build of Python
243 WXDIR
= '..' # assumes IN_CVS_TREE
248 defines
= [('SWIG_GLOBAL', None),
249 ('HAVE_CONFIG_H', None),
250 ('WXP_USE_THREAD', '1'),
255 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1]
256 cflags
= string
.split(cflags
)
258 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
259 lflags
= string
.split(lflags
)
263 elif os
.name
== 'posix':
264 # Set flags for Unix type platforms
266 WXDIR
= '..' # assumes IN_CVS_TREE
267 WXPLAT
= '__WXGTK__' # and assumes GTK...
268 GENDIR
= 'gtk' # Need to allow for Motif eventually too
271 defines
= [('SWIG_GLOBAL', None),
272 ('HAVE_CONFIG_H', None),
273 ('WXP_USE_THREAD', '1'),
278 cflags
= os
.popen(WX_CONFIG
+ ' --cxxflags', 'r').read()[:-1] + ' ' + \
279 os
.popen('gtk-config --cflags', 'r').read()[:-1]
280 cflags
= string
.split(cflags
)
282 lflags
= os
.popen(WX_CONFIG
+ ' --libs', 'r').read()[:-1]
283 lflags
= string
.split(lflags
)
287 raise 'Sorry Charlie...'
290 #----------------------------------------------------------------------
291 # Check if the version file needs updated
292 #----------------------------------------------------------------------
294 if IN_CVS_TREE
and newer('setup.py', 'src/__version__.py'):
295 open('src/__version__.py', 'w').write("ver = '%s'\n" % VERSION
)
299 #----------------------------------------------------------------------
301 #----------------------------------------------------------------------
304 swig_args
= ['-c++', '-shadow', '-python', '-keyword',
307 #'-docstring', '-Sbefore',
308 '-I./src', '-D'+WXPLAT
,
310 swig_deps
= ['src/my_typemaps.i']
313 #----------------------------------------------------------------------
314 # Define the CORE extension module
315 #----------------------------------------------------------------------
318 msg('Preparing CORE...')
319 swig_files
= [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
320 'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
321 'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
322 'printfw.i', 'sizers.i', 'clip_dnd.i',
323 'filesys.i', 'streams.i',
324 ##'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
327 swig_sources
= run_swig(swig_files
, 'src', GENDIR
, PKGDIR
,
328 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
330 copy_file('src/__init__.py', PKGDIR
, update
=1, verbose
=0)
331 copy_file('src/__version__.py', PKGDIR
, update
=1, verbose
=0)
334 if IN_CVS_TREE
: # update the licence files
336 for file in ['preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt']:
337 copy_file(opj(WXDIR
, 'docs', file), opj('licence',file), update
=1, verbose
=0)
341 rc_file
= ['src/wxc.rc']
346 ext
= Extension('wxc', ['src/helpers.cpp',
348 ] + rc_file
+ swig_sources
,
350 include_dirs
= includes
,
351 define_macros
= defines
,
353 library_dirs
= libdirs
,
356 extra_compile_args
= cflags
,
357 extra_link_args
= lflags
,
359 wxpExtensions
.append(ext
)
362 # Extension for the grid module
363 swig_sources
= run_swig(['grid.i'], 'src', GENDIR
, PKGDIR
,
364 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
365 ext
= Extension('gridc', swig_sources
,
366 include_dirs
= includes
,
367 define_macros
= defines
,
368 library_dirs
= libdirs
,
370 extra_compile_args
= cflags
,
371 extra_link_args
= lflags
,
373 wxpExtensions
.append(ext
)
376 # Extension for the html modules
377 swig_sources
= run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR
, PKGDIR
,
378 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
379 ext
= Extension('htmlc', swig_sources
,
380 include_dirs
= includes
,
381 define_macros
= defines
,
382 library_dirs
= libdirs
,
384 extra_compile_args
= cflags
,
385 extra_link_args
= lflags
,
387 wxpExtensions
.append(ext
)
390 # Extension for the utils module
391 swig_sources
= run_swig(['utils.i'], 'src', GENDIR
, PKGDIR
,
392 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
393 ext
= Extension('utilsc', swig_sources
,
394 include_dirs
= includes
,
395 define_macros
= defines
,
396 library_dirs
= libdirs
,
398 extra_compile_args
= cflags
,
399 extra_link_args
= lflags
,
401 wxpExtensions
.append(ext
)
404 # Extension for the calendar module
405 swig_sources
= run_swig(['calendar.i'], 'src', GENDIR
, PKGDIR
,
406 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
407 ext
= Extension('calendarc', swig_sources
,
408 include_dirs
= includes
,
409 define_macros
= defines
,
410 library_dirs
= libdirs
,
412 extra_compile_args
= cflags
,
413 extra_link_args
= lflags
,
415 wxpExtensions
.append(ext
)
418 # Extension for the help module
419 swig_sources
= run_swig(['help.i'], 'src', GENDIR
, PKGDIR
,
420 USE_SWIG
, swig_force
, swig_args
, swig_deps
)
421 ext
= Extension('helpc', swig_sources
,
422 include_dirs
= includes
,
423 define_macros
= defines
,
424 library_dirs
= libdirs
,
426 extra_compile_args
= cflags
,
427 extra_link_args
= lflags
,
429 wxpExtensions
.append(ext
)
432 #----------------------------------------------------------------------
433 # Define the GLCanvas extension module
434 #----------------------------------------------------------------------
436 CTRB_SRC
= opj(WXDIR
, 'contrib/src')
437 CTRB_INC
= opj(WXDIR
, 'contrib/include/wx')
439 if BUILD_GLCANVAS
or GL_ONLY
:
440 msg('Preparing GLCANVAS...')
441 location
= 'contrib/glcanvas'
442 swig_files
= ['glcanvas.i']
445 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
446 USE_SWIG
, swig_force
, swig_args
)
449 if os
.name
== 'posix':
450 gl_config
= os
.popen(WX_CONFIG
+ ' --gl-libs', 'r').read()[:-1]
451 gl_lflags
= string
.split(gl_config
) + lflags
454 other_sources
= [opj(location
, 'msw/myglcanvas.cpp')]
455 gl_libs
= libs
+ ['opengl32', 'glu32']
458 ext
= Extension('glcanvasc',
459 swig_sources
+ other_sources
,
461 include_dirs
= includes
,
462 define_macros
= defines
,
464 library_dirs
= libdirs
,
467 extra_compile_args
= cflags
,
468 extra_link_args
= gl_lflags
,
471 wxpExtensions
.append(ext
)
474 #----------------------------------------------------------------------
475 # Define the OGL extension module
476 #----------------------------------------------------------------------
478 if not GL_ONLY
and BUILD_OGL
:
479 msg('Preparing OGL...')
480 location
= 'contrib/ogl'
481 OGLLOC
= opj(location
, 'contrib/src/ogl')
482 OGLINC
= opj(location
, 'contrib/include')
484 swig_files
= ['ogl.i', 'oglbasic.i', 'oglshapes.i', 'oglshapes2.i',
487 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
488 USE_SWIG
, swig_force
, swig_args
)
491 # make sure local copy of contrib files are up to date
492 contrib_copy_tree(opj(CTRB_INC
, 'ogl'), opj(OGLINC
, 'wx/ogl'))
493 contrib_copy_tree(opj(CTRB_SRC
, 'ogl'), OGLLOC
)
495 ext
= Extension('oglc', ['%s/basic.cpp' % OGLLOC
,
496 '%s/bmpshape.cpp' % OGLLOC
,
497 '%s/composit.cpp' % OGLLOC
,
498 '%s/divided.cpp' % OGLLOC
,
499 '%s/lines.cpp' % OGLLOC
,
500 '%s/misc.cpp' % OGLLOC
,
501 '%s/basic2.cpp' % OGLLOC
,
502 '%s/canvas.cpp' % OGLLOC
,
503 '%s/constrnt.cpp' % OGLLOC
,
504 '%s/drawn.cpp' % OGLLOC
,
505 '%s/mfutils.cpp' % OGLLOC
,
506 '%s/ogldiag.cpp' % OGLLOC
,
509 include_dirs
= [OGLINC
] + includes
,
510 define_macros
= defines
,
512 library_dirs
= libdirs
,
515 extra_compile_args
= cflags
,
516 extra_link_args
= lflags
,
519 wxpExtensions
.append(ext
)
523 #----------------------------------------------------------------------
524 # Define the STC extension module
525 #----------------------------------------------------------------------
527 if not GL_ONLY
and BUILD_STC
:
528 msg('Preparing STC...')
529 location
= 'contrib/stc'
530 STCLOC
= opj(location
, 'contrib/src/stc')
531 STCINC
= opj(location
, 'contrib/include')
532 STC_H
= opj(location
, 'contrib/include/wx/stc')
535 # Check if gen_iface needs to be run for the wxSTC sources
536 if (newer(opj(CTRB_SRC
, 'stc/stc.h.in'), opj(CTRB_INC
, 'stc/stc.h' )) or
537 newer(opj(CTRB_SRC
, 'stc/stc.cpp.in'), opj(CTRB_SRC
, 'stc/stc.cpp')) or
538 newer(opj(CTRB_SRC
, 'stc/gen_iface.py'), opj(CTRB_SRC
, 'stc/stc.cpp'))):
540 msg('Running gen_iface.py, regenerating stc.h and stc.cpp...')
542 os
.chdir(opj(CTRB_SRC
, 'stc'))
548 # make sure local copy of contrib files are up to date
549 contrib_copy_tree(opj(CTRB_INC
, 'stc'), opj(STCINC
, 'wx/stc'))
550 contrib_copy_tree(opj(CTRB_SRC
, 'stc'), STCLOC
)
554 swig_files
= ['stc_.i']
555 swig_sources
= run_swig(swig_files
, location
, GENDIR
, PKGDIR
,
556 USE_SWIG
, swig_force
,
557 swig_args
+ ['-I'+STC_H
, '-I'+location
],
558 [opj(STC_H
, 'stc.h')])
560 # copy a contrib project specific py module to the main package dir
561 copy_file(opj(location
, 'stc.py'), PKGDIR
, update
=1, verbose
=0)
563 # add some include dirs to the standard set
564 stc_includes
= includes
[:]
565 stc_includes
.append('%s/scintilla/include' % STCLOC
)
566 stc_includes
.append('%s/scintilla/src' % STCLOC
)
567 stc_includes
.append(STCINC
)
569 # and some macro definitions
570 stc_defines
= defines
[:]
571 stc_defines
.append( ('__WX__', None) )
572 stc_defines
.append( ('SCI_LEXER', None) )
575 ext
= Extension('stc_c',
576 ['%s/scintilla/src/AutoComplete.cxx' % STCLOC
,
577 '%s/scintilla/src/CallTip.cxx' % STCLOC
,
578 '%s/scintilla/src/CellBuffer.cxx' % STCLOC
,
579 '%s/scintilla/src/ContractionState.cxx' % STCLOC
,
580 '%s/scintilla/src/Document.cxx' % STCLOC
,
581 '%s/scintilla/src/DocumentAccessor.cxx' % STCLOC
,
582 '%s/scintilla/src/Editor.cxx' % STCLOC
,
583 '%s/scintilla/src/Indicator.cxx' % STCLOC
,
584 '%s/scintilla/src/KeyMap.cxx' % STCLOC
,
585 '%s/scintilla/src/KeyWords.cxx' % STCLOC
,
586 '%s/scintilla/src/LineMarker.cxx' % STCLOC
,
587 '%s/scintilla/src/PropSet.cxx' % STCLOC
,
588 '%s/scintilla/src/RESearch.cxx' % STCLOC
,
589 '%s/scintilla/src/ScintillaBase.cxx' % STCLOC
,
590 '%s/scintilla/src/Style.cxx' % STCLOC
,
591 '%s/scintilla/src/StyleContext.cxx' % STCLOC
,
592 '%s/scintilla/src/UniConversion.cxx' % STCLOC
,
593 '%s/scintilla/src/ViewStyle.cxx' % STCLOC
,
594 '%s/scintilla/src/WindowAccessor.cxx' % STCLOC
,
596 '%s/scintilla/src/LexAda.cxx' % STCLOC
,
597 '%s/scintilla/src/LexAVE.cxx' % STCLOC
,
598 '%s/scintilla/src/LexCPP.cxx' % STCLOC
,
599 '%s/scintilla/src/LexConf.cxx' % STCLOC
,
600 '%s/scintilla/src/LexCrontab.cxx' % STCLOC
,
601 '%s/scintilla/src/LexEiffel.cxx' % STCLOC
,
602 '%s/scintilla/src/LexHTML.cxx' % STCLOC
,
603 '%s/scintilla/src/LexLisp.cxx' % STCLOC
,
604 '%s/scintilla/src/LexLua.cxx' % STCLOC
,
605 '%s/scintilla/src/LexOthers.cxx' % STCLOC
,
606 '%s/scintilla/src/LexPascal.cxx' % STCLOC
,
607 '%s/scintilla/src/LexPerl.cxx' % STCLOC
,
608 '%s/scintilla/src/LexPython.cxx' % STCLOC
,
609 '%s/scintilla/src/LexRuby.cxx' % STCLOC
,
610 '%s/scintilla/src/LexSQL.cxx' % STCLOC
,
611 '%s/scintilla/src/LexVB.cxx' % STCLOC
,
613 '%s/PlatWX.cpp' % STCLOC
,
614 '%s/ScintillaWX.cpp' % STCLOC
,
615 '%s/stc.cpp' % STCLOC
,
618 include_dirs
= stc_includes
,
619 define_macros
= stc_defines
,
621 library_dirs
= libdirs
,
624 extra_compile_args
= cflags
,
625 extra_link_args
= lflags
,
628 wxpExtensions
.append(ext
)
632 #----------------------------------------------------------------------
633 # Define the IEWIN extension module (experimental)
634 #----------------------------------------------------------------------
636 if not GL_ONLY
and BUILD_IEWIN
:
637 msg('Preparing IEWIN...')
638 location
= 'contrib/iewin'
640 swig_files
= ['iewin.i', ]
642 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
643 USE_SWIG
, swig_force
, swig_args
)
646 ext
= Extension('iewinc', ['%s/IEHtmlWin.cpp' % location
,
649 include_dirs
= includes
,
650 define_macros
= defines
,
652 library_dirs
= libdirs
,
655 extra_compile_args
= cflags
,
656 extra_link_args
= lflags
,
659 wxpExtensions
.append(ext
)
662 #----------------------------------------------------------------------
663 # Define the XRC extension module
664 #----------------------------------------------------------------------
666 if not GL_ONLY
and BUILD_XRC
:
667 msg('Preparing XRC...')
668 location
= 'contrib/xrc'
669 XMLLOC
= opj(location
, 'contrib/src/xrc')
670 XMLINC
= opj(location
, 'contrib/include')
672 swig_files
= ['xrc.i']
674 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
675 USE_SWIG
, swig_force
, swig_args
)
677 xmlres_includes
= includes
[:]
678 xmlres_includes
.append('%s/expat/xmlparse' % XMLLOC
)
679 xmlres_includes
.append('%s/expat/xmltok' % XMLLOC
)
680 xmlres_includes
.append(XMLINC
)
683 # make sure local copy of contrib files are up to date
685 contrib_copy_tree(opj(CTRB_INC
, 'xrc'), opj(XMLINC
, 'wx/xrc'))
686 contrib_copy_tree(opj(CTRB_SRC
, 'xrc'), XMLLOC
)
688 ext
= Extension('xrcc', ['%s/expat/xmlparse/xmlparse.c' % XMLLOC
,
689 '%s/expat/xmltok/xmlrole.c' % XMLLOC
,
690 '%s/expat/xmltok/xmltok.c' % XMLLOC
,
692 '%s/xh_bmp.cpp' % XMLLOC
,
693 '%s/xh_bmpbt.cpp' % XMLLOC
,
694 '%s/xh_bttn.cpp' % XMLLOC
,
695 '%s/xh_cald.cpp' % XMLLOC
,
696 '%s/xh_chckb.cpp' % XMLLOC
,
698 '%s/xh_chckl.cpp' % XMLLOC
,
699 '%s/xh_choic.cpp' % XMLLOC
,
700 '%s/xh_combo.cpp' % XMLLOC
,
701 '%s/xh_dlg.cpp' % XMLLOC
,
702 '%s/xh_frame.cpp' % XMLLOC
,
704 '%s/xh_gauge.cpp' % XMLLOC
,
705 '%s/xh_html.cpp' % XMLLOC
,
706 '%s/xh_listb.cpp' % XMLLOC
,
707 '%s/xh_listc.cpp' % XMLLOC
,
708 '%s/xh_menu.cpp' % XMLLOC
,
710 '%s/xh_notbk.cpp' % XMLLOC
,
711 '%s/xh_panel.cpp' % XMLLOC
,
712 '%s/xh_radbt.cpp' % XMLLOC
,
713 '%s/xh_radbx.cpp' % XMLLOC
,
714 '%s/xh_scrol.cpp' % XMLLOC
,
716 '%s/xh_sizer.cpp' % XMLLOC
,
717 '%s/xh_slidr.cpp' % XMLLOC
,
718 '%s/xh_spin.cpp' % XMLLOC
,
719 '%s/xh_stbmp.cpp' % XMLLOC
,
720 '%s/xh_stbox.cpp' % XMLLOC
,
722 '%s/xh_stlin.cpp' % XMLLOC
,
723 '%s/xh_sttxt.cpp' % XMLLOC
,
724 '%s/xh_text.cpp' % XMLLOC
,
725 '%s/xh_toolb.cpp' % XMLLOC
,
726 '%s/xh_tree.cpp' % XMLLOC
,
728 '%s/xh_unkwn.cpp' % XMLLOC
,
729 '%s/xml.cpp' % XMLLOC
,
730 '%s/xmlbin.cpp' % XMLLOC
,
731 '%s/xmlbinz.cpp' % XMLLOC
,
732 '%s/xmlexpat.cpp' % XMLLOC
,
734 '%s/xmlres.cpp' % XMLLOC
,
735 '%s/xmlrsall.cpp' % XMLLOC
,
736 '%s/xmlwrite.cpp' % XMLLOC
,
740 include_dirs
= xmlres_includes
,
741 define_macros
= defines
,
743 library_dirs
= libdirs
,
746 extra_compile_args
= cflags
,
747 extra_link_args
= lflags
,
750 wxpExtensions
.append(ext
)
754 #----------------------------------------------------------------------
755 # Define the GIZMOS extension module
756 #----------------------------------------------------------------------
758 if not GL_ONLY
and BUILD_GIZMOS
:
759 msg('Preparing GIZMOS...')
760 location
= 'contrib/gizmos'
761 GIZMOLOC
= opj(location
, 'contrib/src/gizmos')
762 GIZMOINC
= opj(location
, 'contrib/include')
764 swig_files
= ['gizmos.i']
766 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
767 USE_SWIG
, swig_force
, swig_args
)
769 gizmos_includes
= includes
[:]
770 gizmos_includes
.append(GIZMOINC
)
773 # make sure local copy of contrib files are up to date
775 contrib_copy_tree(opj(CTRB_INC
, 'gizmos'), opj(GIZMOINC
, 'wx/gizmos'))
776 contrib_copy_tree(opj(CTRB_SRC
, 'gizmos'), GIZMOLOC
)
778 ext
= Extension('gizmosc', [
779 '%s/dynamicsash.cpp' % GIZMOLOC
,
780 '%s/editlbox.cpp' % GIZMOLOC
,
781 #'%s/multicell.cpp' % GIZMOLOC,
782 '%s/splittree.cpp' % GIZMOLOC
,
783 '%s/ledctrl.cpp' % GIZMOLOC
,
786 include_dirs
= gizmos_includes
,
787 define_macros
= defines
,
789 library_dirs
= libdirs
,
792 extra_compile_args
= cflags
,
793 extra_link_args
= lflags
,
796 wxpExtensions
.append(ext
)
800 #----------------------------------------------------------------------
801 # Define the DLLWIDGET extension module
802 #----------------------------------------------------------------------
804 if not GL_ONLY
and BUILD_DLLWIDGET
:
805 msg('Preparing DLLWIDGET...')
806 location
= 'contrib/dllwidget'
807 swig_files
= ['dllwidget_.i']
809 swig_sources
= run_swig(swig_files
, location
, '', PKGDIR
,
810 USE_SWIG
, swig_force
, swig_args
)
812 # copy a contrib project specific py module to the main package dir
813 copy_file(opj(location
, 'dllwidget.py'), PKGDIR
, update
=1, verbose
=0)
815 ext
= Extension('dllwidget_c', [
816 '%s/dllwidget.cpp' % location
,
819 include_dirs
= includes
,
820 define_macros
= defines
,
822 library_dirs
= libdirs
,
825 extra_compile_args
= cflags
,
826 extra_link_args
= lflags
,
829 wxpExtensions
.append(ext
)
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',
855 ext_package
= PKGDIR
,
856 ext_modules
= wxpExtensions
,
861 setup(name
= "wxPython-gl",
863 description
= "wxGLCanvas class for wxPython",
865 author_email
= AUTHOR_EMAIL
,
869 py_modules
= [ "wxPython.glcanvas" ],
871 ext_package
= PKGDIR
,
872 ext_modules
= wxpExtensions
,
878 #----------------------------------------------------------------------
879 #----------------------------------------------------------------------