Skip to content
Snippets Groups Projects
Commit 8453216b authored by Simon McVittie's avatar Simon McVittie
Browse files

Add basic steam-runtime-launcher-service integration


If run with STEAM_COMPAT_LAUNCHER_SERVICE=container-runtime, we'll
inject commands at the container layer and they'll run in a "pure"
soldier/sniper environment. This is appropriate for native soldier/sniper
games that run with no further compatibility layer, as in
ValveSoftware/steam-runtime#508.

If run with STEAM_COMPAT_LAUNCHER_SERVICE=scout-in-container, we'll
inject commands inside the layered scout-on-soldier runtime (or
potentially scout-on-sniper, if we pivot to that at some point) and
they'll run in a scout-compatible environment.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 55378b68
No related branches found
No related tags found
1 merge request!72Add steam-runtime-launcher-service integration
......@@ -11,6 +11,7 @@ me="${me##*/}"
# Don't rely on it.
is_main=yes
launcher_service=
suite=
verbose=
log_to_file=
......@@ -277,6 +278,37 @@ for word in $ld_preload; do
done
IFS="$old_IFS"
case "${STEAM_COMPAT_LAUNCHER_SERVICE-}" in
(container-runtime)
launcher_service=yes
;;
esac
if [ -n "$launcher_service" ]; then
unset STEAM_COMPAT_LAUNCHER_SERVICE
appid="${STEAM_COMPAT_APP_ID-"${SteamAppId-0}"}"
launch_client="$here/pressure-vessel/bin/steam-runtime-launch-client"
launcher_service_address="--bus-name=com.steampowered.App${appid}"
container_args+=("--launcher")
# In this mode, arguments after "pressure-vessel-wrap --" go to
# s-r-launcher-service, and arguments after "s-r-launcher-service --"
# are in turn the actual command to run.
set -- "$launcher_service_address" --replace -- "$@"
echo "Starting program with command-launcher service." >&2
echo >&2
echo "To inject commands into the container, use a command like:" >&2
echo >&2
echo "$launch_client \\" >&2
echo " $launcher_service_address \\" >&2
# --directory='' means keep using the game's working directory
echo " --directory='' \\"
echo " -- \\"
echo " xterm"
echo >&2
fi
unset LD_LIBRARY_PATH
unset STEAM_RUNTIME
......
......@@ -39,13 +39,18 @@ usage () {
}
main () {
local appid="${STEAM_COMPAT_APP_ID-"${SteamAppId-0}"}"
local getopt_temp="help"
local launch_client
local launcher_service=
local launcher_service_address
local ours
local runtime
local src
local theirs
local theirs_should_be
local verbose=
local -a launcher_args=()
if [ "${STEAM_LINUX_RUNTIME_VERBOSE-}" = 1 ]; then
verbose=yes
......@@ -97,6 +102,12 @@ main () {
esac
done
case "${STEAM_COMPAT_LAUNCHER_SERVICE-}" in
(scout-in-container | scout-on-soldier)
launcher_service=yes
;;
esac
if [ "$#" -eq 0 ] || [ "$1" = -- ]; then
log "Error: A command to run is required"
usage 125
......@@ -242,6 +253,42 @@ main () {
# Steam client itself, but let's try keeping 32-bit games consistent
# with 64-bit games.
if [ -n "$launcher_service" ]; then
unset STEAM_COMPAT_LAUNCHER_SERVICE
launcher_service_address="--bus-name=com.steampowered.App${appid}"
launcher_args+=("$launcher_service_address")
launcher_args+=("--replace")
# We find steam-runtime-launcher-service in PATH. soldier and
# sniper since 0.20220428.x have this available.
set -- steam-runtime-launcher-service "${launcher_args[@]}" -- "$@"
# TODO: Looking next to PRESSURE_VESSEL_RUNTIME_BASE is taking
# advantage of an implementation detail of how SLR is put together.
# Ideally we would use $runtime/amd64/bin/s-r-l-c unconditionally,
# but we can't rely on that until it's included in the GA Steam Client.
for launch_client in \
"$runtime/amd64/bin/steam-runtime-launch-client" \
"${PRESSURE_VESSEL_RUNTIME_BASE-}/pressure-vessel/bin/steam-runtime-launch-client" \
; do
if [ -x "$launch_client" ]; then
break
fi
done
echo "Starting program with command-launcher service." >&2
echo >&2
echo "To inject commands into the container, use a command like:" >&2
echo >&2
echo "$launch_client \\" >&2
echo " $launcher_service_address \\" >&2
# --directory='' means keep using the game's working directory
echo " --directory='' \\"
echo " -- \\"
echo " xterm"
echo >&2
fi
if [ -n "$saved_ld_preload" ]; then
case "$1" in
(*=*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment