From 34630a5707c9084d36b7fc41895c6f71c87ee5c9 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 14 Aug 2017 15:31:17 -0700 Subject: [PATCH 1/7] Add --gtk2 option. Default to building for gtk3. Keep --gtk3 flag for compatibility. --- build.py | 10 +++++++++- buildbot/master.cfg | 6 ++++-- buildtools/build_wxwidgets.py | 9 ++++++++- wscript | 15 ++++++++++----- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index a82ef9f1..1fed28e4 100755 --- a/build.py +++ b/build.py @@ -392,7 +392,8 @@ def makeOptionParser(): ("relwithdebug", (False, "Turn on the generation of debug info for release builds on MSW.")), ("release", (False, "Turn off some development options for a release build.")), ("keep_hash_lines",(False, "Don't remove the '#line N' lines from the SIP generated code")), - ("gtk3", (False, "On Linux build for gtk3 (default gtk2)")), + ("gtk2", (False, "On Linux build for gtk2 (default gtk3)")), + ("gtk3", (True, "On Linux build for gtk3")), ("osx_cocoa", (True, "Build the OSX Cocoa port on Mac (default)")), ("osx_carbon", (False, "Build the OSX Carbon port on Mac (unsupported)")), ("mac_framework", (False, "Build wxWidgets as a Mac framework.")), @@ -473,6 +474,9 @@ def parseArgs(args): if os.path.exists('REV.txt'): os.unlink('REV.txt') + if options.gtk2: + options.gtk3 = False + return options, args @@ -1248,6 +1252,8 @@ def cmd_build_wx(options, args): if options.extra_make: build_options.append('--extra_make="%s"' % options.extra_make) + if options.gtk2: + build_options.append('--gtk2') if options.gtk3: build_options.append('--gtk3') @@ -1395,6 +1401,8 @@ def cmd_build_py(options, args): build_options.append('--jobs=%s' % options.jobs) if options.relwithdebug: build_options.append('--msvc_relwithdebug') + if options.gtk2: + build_options.append('--gtk2') if options.gtk3: build_options.append('--gtk3') diff --git a/buildbot/master.cfg b/buildbot/master.cfg index e80e0091..79974b25 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -274,6 +274,8 @@ def makeFactory(port, buildType='buildOnly', pyVer='2.7'): else: # Build both architectures for the distribution builders cmd += ' --mac_arch=i386,x86_64' + if port == 'gtk2': + cmd += ' --gtk2' if port == 'gtk3': cmd += ' --gtk3' if port in ['win32', 'win64']: @@ -334,11 +336,11 @@ c['builders'] = [ BuilderConfig(name="build-gtk-py27", slavenames=["ubuntu-x64_86-py27"], - factory=makeFactory('gtk')), + factory=makeFactory('gtk2')), BuilderConfig(name="build-gtk-py35", slavenames=["ubuntu-x64_86-py27"], - factory=makeFactory('gtk', pyVer='3.5')), + factory=makeFactory('gtk2', pyVer='3.5')), BuilderConfig(name="build-gtk3-py27", slavenames=["ubuntu-x64_86-py27"], diff --git a/buildtools/build_wxwidgets.py b/buildtools/build_wxwidgets.py index f0893e3c..11072899 100644 --- a/buildtools/build_wxwidgets.py +++ b/buildtools/build_wxwidgets.py @@ -205,7 +205,8 @@ def main(wxDir, args): "jobs" : (defJobs, "Number of jobs to run at one time in make. Default: %s" % defJobs), "install" : (False, "Install the toolkit to the installdir directory, or the default dir."), "installdir" : ("", "Directory where built wxWidgets will be installed"), - "gtk3" : (False, "On Linux build for gtk3 (default gtk2)"), + "gtk2" : (False, "On Linux build for gtk2 (default gtk3"), + "gtk3" : (True, "On Linux build for gtk3"), "mac_distdir" : (None, "If set on Mac, will create an installer package in the specified dir."), "mac_universal_binary" : ("", "Comma separated list of architectures to include in the Mac universal binary"), @@ -268,9 +269,15 @@ def main(wxDir, args): elif options.osx_carbon: configure_opts.append("--with-osx_carbon") + if options.gtk2: + options.gtk3 = False + if options.gtk3: configure_opts.append("--with-gtk=3") + if options.gtk2: + configure_opts.append("--with-gtk=2") + wxpy_configure_opts = [ "--with-opengl", "--enable-sound", diff --git a/wscript b/wscript index a1b65e03..7954f1d2 100644 --- a/wscript +++ b/wscript @@ -46,8 +46,10 @@ def options(opt): help='One or more comma separated architecture names to be used for ' 'the Mac builds. Should be at least a subset of the architectures ' 'used by wxWidgets and Python') - opt.add_option('--gtk3', dest='gtk3', action='store_true', default=False, - help='On Linux build for gtk3 (default gtk2)') + opt.add_option('--gtk2', dest='gtk2', action='store_true', default=False, + help='On Linux build for gtk2 (default gtk3)') + opt.add_option('--gtk3', dest='gtk3', action='store_true', default=True, + help='On Linux build for gtk3') opt.add_option('--msvc_arch', dest='msvc_arch', default='x86', action='store', help='The architecture to target for MSVC builds. Supported values ' 'are: "x86" or "x64"') @@ -251,10 +253,13 @@ def configure(conf): # wxWidgets. If we ever support other ports then this code will need # to be adjusted. if not isDarwin: - if conf.options.gtk3: - gtkflags = os.popen('pkg-config gtk+-3.0 --cflags', 'r').read()[:-1] - else: + if conf.options.gtk2: + conf.options.gtk3 = False + if conf.options.gtk2: gtkflags = os.popen('pkg-config gtk+-2.0 --cflags', 'r').read()[:-1] + else: + gtkflags = os.popen('pkg-config gtk+-3.0 --cflags', 'r').read()[:-1] + conf.env.CFLAGS_WX += gtkflags.split() conf.env.CXXFLAGS_WX += gtkflags.split() From ab3c6a349990adbfede3c026a56db59deca6b2fb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 14 Aug 2017 15:35:23 -0700 Subject: [PATCH 2/7] Use a separate wx build folder for gtk2 and gtk3 builds --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 1fed28e4..98b95539 100755 --- a/build.py +++ b/build.py @@ -491,7 +491,10 @@ class pushDir(object): def getBuildDir(options): - BUILD_DIR = opj(phoenixDir(), 'build', 'wxbld') + if not isDarwin and not isWindows: + BUILD_DIR = opj(phoenixDir(), 'build', 'wxbld', 'gtk3' if options.gtk3 else 'gtk2') + else: + BUILD_DIR = opj(phoenixDir(), 'build', 'wxbld') if options.build_dir: BUILD_DIR = os.path.abspath(options.build_dir) return BUILD_DIR From 4c78aa6c125a884ba35099e7df926877d2a6dc5c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 14 Aug 2017 16:12:40 -0700 Subject: [PATCH 3/7] Use separate build folders for wxPython too --- build.py | 11 +++++++---- buildtools/config.py | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 98b95539..a451c495 100755 --- a/build.py +++ b/build.py @@ -1404,10 +1404,13 @@ def cmd_build_py(options, args): build_options.append('--jobs=%s' % options.jobs) if options.relwithdebug: build_options.append('--msvc_relwithdebug') - if options.gtk2: - build_options.append('--gtk2') - if options.gtk3: - build_options.append('--gtk3') + if not isDarwin and not isWindows: + if options.gtk2: + build_options.append('--gtk2') + wafBuildDir = posixjoin(wafBuildBase, 'gtk2') + if options.gtk3: + build_options.append('--gtk3') + wafBuildDir = posixjoin(wafBuildBase, 'gtk3') build_options.append('--python="%s"' % PYTHON) build_options.append('--out=%s' % wafBuildDir) # this needs to be the last option diff --git a/buildtools/config.py b/buildtools/config.py index 079a561f..c4acfc85 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -50,7 +50,7 @@ class Configuration(object): # wx-config command will be assembled based on version, port, # etc. and it will be looked for on the default $PATH. - WXPORT = 'gtk2' + WXPORT = 'gtk3' # On Linux/Unix there are several ports of wxWidgets available. # Setting this value lets you select which will be used for the # wxPython build. Possibilities are 'gtk', 'gtk2', 'gtk3' and 'x11'. @@ -351,6 +351,8 @@ class Configuration(object): def parseCmdLine(self): self.debug = '--debug' in sys.argv or '-g' in sys.argv + if '--gtk2' in sys.argv: + self.WXPORT = 'gtk2' if '--gtk3' in sys.argv: self.WXPORT = 'gtk3' From 0c5d2317730fb968a83d92bc48da83639f7fe91b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Aug 2017 14:53:14 -0700 Subject: [PATCH 4/7] Add gtk3 packages to the Travis config --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 087f3775..f55655ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,9 @@ addons: - freeglut3 - freeglut3-dev - libnotify-dev + - libsm-dev + - libgtk-3-dev + - libwebkitgtk-3.0-dev install: From d50d295017d0c28850eab455aac57d0a769c2544 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Aug 2017 18:45:10 -0700 Subject: [PATCH 5/7] rewrap to narrower lines in the comment --- .github/pull_request_template.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 907896c2..96d2e16d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,7 @@ - From c1b24c9e25891613752ad6e4112e4b919840eb85 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Aug 2017 20:25:42 -0700 Subject: [PATCH 6/7] Just build on Trusty for now. --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f55655ce..f715ed84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,18 +10,10 @@ matrix: dist: trusty sudo: required python: 2.7 - - os: linux - dist: precise - sudo: required - python: 2.7 - os: linux dist: trusty sudo: required python: 3.4 - - os: linux - dist: precise - sudo: required - python: 3.4 # redundant specification of `sudo` and `python` because of travis-ci.org's way of parsing `.travis.yml` # Available build steps: From 0257517f2bfae99d6cccb3136b2992436a58aa5e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 15 Aug 2017 19:41:18 -0700 Subject: [PATCH 7/7] Add items for some recent changes that didn't include change descriptions --- CHANGES.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 25aef043..4aa587fa 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -30,7 +30,12 @@ Changes in this release include the following: * New tool wxget, (a minimal wx implementation of wget) -* New tools wxdocs & wxdemos to launch the respective items fetching & unpacking as required. +* New tools wxdocs and wxdemos to launch the respective items fetching and + unpacking as required. (#437) + +* Fixes to ensure that the locale message catalogs are included in the + release files. (#464) +