From f418dde5d88065fd52f731878aef3ddba3801e05 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 22 Jun 2018 22:43:44 -0700 Subject: [PATCH] Merge pull request #893 from RobinD42/fix-darwin-linking Fix darwin linking (cherry picked from commit de143e9d83df0fe9d8a7e6075120f4e90cf8fcb8) --- CHANGES.rst | 17 +++++++++++++++++ buildtools/config.py | 2 +- wscript | 14 +++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ee2009ef..c42254b1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -42,6 +42,23 @@ Other changes in this release: +4.0.3 "" +--------------------------- +* ??-June-2018 + +PyPI: https://pypi.org/project/wxPython/4.0.3 +Extras: https://extras.wxPython.org/wxPython4/extras/ +Pip: ``pip install wxPython==4.0.3`` + +Changes in this release include the following: + +* Fixed a linking problem on macOS. The new waf added an explicit link to the + Python shared library which menat that it would try to load it at runtime, + even if a different Python (such as Anaconda, EDM or Homebrew) was used to + import wxPython. This, of course, caused runtime errors. + + + 4.0.2 "Cute as a June bug!" --------------------------- * 16-June-2018 diff --git a/buildtools/config.py b/buildtools/config.py index 3fdd066f..e3cc2f0c 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -265,7 +265,7 @@ class Configuration(object): # Combine with wx's ld command and stash it in the env # where distutils will get it later. LDSHARED = self.getWxConfigValue('--ld').replace(' -o', '') + ' ' + LDSHARED - os.environ["LDSHARED"] = LDSHARED + self.LDSHARED = os.environ["LDSHARED"] = LDSHARED # wxGTK settings diff --git a/wscript b/wscript index b9227426..d7227c0b 100644 --- a/wscript +++ b/wscript @@ -308,13 +308,25 @@ def configure(conf): for key in flags: _cleanFlags(conf, key) + # Waf 2 is now calling pythonX.Y-config for fetching libs and flags, + # and it may be outputing flags that will cause an explicit link to + # Python's lib, which we don't want as that could tie us to that + # speicifc Python instance instead of the one that is loading the + # wxPython extension modules. That's okay for PYEMBED but not for PYEXT + # configs. + if isDarwin: + conf.env.LIBPATH_PYEXT = [] + conf.env.LIB_PYEXT = [] + # Use the same compilers that wxWidgets used if cfg.CC: conf.env.CC = cfg.CC.split() if cfg.CXX: conf.env.CXX = cfg.CXX.split() - + if cfg.LDSHARED: + conf.env.LINK_CC = cfg.LDSHARED.split() + conf.env.LINK_CXX = cfg.LDSHARED.split() # Some Mac-specific stuff if isDarwin: