diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 6333e23cc0..239c7ae3e6 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -19,7 +19,7 @@ class LibInstaller: DARWIN_TARGET_X64="darwin_17" # macOS 10.13 - DARWIN_TARGET_ARM64="darwin_20" # macOS 11.x + DARWIN_TARGET_ARM64="darwin_21" # macOS 12.x def __init__(self, arch): self._queue = [] @@ -44,6 +44,18 @@ def get_latest_pkg_filename_url(self, pkg_name): pkg_base_url = f'{MIRROR}/{pkg_name}' pkg_list = urlopen(pkg_base_url).read().decode('utf-8') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) + + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.' + self._arch + r'\.tbz2', pkg_list) + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.noarch\.tbz2', pkg_list) + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.noarch\.tbz2', pkg_list) + + if len(pkgs) < 1: + print(f' [*] [ERROR] Unable to find version of {pkg_name} compatible with {self._darwin_target}.{self._arch}') + exit(1) + pkg_filename = pkgs[-1] return pkg_filename, f'{pkg_base_url}/{pkg_filename}'