Skip to content

Commit

Permalink
build: Update arm64 target, handle target/arch independent pkg names
Browse files Browse the repository at this point in the history
  • Loading branch information
faha223 authored Mar 10, 2024
1 parent 03f40b1 commit a1e9c4a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/download-macos-libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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}'

Expand Down

0 comments on commit a1e9c4a

Please sign in to comment.