From e070ee1e6a5fe29cdcb68f779416b323ce4f2196 Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Thu, 22 Aug 2019 15:33:44 +0100 Subject: [PATCH] Add an easier way to select the scout runtime Signed-off-by: Simon McVittie <smcv@collabora.com> --- README.md | 28 ++++++++++++++++++++--- build-relocatable-install.py | 1 + meson.build | 1 + pressure-vessel-unruntime-scout | 40 +++++++++++++++++++++++++++++++++ tests/shellcheck.sh | 1 + 5 files changed, 68 insertions(+), 3 deletions(-) create mode 100755 pressure-vessel-unruntime-scout diff --git a/README.md b/README.md index 8fde3a3cb..40da0413f 100644 --- a/README.md +++ b/README.md @@ -310,16 +310,38 @@ Instructions for testing * For a more production-ready version without the test UI, set the launch options to: + "LaunchOptions" "~/.steam/steam/steamapps/common/SteamLinuxRuntime/pressure-vessel/bin/pressure-vessel-unruntime-scout -- %command%" + + This mode does not require Python 3, PyGI, GTK or a normal + window manager, and is probably more suitable for Big Picture mode. + It assumes this directory layout: + + ``` + SteamLinuxRuntime + \- pressure-vessel + \- bin + \- pressure-vessel-unruntime-scout (etc.) + \- scout + \- files + \- metadata + ``` + + Or for more flexibility, use + "LaunchOptions" "~/.steam/steam/steamapps/common/SteamLinuxRuntime/pressure-vessel/bin/pressure-vessel-unruntime -- %command%" and then add more options just before the `--` as desired. This mode does not require Python 3, PyGI, GTK or a normal window manager, and is probably more suitable for Big Picture mode. -* When not using the test UI, the default runtime is the host system, +* The default runtime for `pressure-vessel-unruntime` is the host system, with the `LD_LIBRARY_PATH` Steam Runtime overlaid onto it. - You can specify a runtime with the `--runtime` option. It can be - any of these: + You can specify a runtime with the `--runtime` option: + `pressure-vessel-unruntime-scout` is just a shortcut for using + `pressure-vessel-unruntime --runtime DIR/../../scout/files` where *DIR* + is the directory containing `pressure-vessel-unruntime-scout` itself. + + The runtime can be any of these: - The `files` subdirectory of a Flatpak-style runtime such as `~/.steam/steam/steamapps/common/SteamLinuxRuntime/scout` or diff --git a/build-relocatable-install.py b/build-relocatable-install.py index c2da1e140..507bed216 100755 --- a/build-relocatable-install.py +++ b/build-relocatable-install.py @@ -98,6 +98,7 @@ PRIMARY_ARCH_DEPENDENCIES = { SCRIPTS = [ 'pressure-vessel-test-ui', 'pressure-vessel-unruntime', + 'pressure-vessel-unruntime-scout', 'pressure-vessel-unruntime-test-ui', ] EXECUTABLES = [ diff --git a/meson.build b/meson.build index 510eef096..d9dd40928 100644 --- a/meson.build +++ b/meson.build @@ -109,6 +109,7 @@ add_project_arguments(supported_warning_cflags, language : 'c') scripts = [ 'pressure-vessel-test-ui', 'pressure-vessel-unruntime', + 'pressure-vessel-unruntime-scout', 'pressure-vessel-unruntime-test-ui', ] diff --git a/pressure-vessel-unruntime-scout b/pressure-vessel-unruntime-scout new file mode 100755 index 000000000..4ffe00792 --- /dev/null +++ b/pressure-vessel-unruntime-scout @@ -0,0 +1,40 @@ +#!/bin/bash + +# pressure-vessel-scout — undo the Steam Runtime's environment and use +# scout, assuming the layout of the SteamLinuxRuntime depot. +# +# Copyright © 2019 Collabora Ltd. +# +# SPDX-License-Identifier: MIT +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -e +set -o pipefail +set -u +shopt -s nullglob + +me="$(readlink -f "$0")" +here="${me%/*}" +me="${me##*/}" + +exec "$here/pressure-vessel-unruntime" --runtime "${here}/../../scout/files" "$@" + +# vim:set sw=4 sts=4 et: diff --git a/tests/shellcheck.sh b/tests/shellcheck.sh index f79fea79d..b8336ec44 100755 --- a/tests/shellcheck.sh +++ b/tests/shellcheck.sh @@ -38,6 +38,7 @@ n=0 for shell_script in \ *.sh \ pressure-vessel-unruntime \ + pressure-vessel-unruntime-scout \ pressure-vessel-unruntime-test-ui \ tests/*.sh \ ; do -- GitLab