mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-17 04:34:37 +03:00
Override host/target for src/docs if Qt >= 6.7.0 (#776)
* Override host/target for src/docs if Qt >= 6.7.0 Fixes https://github.com/miurahr/aqtinstall/issues/775
This commit is contained in:
@@ -377,9 +377,14 @@ class QtArchives:
|
||||
self._append_tool_update(os_target_folder, update_xml, arch, None)
|
||||
|
||||
def _get_archives_base(self, name, target_packages):
|
||||
os_name = self.os_name
|
||||
if self.os_name == "windows":
|
||||
os_name += "_x86"
|
||||
elif os_name != "linux_arm64" and os_name != "all_os":
|
||||
os_name += "_x64"
|
||||
os_target_folder = posixpath.join(
|
||||
"online/qtsdkrepository",
|
||||
self.os_name + ("_x86" if self.os_name == "windows" else ("" if self.os_name == "linux_arm64" else "_x64")),
|
||||
os_name,
|
||||
self.target,
|
||||
# tools_ifw/
|
||||
name,
|
||||
|
||||
@@ -481,6 +481,10 @@ class Cli:
|
||||
else:
|
||||
qt_version = args.qt_version
|
||||
Cli._validate_version_str(qt_version)
|
||||
# Override target/os for recent Qt
|
||||
if Version(qt_version) in SimpleSpec(">=6.7.0"):
|
||||
target = "qt"
|
||||
os_name = "all_os"
|
||||
if args.timeout is not None:
|
||||
timeout = (args.timeout, args.timeout)
|
||||
else:
|
||||
@@ -673,11 +677,16 @@ class Cli:
|
||||
show_list(meta)
|
||||
|
||||
def run_list_src_doc_examples(self, args: ListArgumentParser, cmd_type: str):
|
||||
target = "desktop" # The only valid target for src/doc/examples is "desktop"
|
||||
target = "desktop"
|
||||
version = Cli._determine_qt_version(args.qt_version_spec, args.host, target, arch="")
|
||||
if version >= Version("6.7.0"):
|
||||
target = "qt"
|
||||
host = "all_os"
|
||||
else:
|
||||
host = args.host
|
||||
is_fetch_modules: bool = getattr(args, "modules", False)
|
||||
meta = MetadataFactory(
|
||||
archive_id=ArchiveId("qt", args.host, target),
|
||||
archive_id=ArchiveId("qt", host, target),
|
||||
src_doc_examples_query=MetadataFactory.SrcDocExamplesQuery(cmd_type, version, is_fetch_modules),
|
||||
)
|
||||
show_list(meta)
|
||||
|
||||
@@ -199,12 +199,13 @@ def get_semantic_version(qt_ver: str, is_preview: bool) -> Optional[Version]:
|
||||
|
||||
class ArchiveId:
|
||||
CATEGORIES = ("tools", "qt")
|
||||
HOSTS = ("windows", "mac", "linux", "linux_arm64")
|
||||
HOSTS = ("windows", "mac", "linux", "linux_arm64", "all_os")
|
||||
TARGETS_FOR_HOST = {
|
||||
"windows": ["android", "desktop", "winrt"],
|
||||
"mac": ["android", "desktop", "ios"],
|
||||
"linux": ["android", "desktop"],
|
||||
"linux_arm64": ["desktop"],
|
||||
"all_os": ["qt"],
|
||||
}
|
||||
EXTENSIONS_REQUIRED_ANDROID_QT6 = {"x86_64", "x86", "armv7", "arm64_v8a"}
|
||||
ALL_EXTENSIONS = {"", "wasm", "src_doc_examples", *EXTENSIONS_REQUIRED_ANDROID_QT6}
|
||||
@@ -232,7 +233,7 @@ class ArchiveId:
|
||||
def to_url(self) -> str:
|
||||
return "online/qtsdkrepository/{os}{arch}/{target}/".format(
|
||||
os=self.host,
|
||||
arch=("_x86" if self.host == "windows" else ("" if self.host == "linux_arm64" else "_x64")),
|
||||
arch=("_x86" if self.host == "windows" else ("" if self.host in ("linux_arm64", "all_os") else "_x64")),
|
||||
target=self.target,
|
||||
)
|
||||
|
||||
@@ -868,8 +869,9 @@ class MetadataFactory:
|
||||
|
||||
def fetch_modules_sde(self, cmd_type: str, version: Version) -> List[str]:
|
||||
"""Returns list of modules for src/doc/examples"""
|
||||
assert (
|
||||
cmd_type in ("doc", "examples") and self.archive_id.target == "desktop"
|
||||
assert cmd_type in ("doc", "examples") and self.archive_id.target in (
|
||||
"desktop",
|
||||
"qt",
|
||||
), "Internal misuse of fetch_modules_sde"
|
||||
qt_ver_str = self._get_qt_version_str(version)
|
||||
modules_meta = self._fetch_module_metadata(self.archive_id.to_folder(qt_ver_str, "src_doc_examples"))
|
||||
@@ -885,8 +887,9 @@ class MetadataFactory:
|
||||
|
||||
def fetch_archives_sde(self, cmd_type: str, version: Version) -> List[str]:
|
||||
"""Returns list of archives for src/doc/examples"""
|
||||
assert (
|
||||
cmd_type in ("src", "doc", "examples") and self.archive_id.target == "desktop"
|
||||
assert cmd_type in ("src", "doc", "examples") and self.archive_id.target in (
|
||||
"desktop",
|
||||
"qt",
|
||||
), "Internal misuse of fetch_archives_sde"
|
||||
return self.fetch_archives(version, cmd_type, [], is_sde=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user