Skip to content

Commit

Permalink
build: Skip Python install when fetching macOS deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Sep 4, 2021
1 parent f0087dc commit 933d34e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/download-macos-libs.py
Expand Up @@ -84,10 +84,17 @@ def verify_pkg(self, pkg_path, sig_path):
f'-signature "{sig_path}" "{pkg_path}"',
shell=True, check=True)

def is_pkg_skipped(self, pkg_name):
return pkg_name.startswith('python')

def install_pkg(self, pkg_name):
if self.is_pkg_installed(pkg_name):
return

if self.is_pkg_skipped(pkg_name):
print(f'[*] Skipping package {pkg_name}')
return

print(f'[*] Fetching {pkg_name}')
pkg_filename, pkg_url = self.get_latest_pkg_filename_url(pkg_name)
pkg_version = re.match(r'^[\w_]+-([\w\.\-\_\+]*?)\.' + self._darwin_target, pkg_filename).groups(1)[0]
Expand All @@ -109,10 +116,6 @@ def install_pkg(self, pkg_name):
print(f' [>] {dep}')
dep = dep.split('-')[0]
self._queue.append(dep)
for dep in re.findall(r'@pkgdep (.+)', pkg_contents_file):
print(f' [>] {dep}')
dep = dep.split('-')[0]
self._queue.append(dep)

print(f' [*] Checking tarball...')

Expand All @@ -124,6 +127,7 @@ def install_pkg(self, pkg_name):
tb.extractall(self._extract_path, numeric_owner=True)

for fpath in tb.getnames():
# FIXME: Symlinks
extracted_path = os.path.realpath(os.path.join(self._extract_path, fpath))
if extracted_path.endswith('.pc'):
print(f' [*] Fixing {extracted_path}')
Expand Down

0 comments on commit 933d34e

Please sign in to comment.