From 5e85c0e221bc4af2f127537c066c4873cc91ebb7 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 17 Feb 2024 01:40:49 +0100 Subject: [PATCH 1/3] add setup support for aarch64 --- setup.py | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index c16a8285..963c0614 100755 --- a/setup.py +++ b/setup.py @@ -18,22 +18,32 @@ url_repo_qt_fmt = "https://download.qt.io/online/qtsdkrepository/{os}_{arch}/desktop/qt{ver_maj}_{ver_concat}/" -os_map = {"Linux": "linux", - "Windows": "windows", - "Darwin": "mac"} - -arch_map = {"i386": "x86", - "i686": "x86", - "x86": "x86", - "x86_64": "x64", - "AMD64": "x64"} - -os_compiler = {"Linux": "gcc", - "Windows": "msvc2019", - "Darwin": "clang"} - -arch_bits = {"x86": "32", - "x64": "64"} +os_map = { + "Linux": "linux", + "Windows": "windows", + "Darwin": "mac", +} + +arch_map = { + "i386": "x86", + "i686": "x86", + "x86": "x86", + "x86_64": "x64", + "AMD64": "x64", + "aarch64": "arm64", +} + +os_compiler = { + "Linux": "gcc", + "Windows": "msvc2019", + "Darwin": "clang", +} + +arch_bits = { + "x86": "32", + "x64": "64", + "arm64": "64", +} def download_check_fail(url, expected_type): print("download URL:", url, flush=True) From 6b2d30fa92bd8f18cf2ec66afde0de1306c77d2b Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 17 Feb 2024 02:00:32 +0100 Subject: [PATCH 2/3] check found modules --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 963c0614..a1581fdb 100755 --- a/setup.py +++ b/setup.py @@ -191,6 +191,9 @@ def qt_download_check_extract(cfg, dir_install): if archive_name.startswith(module_name): archives_match.append([package_name, data["version"], archive_name]) + if not archives_match: + raise RuntimeError(f"no matches for Qt modules ({cfg['versions']['qt_modules']}) found") + for package_name, package_version, archive_name in archives_match: url_archive = base_url+'/'+package_name+'/'+package_version+archive_name From 0cbc0555faacea89b3903049fe3036c2760e9634 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 17 Feb 2024 02:29:36 +0100 Subject: [PATCH 3/3] replace compiler mapping with toolchain --- setup.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index a1581fdb..5c9d613c 100755 --- a/setup.py +++ b/setup.py @@ -33,16 +33,18 @@ "aarch64": "arm64", } -os_compiler = { - "Linux": "gcc", - "Windows": "msvc2019", - "Darwin": "clang", -} - -arch_bits = { - "x86": "32", - "x64": "64", - "arm64": "64", +os_arch_toolchain = { + "linux": { + "x64": "gcc_64", + "arm64": "linux_gcc_arm64", + }, + "windows": { + "x64": "win64_msvc2019_64", + "arm64": "win64_msvc2019_arm64", + }, + "mac": { + "x64": "clang_64", + }, } def download_check_fail(url, expected_type): @@ -156,21 +158,16 @@ def qt_download_check_extract(cfg, dir_install): metadata = ElementTree.fromstring(r.text) - compiler_bits = os_compiler[cfg['os']]+"_"+arch_bits[sys_arch] - - if cfg['os'] == "Windows": - compiler = "win"+arch_bits[sys_arch]+"_"+compiler_bits - else: - compiler = compiler_bits + toolchain = os_arch_toolchain[sys_os][sys_arch] base_package_name = "qt.qt{ver_maj}.{ver_concat}.{compiler}".format( ver_maj = ver_maj, ver_concat = ver_concat, - compiler = compiler) + compiler = toolchain) extra_package_name = "qt.qt{ver_maj}.{ver_concat}.{module}.{compiler}".format( ver_maj = ver_maj, ver_concat = ver_concat, module = "{module}", - compiler = compiler) + compiler = toolchain) extra_package_names = list() for module in cfg['versions']['qt_modules']: