Skip to content

Commit 6a0bcae

Browse files
committed
Include all Qt .exe
1 parent 1163f50 commit 6a0bcae

File tree

2 files changed

+55
-20
lines changed

2 files changed

+55
-20
lines changed

build.py

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,66 @@ def main():
4343
python-tag = {python_tag}
4444
plat-name = {plat_name}'''.format(**locals()))
4545

46-
designer_path = os.path.join(qt_bin_path, 'designer.exe')
47-
designer_destination = os.path.join('pyqt5-tools', 'designer')
48-
os.makedirs(designer_destination, exist_ok=True)
49-
shutil.copy(designer_path, designer_destination)
46+
applications = []
47+
for file in os.listdir(qt_bin_path):
48+
base, ext = os.path.splitext(file)
49+
if ext == '.exe':
50+
applications.append(file)
51+
52+
destination = 'pyqt5-tools'
53+
os.makedirs(destination, exist_ok=True)
54+
55+
windeployqt_path = os.path.join(qt_bin_path, 'windeployqt.exe'),
56+
57+
for file in applications:
58+
print("\n\n - - - Copying {} and it's dependencies".format(file))
59+
file_path = os.path.join(qt_bin_path, file)
60+
shutil.copy(file_path, destination)
61+
62+
windeployqt = subprocess.Popen(
63+
[
64+
windeployqt_path,
65+
os.path.basename(file_path)
66+
],
67+
cwd=destination
68+
)
69+
windeployqt.wait(timeout=15)
70+
if windeployqt.returncode != 0:
71+
print('\n\nwindeployqt failed with return code {}\n\n'
72+
.format(windeployqt.returncode))
73+
74+
# application_paths = [
75+
# 'assistant.exe',
76+
# 'designer.exe',
77+
# 'linguist.exe'
78+
# ]
79+
80+
81+
# for application in application_paths:
82+
# application_path = os.path.join(qt_bin_path, application)
83+
# os.makedirs(destination, exist_ok=True)
84+
# shutil.copy(application_path, destination)
85+
86+
# windeployqt = subprocess.Popen(
87+
# [
88+
# windeployqt_path,
89+
# os.path.basename(application)
90+
# ],
91+
# cwd=destination
92+
# )
93+
# windeployqt.wait(timeout=15)
94+
# if windeployqt.returncode != 0:
95+
# raise Exception('windeployqt failed with return code {}'
96+
# .format(winqtdeploy.returncode))
97+
5098
designer_plugin_path = os.path.join('${SYSROOT}', 'pyqt5-install', 'designer', 'pyqt5.dll')
5199
designer_plugin_path = os.path.expandvars(designer_plugin_path)
52-
designer_plugin_destination = os.path.join(designer_destination, 'plugins', 'designer')
100+
designer_plugin_destination = os.path.join(destination, 'plugins', 'designer')
53101
os.makedirs(designer_plugin_destination, exist_ok=True)
54102
shutil.copy(designer_plugin_path, designer_plugin_destination)
55103
shutil.copy(os.path.join('..', 'PyQt5_gpl-5.7-designer', 'LICENSE'),
56104
os.path.join('pyqt5-tools', 'LICENSE.pyqt5'))
57105

58-
windeployqt_path = os.path.join(qt_bin_path, 'windeployqt.exe'),
59-
windeployqt = subprocess.Popen(
60-
[
61-
windeployqt_path,
62-
os.path.basename(designer_path)
63-
],
64-
cwd=designer_destination
65-
)
66-
windeployqt.wait(timeout=15)
67-
if windeployqt.returncode != 0:
68-
raise Exception('windeployqt failed with return code {}'
69-
.format(winqtdeploy.returncode))
70-
71106
# Since windeployqt doesn't actually work with --compiler-runtime,
72107
# copy it ourselves
73108
plat = {32: 'x86', 64: 'x64'}[bits]
@@ -80,7 +115,7 @@ def main():
80115
'vcruntime140.dll'
81116
]
82117
for file in redist_files:
83-
dest = os.path.join(designer_destination, file)
118+
dest = os.path.join(destination, file)
84119
shutil.copyfile(os.path.join(redist_path, file), dest)
85120
os.chmod(dest, stat.S_IWRITE)
86121

buildinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'.'.join([str(v) for v in version_numbers])
6363
+ status.prerelease_suffix
6464
# TODO: this is totally cheating, revisit the revision scheme
65-
+ '9'# prerelease_str
65+
+ '10'# prerelease_str
6666
)
6767

6868
directories = [

0 commit comments

Comments
 (0)