From a15b1532003d6da5640ed9aa1ab72c1376a200e2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 8 Apr 2017 10:49:30 -0700 Subject: [PATCH] Fixes needed due to unsyncing the wxW/wxPy version numbers --- build.py | 23 +++++++++++++++-------- buildtools/config.py | 4 ++-- buildtools/version.py | 7 +++++++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/build.py b/build.py index 8ca3844e..9f4bfd5e 100755 --- a/build.py +++ b/build.py @@ -48,11 +48,18 @@ PYSHORTVER = '27' PYTHON = None # it will be set later PYTHON_ARCH = 'UNKNOWN' -# wx version numbers +# convenience access to the wxPython version digits version2 = "%d.%d" % (version.VER_MAJOR, version.VER_MINOR) version3 = "%d.%d.%d" % (version.VER_MAJOR, version.VER_MINOR, version.VER_RELEASE) version2_nodot = version2.replace(".", "") version3_nodot = version3.replace(".", "") + +# same for the wxWidgets version +wxversion2 = "%d.%d" % (version.wxVER_MAJOR, version.wxVER_MINOR) +wxversion3 = "%d.%d.%d" % (version.wxVER_MAJOR, version.wxVER_MINOR, version.wxVER_RELEASE) +wxversion2_nodot = wxversion2.replace(".", "") +wxversion3_nodot = wxversion3.replace(".", "") + unstable_series = (version.VER_MINOR % 2) == 1 # is the minor version odd or even? isWindows = sys.platform.startswith('win') @@ -839,7 +846,7 @@ def cmd_docset_wx(options, args): # Remove any existing docset in the dist dir and move the new docset in srcname = posixjoin(wxDir(), 'docs/doxygen/out/docset', 'wxWidgets-%s.docset' % cfg.VERSION[:3]) - destname = 'dist/wxWidgets-%s.docset' % version3 + destname = 'dist/wxWidgets-%s.docset' % wxversion3 if not os.path.isdir(srcname): msg('ERROR: %s not found' % srcname) sys.exit(1) @@ -1173,7 +1180,7 @@ def cmd_build_wx(options, args): PREFIX = options.prefix if options.mac_framework and isDarwin: # TODO: Don't hard-code this path - PREFIX = "/Library/Frameworks/wx.framework/Versions/%s" % version2 + PREFIX = "/Library/Frameworks/wx.framework/Versions/%s" % wxversion2 if PREFIX: build_options.append('--prefix=%s' % PREFIX) @@ -1262,7 +1269,7 @@ def copyWxDlls(options): msw = getMSWSettings(options) cfg = Config() - ver = version3_nodot if unstable_series else version2_nodot + ver = wxversion3_nodot if unstable_series else wxversion2_nodot arch = 'x64' if PYTHON_ARCH == '64bit' else 'x86' dlls = list() if not options.debug or options.both: @@ -1533,8 +1540,8 @@ def cmd_clean_wx(options, args): options.debug = True msw = getMSWSettings(options) deleteIfExists(opj(msw.dllDir, 'msw'+msw.dll_type)) - delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (version2_nodot, msw.dll_type)))) - delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (version3_nodot, msw.dll_type)))) + delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (wxversion2_nodot, msw.dll_type)))) + delFiles(glob.glob(opj(msw.dllDir, 'wx*%s%s*' % (wxversion3_nodot, msw.dll_type)))) if PYTHON_ARCH == '64bit': deleteIfExists(opj(msw.buildDir, 'vc%s_msw%sdll_x64' % (getVisCVersion(), msw.dll_type))) else: @@ -1562,8 +1569,8 @@ def cmd_clean_py(options, args): files += glob.glob(opj(cfg.PKGDIR, wc)) if isWindows: msw = getMSWSettings(options) - for wc in [ 'wx*' + version2_nodot + msw.dll_type + '*.dll', - 'wx*' + version3_nodot + msw.dll_type + '*.dll']: + for wc in [ 'wx*' + wxversion2_nodot + msw.dll_type + '*.dll', + 'wx*' + wxversion3_nodot + msw.dll_type + '*.dll']: files += glob.glob(opj(cfg.PKGDIR, wc)) delFiles(files) diff --git a/buildtools/config.py b/buildtools/config.py index 79798e42..d71217bf 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -348,7 +348,7 @@ class Configuration(object): self.VER_RELEASE, self.VER_FLAGS) - self.WXDLLVER = '%d%d' % (self.VER_MAJOR, self.VER_MINOR) + self.WXDLLVER = '%d%d' % (self.wxVER_MAJOR, self.wxVER_MINOR) def parseCmdLine(self): @@ -389,7 +389,7 @@ class Configuration(object): port = "x11univ" flags = ' --toolkit=%s' % port flags += ' --unicode=yes' - flags += ' --version=%s.%s' % (self.VER_MAJOR, self.VER_MINOR) + flags += ' --version=%s.%s' % (self.wxVER_MAJOR, self.wxVER_MINOR) searchpath = os.environ["PATH"] for p in searchpath.split(':'): diff --git a/buildtools/version.py b/buildtools/version.py index cac84314..09c93644 100644 --- a/buildtools/version.py +++ b/buildtools/version.py @@ -57,3 +57,10 @@ VER_FLAGS = "a1" # wxPython release flags # # See also: # http://www.python.org/dev/peps/pep-0440/ + + +# The version numbers of wxWidgets to be used in the build +wxVER_MAJOR = 3 +wxVER_MINOR = 0 +wxVER_RELEASE = 0 # only used when wxVER_MINOR is an odd value +