path: root/setup.py
diff options
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-02-21 15:07:54 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-02-21 14:18:08 +0000
commit011b6ad1987f0dee3035e9803ece9fb2c1a0a1b2 (patch)
tree159640e58bd1184b4d2dd6de537a33ee631b2f98 /setup.py
parente0a4372160d9b1ab1550589784cc456b93d28cab (diff)
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
diff --git a/setup.py b/setup.py
index fc9b49255..523cb9a0d 100644
--- a/setup.py
+++ b/setup.py
@@ -500,6 +500,22 @@ class pyside_install(_install):
def _init(self, *args, **kwargs):
_install.__init__(self, *args, **kwargs)
+ def initialize_options (self):
+ _install.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
def run(self):
log.info('*** Install completed')