diff options
Diffstat (limited to 'python/servo/platform/macos.py')
-rw-r--r-- | python/servo/platform/macos.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/python/servo/platform/macos.py b/python/servo/platform/macos.py index de20fe35ad5..a1655dc613e 100644 --- a/python/servo/platform/macos.py +++ b/python/servo/platform/macos.py @@ -14,6 +14,7 @@ from typing import Optional from .. import util from .base import Base +from .build_target import BuildTarget URL_BASE = "https://github.com/servo/servo-build-deps/releases/download/macOS" GSTREAMER_PLUGIN_VERSION = "1.22.3" @@ -27,15 +28,15 @@ class MacOS(Base): super().__init__(*args, **kwargs) self.is_macos = True - def gstreamer_root(self, cross_compilation_target: Optional[str]) -> Optional[str]: + def gstreamer_root(self, target: BuildTarget) -> Optional[str]: # We do not support building with gstreamer while cross-compiling on MacOS. - if cross_compilation_target or not os.path.exists(GSTREAMER_ROOT): + if target.is_cross_build() or not os.path.exists(GSTREAMER_ROOT): return None return GSTREAMER_ROOT - def is_gstreamer_installed(self, cross_compilation_target: Optional[str]) -> bool: + def is_gstreamer_installed(self, target: BuildTarget) -> bool: # Servo only supports the official GStreamer distribution on MacOS. - return not cross_compilation_target and os.path.exists(GSTREAMER_ROOT) + return not target.is_cross_build() and os.path.exists(GSTREAMER_ROOT) def _platform_bootstrap(self, _force: bool) -> bool: installed_something = False @@ -49,11 +50,12 @@ class MacOS(Base): except subprocess.CalledProcessError as e: print("Could not run homebrew. Is it installed?") raise e - installed_something |= self._platform_bootstrap_gstreamer(False) + target = BuildTarget.from_triple(None) + installed_something |= self._platform_bootstrap_gstreamer(target, False) return installed_something - def _platform_bootstrap_gstreamer(self, force: bool) -> bool: - if not force and self.is_gstreamer_installed(cross_compilation_target=None): + def _platform_bootstrap_gstreamer(self, target: BuildTarget, force: bool) -> bool: + if not force and self.is_gstreamer_installed(target): return False with tempfile.TemporaryDirectory() as temp_dir: @@ -78,5 +80,5 @@ class MacOS(Base): ] ) - assert self.is_gstreamer_installed(cross_compilation_target=None) + assert self.is_gstreamer_installed(target) return True |