diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-05-19 14:07:46 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-05-25 08:22:21 +0200 |
commit | 7d20f16d9f746399811b1c4582e83efde1416bff (patch) | |
tree | f9aed7799918e930e43ab7ed834afdea9623b0d2 /python/servo/post_build_commands.py | |
parent | a56abe44e02ddf3e634fd1a3953cd0cffc22d460 (diff) | |
download | servo-7d20f16d9f746399811b1c4582e83efde1416bff.tar.gz servo-7d20f16d9f746399811b1c4582e83efde1416bff.zip |
Implement `bootstrap-gstreamer` for all platforms
This change makes it so that the Platform classes can now handle
installing GStreamer dependencies and properly setting up the
environment including when cross-compiling. For Windows and Linux
is now installed into `target/dependencies/gstreamer` when not installed
system-wide. In addition:
1. Creating and moving existing environment path append helpers to
`util.py`.
2. Combining the `set_run_env` and `build_dev` functions and moving
some outside code into them so that it can be shared. Now code that
used to call `set_run_env` calls `build_dev` and then
`os.environ.update(...)`.
3. Adding Python typing information in many places.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r-- | python/servo/post_build_commands.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 74af93fb0c9..07f104630a1 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -15,6 +15,8 @@ import os.path as path import subprocess from shutil import copytree, rmtree, copy2 +import servo.util + from mach.decorators import ( CommandArgument, CommandProvider, @@ -79,9 +81,15 @@ class PostBuildCommands(CommandBase): help="Command-line arguments to be passed through to Servo") def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, headless=False, software=False, bin=None, emulator=False, usb=False, nightly=None): - self.set_run_env(android is not None) env = self.build_env() env["RUST_BACKTRACE"] = "1" + if software: + if not is_linux(): + print("Software rendering is only supported on Linux at the moment.") + return + + env['LIBGL_ALWAYS_SOFTWARE'] = "1" + os.environ.update(env) # Make --debugger imply --debug if debugger: @@ -129,13 +137,6 @@ class PostBuildCommands(CommandBase): if headless: args.append('-z') - if software: - if not is_linux(): - print("Software rendering is only supported on Linux at the moment.") - return - - env['LIBGL_ALWAYS_SOFTWARE'] = "1" - # Borrowed and modified from: # http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883 if debug: @@ -251,7 +252,7 @@ class PostBuildCommands(CommandBase): toolchain_path = path.dirname(path.dirname(rustc_path)) rust_docs = path.join(toolchain_path, "share", "doc", "rust", "html") - docs = path.join(self.get_target_dir(), "doc") + docs = path.join(servo.util.get_target_dir(), "doc") if not path.exists(docs): os.makedirs(docs) @@ -293,4 +294,4 @@ class PostBuildCommands(CommandBase): self.doc([]) import webbrowser webbrowser.open("file://" + path.abspath(path.join( - self.get_target_dir(), "doc", "servo", "index.html"))) + servo.util.get_target_dir(), "doc", "servo", "index.html"))) |