diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-12 12:54:58 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-12 12:56:33 +0100 |
commit | 26c046e521c38bbfc3a263782a3bb74a7c1bf937 (patch) | |
tree | 53620f55a3c69c6a9067f3a213301f0e2c27fab0 | |
parent | e3837eabc5b01d49c79dcf968fce965b5e22ac2f (diff) | |
parent | 73594da7ba14a5847e14ab871adb5b9ffe3d10dd (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.9
Change-Id: I18387b329e61646e8d68e678140b533281e359cd
-rw-r--r-- | setup.py | 46 | ||||
-rw-r--r-- | testing/command.py | 8 | ||||
-rw-r--r-- | utils.py | 23 |
3 files changed, 77 insertions, 0 deletions
@@ -201,6 +201,8 @@ from utils import init_msvc_env from utils import regenerate_qt_resources from utils import filter_match from utils import osx_fix_rpaths_for_library +from utils import download_and_extract_7z +from textwrap import dedent # guess a close folder name for extensions def get_extension_folder(ext): @@ -261,6 +263,7 @@ OPTION_MODULE_SUBSET = option_value("module-subset") OPTION_RPATH_VALUES = option_value("rpath") OPTION_QT_CONF_PREFIX = option_value("qt-conf-prefix") OPTION_QT_SRC = option_value("qt-src-dir") +OPTION_ICULIB = option_value("iculib-url") if OPTION_QT_VERSION is None: OPTION_QT_VERSION = "5" @@ -322,6 +325,14 @@ if OPTION_JOBS: else: OPTION_JOBS = '' +if OPTION_ICULIB: + if not OPTION_STANDALONE: + print("--iculib-url is usable only when creating standalone wheel with --standalone switch") + sys.exit(1) + if sys.platform != "linux": + print("--iculib-url is usable only when creating standalone wheels in Linux") + sys.exit(1) + # Show available versions if OPTION_LISTVERSIONS: for v in submodules: @@ -1143,6 +1154,41 @@ class pyside_build(_build): def prepare_standalone_package_linux(self, executables, vars): built_modules = vars['built_modules'] + def _print_warn(): + print(dedent("""\ + *********************************************************** + If one is using Qt binaries provided by QtCompany's CI, + those aren't working as expected! + *********************************************************** + """)) + + # To get working QtCompany Qt CI binaries we have to extract the ICU libs + # If no link provided we'll use the libs from qt-project + icuUrl = "" + if OPTION_ICULIB: + icuUrl = OPTION_ICULIB + else: + qt_version = self.qtinfo.version + url_pre = "http://master.qt.io/development_releases/prebuilt/icu/prebuilt/" + if qt_version.startswith("5.6"): + icuUrl = url_pre + "56.1/icu-linux-g++-Rhel6.6-x64.7z" + else: + icuUrl = url_pre + "56.1/icu-linux-g++-Rhel7.2-x64.7z" + + if find_executable("7z"): + try: + download_and_extract_7z(icuUrl, "{qt_lib_dir}".format(**vars)) + except RuntimeError as e: + # The Qt libs now requires patching to system ICU + # OR it is possible that Qt was built without ICU and + # Works as such + print("Failed to download and extract %s" % icuUrl) + print(str(e)) + _print_warn() + else: + print("Install 7z into PATH to extract ICU libs") + _print_warn() + # <qt>/lib/* -> <setup>/PySide2/Qt/lib copydir("{qt_lib_dir}", "{dist_dir}/PySide2/Qt/lib", filter=[ diff --git a/testing/command.py b/testing/command.py index 67dd05a03..dd348432c 100644 --- a/testing/command.py +++ b/testing/command.py @@ -96,6 +96,14 @@ if (os.environ.get("COIN_RERUN_FAILED_ONLY", "1").lower() in def test_project(project, args, blacklist, runs): ret = [] + + # remove files from a former run + for idx in range(runs): + index = idx + 1 + runner = TestRunner(builds.selected, project, index) + if os.path.exists(runner.logfile) and not args.skip: + os.unlink(runner.logfile) + # now start the real run for idx in range(runs): index = idx + 1 runner = TestRunner(builds.selected, project, index) @@ -49,6 +49,11 @@ import fnmatch import glob import itertools import popenasync +# There is no urllib.request in Python2 +try: + import urllib.request as urllib +except ImportError: + import urllib from distutils import log from distutils.errors import DistutilsOptionError @@ -748,3 +753,21 @@ def detectClang(): arch = '64' if sys.maxsize > 2**31-1 else '32' clangDir = clangDir.replace('_ARCH_', arch) return (clangDir, source) + +def download_and_extract_7z(fileurl, target): + """ Downloads 7z file from fileurl and extract to target """ + + print("Downloading fileUrl %s " % fileurl) + info = "" + try: + localfile, info = urllib.urlretrieve(fileurl) + except: + print("Error downloading %r : %r" % (fileurl, info)) + raise RuntimeError(' Error downloading ' + fileurl) + + try: + outputDir = "-o" + target + print("calling 7z x %s %s" % (localfile, outputDir)) + subprocess.call(["7z", "x", "-y", localfile, outputDir]) + except: + raise RuntimeError(' Error extracting ' + localfile) |