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

_v2-entry-point: Adapt to the latest round of Steam Client changes


STEAM_COMPAT_APP_LIBRARY_PATH and STEAM_COMPAT_MOUNT_PATHS have gone
away, and we now have STEAM_COMPAT_INSTALL_PATH,
STEAM_COMPAT_LIBRARY_PATHS and STEAM_COMPAT_SHADER_PATH instead.
A future Steam version will add STEAM_COMPAT_MOUNTS.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent db90abe9
No related branches found
No related tags found
No related merge requests found
......@@ -128,15 +128,77 @@ fi
# Steam App ID of this app or game
log "STEAM_COMPAT_APP_ID=${STEAM_COMPAT_APP_ID-}"
# Absolute path where the Steam client is installed
log "STEAM_COMPAT_CLIENT_INSTALL_PATH=${STEAM_COMPAT_CLIENT_INSTALL_PATH-}"
# Absolute path to the game itself
log "STEAM_COMPAT_INSTALL_PATH=${STEAM_COMPAT_INSTALL_PATH-}"
# Absolute path(s) to Steam Library containing either compat tools or
# the app/game itself
log "STEAM_COMPAT_LIBRARY_PATHS=${STEAM_COMPAT_LIBRARY_PATHS-}"
# Absolute path(s) to miscellaneous other things (SteamVR?)
log "STEAM_COMPAT_MOUNTS=${STEAM_COMPAT_MOUNTS-}"
# Session ID used for coordination between processes involving the same game.
# If unset/empty, only execute a single command.
log "STEAM_COMPAT_SESSION_ID=${STEAM_COMPAT_SESSION_ID-}"
# Absolute path to where this app/game will put shaders.
log "STEAM_COMPAT_SHADER_PATH=${STEAM_COMPAT_SHADER_PATH-}"
# Absolute path(s) to Steam Library containing compat tools in use.
# These are not *necessarily* subdirectories of STEAM_COMPAT_LIBRARY_PATHS
# if a compat tool is manually downloaded.
log "STEAM_COMPAT_TOOL_PATHS=${STEAM_COMPAT_TOOL_PATHS-}"
# Used to create sockets.
# A future version will fall back to /tmp, but only when this can be
# done securely.
log "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR-}"
# Old/deprecated/prototype stuff
if [ -n "${STEAM_COMPAT_APP_LIBRARY_PATH+set}" ]; then
log "warning: STEAM_COMPAT_APP_LIBRARY_PATH is deprecated: $STEAM_COMPAT_APP_LIBRARY_PATH"
fi
if [ -n "${STEAM_COMPAT_APP_LIBRARY_PATHS+set}" ]; then
log "warning: STEAM_COMPAT_APP_LIBRARY_PATHS is deprecated: $STEAM_COMPAT_APP_LIBRARY_PATHS"
fi
if [ -n "${STEAM_COMPAT_MOUNT_PATHS+set}" ]; then
log "warning: STEAM_COMPAT_MOUNT_PATHS is deprecated: $STEAM_COMPAT_MOUNT_PATHS"
fi
# In non-session mode, we always behave like the main program
if [ -z "${STEAM_COMPAT_SESSION_ID-}" ]; then
is_main=yes
fi
if [ -n "${STEAM_COMPAT_INSTALL_PATH}" ]; then
if ! [ -d "$STEAM_COMPAT_INSTALL_PATH" ]; then
log "warning: $STEAM_COMPAT_INSTALL_PATH is not a directory"
elif [ -n "$is_main" ] \
&& ! [ "$STEAM_COMPAT_INSTALL_PATH" -ef . ]; then
# This will trigger for games launched from a subdirectory, like
# Estranged and Deus Ex: Invisible War, which would not previously have
# worked reliably.
log "note: STEAM_COMPAT_INSTALL_PATH does not match working directory: $(pwd)"
fi
fi
if [ -n "${STEAM_COMPAT_CLIENT_INSTALL_PATH}" ] \
&& ! [ -d "$STEAM_COMPAT_CLIENT_INSTALL_PATH" ]; then
log "warning: $STEAM_COMPAT_CLIENT_INSTALL_PATH is not a directory"
fi
if [ -n "${STEAM_COMPAT_SHADER_PATH}" ] \
&& ! [ -d "$STEAM_COMPAT_SHADER_PATH" ]; then
log "warning: $STEAM_COMPAT_SHADER_PATH is not a directory"
fi
unset LD_LIBRARY_PATH
unset STEAM_RUNTIME
......@@ -158,10 +220,22 @@ for fs in \
${STEAM_COMPAT_APP_LIBRARY_PATHS-} \
${STEAM_COMPAT_CLIENT_INSTALL_PATH-} \
${STEAM_COMPAT_DATA_PATH-} \
${STEAM_COMPAT_INSTALL_PATH-} \
${STEAM_COMPAT_LIBRARY_PATHS-} \
${STEAM_COMPAT_MOUNT_PATHS-} \
${STEAM_COMPAT_MOUNTS-} \
${STEAM_COMPAT_SHADER_PATH-} \
${STEAM_COMPAT_TOOL_PATHS-} \
; do
if [ -n "$fs" ] && [ -e "$fs" ]; then
if [ -z "$fs" ]; then
continue
fi
if ! [ -d "$fs" ]; then
log "warning: $fs is not a directory"
fi
if [ -e "$fs" ]; then
container_args=("${container_args[@]}" --filesystem="${fs}")
fi
done
......@@ -261,7 +335,7 @@ launch_args=( \
)
if [ -n "$is_main" ]; then
if [ "${SteamAppId-}" != "$STEAM_COMPAT_APP_ID-" ]; then
if [ "${SteamAppId-}" != "${STEAM_COMPAT_APP_ID-}" ]; then
log "Mismatch: SteamAppId=${SteamAppId-}, STEAM_COMPAT_APP_ID=${STEAM_COMPAT_APP_ID-}"
exit 125
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment