aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/platform/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/platform/base.py')
-rw-r--r--python/servo/platform/base.py51
1 files changed, 16 insertions, 35 deletions
diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py
index a3909d08c11..7cb1a9b0996 100644
--- a/python/servo/platform/base.py
+++ b/python/servo/platform/base.py
@@ -23,30 +23,6 @@ class Base:
self.is_linux = False
self.is_macos = False
- def set_gstreamer_environment_variables_if_necessary(
- self, env: Dict[str, str], cross_compilation_target: Optional[str], check_installation=True
- ):
- # We may not need to update environment variables if GStreamer is installed
- # for the system on Linux.
- gstreamer_root = self.gstreamer_root(cross_compilation_target)
- if gstreamer_root:
- util.prepend_paths_to_env(env, "PATH", os.path.join(gstreamer_root, "bin"))
- util.prepend_paths_to_env(
- env, "PKG_CONFIG_PATH", os.path.join(gstreamer_root, "lib", "pkgconfig")
- )
- util.prepend_paths_to_env(
- env,
- self.library_path_variable_name(),
- os.path.join(gstreamer_root, "lib"),
- )
- env["GST_PLUGIN_SCANNER"] = os.path.join(
- gstreamer_root,
- "libexec",
- "gstreamer-1.0",
- f"gst-plugin-scanner{self.executable_suffix()}",
- )
- env["GST_PLUGIN_SYSTEM_PATH"] = os.path.join(gstreamer_root, "lib", "gstreamer-1.0")
-
def gstreamer_root(self, _cross_compilation_target: Optional[str]) -> Optional[str]:
raise NotImplementedError("Do not know how to get GStreamer path for platform.")
@@ -65,18 +41,23 @@ class Base:
)
def is_gstreamer_installed(self, cross_compilation_target: Optional[str]) -> bool:
- env = os.environ.copy()
- self.set_gstreamer_environment_variables_if_necessary(
- env, cross_compilation_target, check_installation=False)
- return (
- subprocess.call(
- ["pkg-config", "--atleast-version=1.18", "gstreamer-1.0"],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=env,
+ gstreamer_root = self.gstreamer_root(cross_compilation_target)
+ if gstreamer_root:
+ pkg_config = os.path.join(gstreamer_root, "bin", "pkg-config")
+ else:
+ pkg_config = "pkg-config"
+
+ try:
+ return (
+ subprocess.call(
+ [pkg_config, "--atleast-version=1.18", "gstreamer-1.0"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ == 0
)
- == 0
- )
+ except FileNotFoundError:
+ return False
def bootstrap(self, force: bool):
installed_something = self._platform_bootstrap(force)