From 2e9b9c7399c8acd74fc477ef8eae3d7a43e9c8e6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 10 Aug 2015 22:50:53 -0700 Subject: [PATCH] Use either 32bit or 64bit builds of SIP on linux --- bin/build-sip-posix | 2 +- build.py | 15 ++++++++------- buildtools/config.py | 9 +++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/bin/build-sip-posix b/bin/build-sip-posix index 5100b1f5..c2a3c028 100755 --- a/bin/build-sip-posix +++ b/bin/build-sip-posix @@ -15,7 +15,7 @@ MYBINDIR=$(dirname $(readlink -f $0)) cd $PROJECTS/sip/sip SIPVER=`$PYTHON configure.py --version | grep -v "This is SIP"` -PLATFORM=`$PYTHON -c "import sys; platform = 'linux' if sys.platform.startswith('linux') else sys.platform; print(platform)"` +PLATFORM=`$PYTHON -c "import buildtools.config as bc; print(bc.getToolsPlatformName(True))"` echo $PLATFORM if [ "$PLATFORM" = "darwin" ]; then diff --git a/build.py b/build.py index 46c41c6e..9c9225c3 100755 --- a/build.py +++ b/build.py @@ -61,9 +61,10 @@ wxICON = 'docs/sphinx/_static/images/sphinxdocs/mondrian.png' # MD5s of the tool binaries currently in use. sipCurrentVersion = '4.16.7' sipMD5 = { - 'darwin' : '29874bb82327e556554e3ca8ddf8fa16', - 'win32' : 'd19030b397034742694a6d229f056ad0', - 'linux' : '6f70956abd8f837b1d55dc5cfa9f6201', + 'darwin' : '29874bb82327e556554e3ca8ddf8fa16', + 'win32' : 'd19030b397034742694a6d229f056ad0', + 'linux32' : '6f70956abd8f837b1d55dc5cfa9f6201', + 'linux64' : '6ac7653c331462516abbc38c5b93e0ac', } wafCurrentVersion = '1.7.15-p1' @@ -463,7 +464,7 @@ def delFiles(fileList, verbose=True): os.remove(afile) -def getTool(cmdName, version, MD5, envVar, platformBinary): +def getTool(cmdName, version, MD5, envVar, platformBinary, linuxBits=False): # Check in the bin dir for the specified version of the tool command. If # it's not there then attempt to download it. Validity of the binary is # checked with an MD5 hash. @@ -473,7 +474,7 @@ def getTool(cmdName, version, MD5, envVar, platformBinary): else: # setup if platformBinary: - platform = 'linux' if sys.platform.startswith('linux') else sys.platform + platform = getToolsPlatformName(linuxBits) ext = '' if platform == 'win32': ext = '.exe' @@ -549,7 +550,7 @@ def getTool(cmdName, version, MD5, envVar, platformBinary): # Recursive call so the MD5 value will be double-checked on what was # just downloaded - return getTool(cmdName, version, MD5, envVar, platformBinary) + return getTool(cmdName, version, MD5, envVar, platformBinary, linuxBits) @@ -559,7 +560,7 @@ _sipCmd = None def getSipCmd(): global _sipCmd if _sipCmd is None: - _sipCmd = getTool('sip', sipCurrentVersion, sipMD5, 'SIP', True) + _sipCmd = getTool('sip', sipCurrentVersion, sipMD5, 'SIP', True, True) return _sipCmd diff --git a/buildtools/config.py b/buildtools/config.py index 947eb5d2..1232afe5 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -20,6 +20,7 @@ import tempfile import shutil import codecs import subprocess +import platform from distutils.file_util import copy_file from distutils.dir_util import mkpath @@ -869,3 +870,11 @@ def getSOName(filename): return result.group(1) return None + +def getToolsPlatformName(useLinuxBits=False): + name = sys.platform + if name.startswith('linux'): + name = 'linux' + if useLinuxBits: + name += platform.architecture()[0][:2] + return name