aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/gstreamer.py
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2024-08-26 18:38:21 +0530
committerGitHub <noreply@github.com>2024-08-26 13:08:21 +0000
commitb6d5ac09b0b2acbb0f5b00232e53d0111a159063 (patch)
tree18842738e78794ba096a0af44b16d37695cff6d7 /python/servo/gstreamer.py
parent4397d8a02156a009d16d8b79796b1e54ca635624 (diff)
downloadservo-b6d5ac09b0b2acbb0f5b00232e53d0111a159063.tar.gz
servo-b6d5ac09b0b2acbb0f5b00232e53d0111a159063.zip
mach: introduce `BuildTarget` abstraction (#33114)
Introduce a new `BuildTarget` abstraction to centralize the code for supporting different ways of choosing the build target (e.g --android, --target x86_64-linux-android , --target aarch64-linux-ohos). This is currently handled in an adhoc fashion in different commands ( mach package, install, run) leading to a proliferation of keyword parameters for the commands and duplicated logic. The patch introduces a new `allow_target_configuration` decorator to do the validation and parsing of these parameters into the appropriate `BuildTarget` subclass, which is now stored as an instance attribute of the CommandBase class. All the code that previously relied on `self.cross_compile_target` has been switched to use the BuildTarget. Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'python/servo/gstreamer.py')
-rw-r--r--python/servo/gstreamer.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/servo/gstreamer.py b/python/servo/gstreamer.py
index fea93660dbb..72b80edbf4a 100644
--- a/python/servo/gstreamer.py
+++ b/python/servo/gstreamer.py
@@ -13,6 +13,11 @@ import subprocess
import sys
from typing import Set
+# This file is called as a script from components/servo/build.rs, so
+# we need to explicitly modify the search path here.
+sys.path[0:0] = [os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))]
+from servo.platform.build_target import BuildTarget # noqa: E402
+
GSTREAMER_BASE_LIBS = [
# gstreamer
"gstbase",
@@ -242,7 +247,7 @@ def find_non_system_dependencies_with_otool(binary_path: str) -> Set[str]:
return output
-def package_gstreamer_dylibs(binary_path: str, library_target_directory: str, cross_compilation_target: str = None):
+def package_gstreamer_dylibs(binary_path: str, library_target_directory: str, target: BuildTarget):
"""Copy all GStreamer dependencies to the "lib" subdirectory of a built version of
Servo. Also update any transitive shared library paths so that they are relative to
this subdirectory."""
@@ -250,7 +255,7 @@ def package_gstreamer_dylibs(binary_path: str, library_target_directory: str, cr
# This import only works when called from `mach`.
import servo.platform
- gstreamer_root = servo.platform.get().gstreamer_root(cross_compilation_target)
+ gstreamer_root = servo.platform.get().gstreamer_root(target)
gstreamer_version = servo.platform.macos.GSTREAMER_PLUGIN_VERSION
gstreamer_root_libs = os.path.join(gstreamer_root, "lib")