From 73594da7ba14a5847e14ab871adb5b9ffe3d10dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Tue, 28 Nov 2017 14:07:48 +0200 Subject: Extract iculibs for linux standalone wheel When creating PIP wheel for linux from Qt CI binaries we have to include ICU libs among Qt binaries. Change-Id: I30adf7041784cf3558c064d6ab6ad295ed1f5551 Reviewed-by: Christian Tismer Reviewed-by: Alexandru Croitor --- utils.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'utils.py') diff --git a/utils.py b/utils.py index 444cbfbfa..396b79cb9 100644 --- a/utils.py +++ b/utils.py @@ -9,6 +9,11 @@ import subprocess import fnmatch 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 @@ -657,4 +662,20 @@ def osx_add_qt_rpath(library_path, qt_lib_dir, back_tick('install_name_tool -add_rpath {rpath} {library_path}'.format( rpath=qt_lib_dir, library_path=library_path)) +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) -- cgit v1.2.3