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

wrap: Parse app ID from $STEAM_COMPAT_APP_ID


Recent versions of Steam set this when running setup commands in the
context of a particular app, so that the setup commands can find their
home directory if unsharing $HOME.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent c9fe4221
No related branches found
No related tags found
No related merge requests found
...@@ -253,7 +253,6 @@ The following environment variables (among others) are read by ...@@ -253,7 +253,6 @@ The following environment variables (among others) are read by
`STEAM_COMPAT_APP_ID` (integer) `STEAM_COMPAT_APP_ID` (integer)
: Equivalent to `--steam-app-id="$STEAM_COMPAT_APP_ID"`. : Equivalent to `--steam-app-id="$STEAM_COMPAT_APP_ID"`.
(Not used yet, but should be.)
`STEAM_COMPAT_APP_LIBRARY_PATH` (path) `STEAM_COMPAT_APP_LIBRARY_PATH` (path)
: (Not used yet, but should be.) : (Not used yet, but should be.)
......
...@@ -814,7 +814,8 @@ static GOptionEntry options[] = ...@@ -814,7 +814,8 @@ static GOptionEntry options[] =
{ "steam-app-id", '\0', { "steam-app-id", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &opt_steam_app_id, G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, &opt_steam_app_id,
"Make --unshare-home use ~/.var/app/com.steampowered.AppN " "Make --unshare-home use ~/.var/app/com.steampowered.AppN "
"as home directory. [Default: $SteamAppId]", "N" }, "as home directory. [Default: $STEAM_COMPAT_APP_ID or $SteamAppId]",
"N" },
{ "gc-runtimes", '\0', { "gc-runtimes", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &opt_gc_runtimes, G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &opt_gc_runtimes,
"If using --copy-runtime-into, garbage-collect old temporary " "If using --copy-runtime-into, garbage-collect old temporary "
...@@ -881,7 +882,7 @@ static GOptionEntry options[] = ...@@ -881,7 +882,7 @@ static GOptionEntry options[] =
{ "unshare-home", '\0', { "unshare-home", '\0',
G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, opt_share_home_cb, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, opt_share_home_cb,
"Use an app-specific home directory chosen according to --home, " "Use an app-specific home directory chosen according to --home, "
"--freedesktop-app-id, --steam-app-id or $SteamAppId. " "--freedesktop-app-id, --steam-app-id or $STEAM_COMPAT_APP_ID. "
"[Default if $PRESSURE_VESSEL_HOME is set or " "[Default if $PRESSURE_VESSEL_HOME is set or "
"$PRESSURE_VESSEL_SHARE_HOME is 0]", "$PRESSURE_VESSEL_SHARE_HOME is 0]",
NULL }, NULL },
...@@ -1240,6 +1241,13 @@ main (int argc, ...@@ -1240,6 +1241,13 @@ main (int argc,
opt_fake_home = g_build_filename (home, ".var", "app", opt_fake_home = g_build_filename (home, ".var", "app",
opt_freedesktop_app_id, NULL); opt_freedesktop_app_id, NULL);
} }
else if (g_getenv ("STEAM_COMPAT_APP_ID") != NULL)
{
opt_freedesktop_app_id = g_strdup_printf ("com.steampowered.App%s",
g_getenv ("STEAM_COMPAT_APP_ID"));
opt_fake_home = g_build_filename (home, ".var", "app",
opt_freedesktop_app_id, NULL);
}
else if (g_getenv ("SteamAppId") != NULL) else if (g_getenv ("SteamAppId") != NULL)
{ {
opt_freedesktop_app_id = g_strdup_printf ("com.steampowered.App%s", opt_freedesktop_app_id = g_strdup_printf ("com.steampowered.App%s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment