diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-01-05 09:01:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-05 08:01:58 +0000 |
commit | 7fa4ea9740edccc93672d8cc428f6e9d4575a036 (patch) | |
tree | c45393c502ba740128e94991bf923dfc7cc95432 /python/servo/platform | |
parent | c219204084b8f8a747ebd37ec75472c1b7e97411 (diff) | |
download | servo-7fa4ea9740edccc93672d8cc428f6e9d4575a036.tar.gz servo-7fa4ea9740edccc93672d8cc428f6e9d4575a036.zip |
Upgrade media / GStreamer / GLib (#30750)
- Upgrade the version of GStreamer for Windows
This upgrades the Windows build to use the most recent version of
GStreamer. This is necessary to upgrade our GStreamer dependency.
- Stop shipping GStreamer binaries on Linux
The binary bundle of GStreamer that we package is not used to compile --
only to run layout tests. It's too old for the APIs that we are using
(as evidenced by needed 1.18 for WebRTC) and nowadays Linux
distributions carry a new version so it's unecessary for our build
machines. No longer using this binary bundle will allow us to upgrade
our GStreamer dependency -- which now has stricter checks that we
are using at least version 1.18.
- Upgrade media to use newer versions of GStreamer / GLib dependencies
Diffstat (limited to 'python/servo/platform')
-rw-r--r-- | python/servo/platform/base.py | 4 | ||||
-rw-r--r-- | python/servo/platform/linux.py | 33 | ||||
-rw-r--r-- | python/servo/platform/windows.py | 10 |
3 files changed, 21 insertions, 26 deletions
diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py index 56b527131de..eee42428e56 100644 --- a/python/servo/platform/base.py +++ b/python/servo/platform/base.py @@ -56,7 +56,7 @@ class Base: # the cross-compilation case, we might be picking it up from another directory. if check_installation and not self.is_gstreamer_installed(cross_compilation_target): raise FileNotFoundError( - "GStreamer libraries not found (>= version 1.16)." + "GStreamer libraries not found (>= version 1.18)." "Please see installation instructions in README.md" ) @@ -83,7 +83,7 @@ class Base: env, cross_compilation_target, check_installation=False) return ( subprocess.call( - ["pkg-config", "--atleast-version=1.16", "gstreamer-1.0"], + ["pkg-config", "--atleast-version=1.18", "gstreamer-1.0"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, diff --git a/python/servo/platform/linux.py b/python/servo/platform/linux.py index 8496bd7fe6a..975b93e0a8d 100644 --- a/python/servo/platform/linux.py +++ b/python/servo/platform/linux.py @@ -9,7 +9,6 @@ import os import subprocess -import tempfile from typing import Optional, Tuple import distro @@ -28,8 +27,16 @@ from .base import Base APT_PKGS = [ 'build-essential', 'ccache', 'clang', 'cmake', 'curl', 'g++', 'git', 'gperf', 'libdbus-1-dev', 'libfreetype6-dev', 'libgl1-mesa-dri', - 'libgles2-mesa-dev', 'libglib2.0-dev', 'libgstreamer-plugins-bad1.0-dev', - 'libgstreamer-plugins-base1.0-dev', 'libgstreamer1.0-dev', + 'libgles2-mesa-dev', 'libglib2.0-dev', + 'libgstreamer-plugins-base1.0-dev', + 'gstreamer1.0-plugins-good', 'libgstreamer-plugins-good1.0-dev', + 'gstreamer1.0-plugins-bad', 'libgstreamer-plugins-bad1.0-dev', + 'gstreamer1.0-plugins-ugly', + "gstreamer1.0-plugins-base", 'libgstreamer-plugins-base1.0-dev', + 'gstreamer1.0-libav', + 'libgstrtspserver-1.0-dev', + 'gstreamer1.0-tools', + 'libges-1.0-dev', 'libharfbuzz-dev', 'liblzma-dev', 'libunwind-dev', 'libunwind-dev', 'libvulkan1', 'libx11-dev', 'libxcb-render0-dev', 'libxcb-shape0-dev', 'libxcb-xfixes0-dev', 'libxmu-dev', 'libxmu6', 'libegl1-mesa-dev', @@ -156,7 +163,7 @@ class Linux(Base): if self.distro in ['Ubuntu', 'Debian GNU/Linux', 'Raspbian GNU/Linux']: command = ['apt-get', 'install'] pkgs = APT_PKGS - if subprocess.call(['dpkg', '-s'] + pkgs, + if subprocess.call(['dpkg', '-s'] + pkgs, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) != 0: install = True elif self.distro in ['CentOS', 'CentOS Linux', 'Fedora', 'Fedora Linux']: @@ -204,18 +211,6 @@ class Linux(Base): if not force and self.is_gstreamer_installed(cross_compilation_target=None): return False - with tempfile.TemporaryDirectory() as temp_dir: - file_name = os.path.join(temp_dir, GSTREAMER_URL.rsplit('/', maxsplit=1)[-1]) - util.download_file("Pre-packaged GStreamer binaries", GSTREAMER_URL, file_name) - - print(f"Installing GStreamer packages to {PREPACKAGED_GSTREAMER_ROOT}...") - os.makedirs(PREPACKAGED_GSTREAMER_ROOT, exist_ok=True) - - # Extract, but strip one component from the output, because the package includes - # a toplevel directory called "./gst/" and we'd like to have the same directory - # structure on all platforms. - subprocess.check_call(["tar", "xf", file_name, "-C", PREPACKAGED_GSTREAMER_ROOT, - "--strip-components=2"]) - - assert self.is_gstreamer_installed(cross_compilation_target=None) - return True + raise EnvironmentError( + "Bootstrapping GStreamer on Linux is not supported. " + + "Please install it using your distribution package manager.") diff --git a/python/servo/platform/windows.py b/python/servo/platform/windows.py index 904e5a73067..028f4a167cc 100644 --- a/python/servo/platform/windows.py +++ b/python/servo/platform/windows.py @@ -23,8 +23,8 @@ DEPENDENCIES = { } URL_BASE = "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/" -GSTREAMER_URL = f"{URL_BASE}/gstreamer-1.0-msvc-x86_64-1.16.0.msi" -GSTREAMER_DEVEL_URL = f"{URL_BASE}/gstreamer-1.0-devel-msvc-x86_64-1.16.0.msi" +GSTREAMER_URL = f"{URL_BASE}/gstreamer-1.0-msvc-x86_64-1.22.8.msi" +GSTREAMER_DEVEL_URL = f"{URL_BASE}/gstreamer-1.0-devel-msvc-x86_64-1.22.8.msi" DEPENDENCIES_DIR = os.path.join(util.get_target_dir(), "dependencies") @@ -118,19 +118,19 @@ class Windows(Base): # The bootstraped version of GStreamer always takes precedance of the installed vesion. prepackaged_root = os.path.join( - DEPENDENCIES_DIR, "gstreamer", "1.0", gst_arch_name + DEPENDENCIES_DIR, "gstreamer", "1.0", f"msvc_{gst_arch_name}" ) if os.path.exists(os.path.join(prepackaged_root, "bin", "ffi-7.dll")): return prepackaged_root # The installed version of GStreamer often sets an environment variable pointing to # the install location. - root_from_env = os.environ.get(f"GSTREAMER_1_0_ROOT_{gst_arch_name}") + root_from_env = os.environ.get(f"GSTREAMER_1_0_ROOT_MSVC_{gst_arch_name}") if root_from_env and os.path.exists(os.path.join(root_from_env, "bin", "ffi-7.dll")): return root_from_env # If all else fails, look for an installation in the default install directory. - default_root = os.path.join("C:\\gstreamer\\1.0", gst_arch_name) + default_root = os.path.join("C:\\gstreamer\\1.0", f"msvc_{gst_arch_name}") if os.path.exists(os.path.join(default_root, "bin", "ffi-7.dll")): return default_root |