X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98fb9b71198a4850cc88fd00705645e4d37f9bf2..dae0faa6be08c5bb5635fd464b695ac8bb8f2b8d:/wxPython/setup.py diff --git a/wxPython/setup.py b/wxPython/setup.py index 09b44e2192..2f945984d7 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python #---------------------------------------------------------------------- -import sys, os, glob, fnmatch +import sys, os, glob, fnmatch, tempfile from distutils.core import setup, Extension from distutils.file_util import copy_file from distutils.dir_util import mkpath @@ -17,7 +17,7 @@ VER_MAJOR = 2 # The first three must match wxWindows VER_MINOR = 5 VER_RELEASE = 1 VER_SUBREL = 0 # wxPython release num for x.y.z release of wxWindows -VER_FLAGS = "p4" # release flags, such as prerelease num, unicode, etc. +VER_FLAGS = "p5" # release flags, such as prerelease num, unicode, etc. DESCRIPTION = "Cross platform GUI toolkit for Python" AUTHOR = "Robin Dunn" @@ -246,6 +246,9 @@ def run_swig(files, dir, gendir, package, USE_SWIG, force, swig_args, swig_deps= if not os.path.exists(os.path.join(dir, gendir)): os.mkdir(os.path.join(dir, gendir)) + if not os.path.exists(os.path.join("docs", "xml-raw")): + os.mkdir(os.path.join("docs", "xml-raw")) + sources = [] for file in files: @@ -253,6 +256,7 @@ def run_swig(files, dir, gendir, package, USE_SWIG, force, swig_args, swig_deps= i_file = os.path.join(dir, file) py_file = os.path.join(dir, gendir, basefile+'.py') cpp_file = os.path.join(dir, gendir, basefile+'_wrap.cpp') + xml_file = os.path.join("docs", "xml-raw", basefile+'_swig.xml') sources.append(cpp_file) @@ -268,16 +272,28 @@ def run_swig(files, dir, gendir, package, USE_SWIG, force, swig_args, swig_deps= #i_file = opj(i_file) #'/'.join(i_file.split('\\')) if BUILD_RENAMERS: - # first run build_renamers + #tempfile.tempdir = sourcePath + xmltemp = tempfile.mktemp('.xml') + + # First run swig to produce the XML file, adding + # an extra -D that prevents the old rename + # directives from being used + cmd = [ swig_cmd ] + swig_args + \ + [ '-DBUILDING_RENAMERS', '-xmlout', xmltemp ] + \ + ['-I'+dir, '-o', cpp_file, i_file] + msg(' '.join(cmd)) + spawn(cmd) + + # Next run build_renamers to process the XML cmd = [ sys.executable, '-u', - './distrib/build_renamers.py', - i_file, '-D'+WXPLAT, ] + \ - [x for x in swig_args if x.startswith('-I')] + './distrib/build_renamers.py', dir, basefile, xmltemp] msg(' '.join(cmd)) spawn(cmd) + os.remove(xmltemp) # Then run swig for real - cmd = [ swig_cmd ] + swig_args + ['-I'+dir, '-o', cpp_file, i_file] + cmd = [ swig_cmd ] + swig_args + ['-I'+dir, '-o', cpp_file, + '-xmlout', xml_file, i_file] msg(' '.join(cmd)) spawn(cmd)