|author||Alexandru Croitor <email@example.com>||2018-02-21 15:07:54 +0100|
|committer||Alexandru Croitor <firstname.lastname@example.org>||2018-02-21 14:18:08 +0000|
Fix setup.py install to work on macOS
This change amends e0a4372160d9b1ab1550589784cc456b93d28cab to allow running setup.py install without getting exceptions from distutils. Specifically the problem was that distutils did some additional checks to make sure that plat_name == get_platform(), which will not be the case because of the modified minimum deployment target. The fix is to disable that check via a flag. Change-Id: I066c0d4b7a6b27fceaf094c15bace7aba3c873bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'setup.py')
1 files changed, 16 insertions, 0 deletions
@@ -500,6 +500,22 @@ class pyside_install(_install):
def _init(self, *args, **kwargs):
_install.__init__(self, *args, **kwargs)
+ def initialize_options (self):
+ if sys.platform == 'darwin':
+ # Because we change the plat_name to include a correct deployment target on macOS
+ # distutils thinks we are cross-compiling, and throws an exception when trying to
+ # execute setup.py install.
+ # The check looks like this
+ #if self.warn_dir and build_plat != get_platform():
+ # raise DistutilsPlatformError("Can't install when "
+ # "cross-compiling")
+ # Obviously get_platform will return the old deployment target.
+ # The fix is to disable the warn_dir flag, which was created for bdist_* derived classes
+ # to override, for similar cases.
+ self.warn_dir = False
log.info('*** Install completed')