mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-27 19:54:38 +00:00
Drop host session names from the optional guest environment filter
This commit is contained in:
1 parent
dd794377a9
commit
2d0b6cf351
2 files changed
+20
-1
No files matched your search
@@ -16,6 +16,12 @@ SESSION_PREFIXES = (
|
||||
'XDG_SESSION_', 'XDG_SEAT', 'XDG_VTNR', 'XDG_CURRENT_DESKTOP', 'XDG_MENU_PREFIX',
|
||||
'GNOME_', 'KDE_', 'GDM', 'SSH_', 'SYSTEMD_', 'MEMORY_PRESSURE_', 'QT_', 'GTK_', 'GDK_',
|
||||
'GIO_', 'GSETTINGS_', 'GJS_', 'FLATPAK_', 'SNAP_', 'KONSOLE_', 'TERM_PROGRAM', 'BASH_FUNC_',
|
||||
# Host shell, prompt and developer-tool metadata. None of it exists on a Mac and
|
||||
# several entries name Linux paths, so the guest must not inherit them.
|
||||
'STARSHIP_', 'ILLOGICAL_IMPULSE_', 'INIR_', 'PNPM_', 'YARN_', 'npm_config_', 'PIP_',
|
||||
'CARGO_', 'GIT_', 'LESS_TERMCAP_', '_P9K_', 'VSSCRIPT_', 'ORCA_', 'CLAUDE', 'TF_',
|
||||
'CUDA_', 'COMPOSER_', 'DEBIAN_', 'FZF_', 'BAT_', 'MYSQL_', 'AWS_', 'LESS',
|
||||
'CLOUDSDK_', 'GH_', 'GLAB_', 'HOMEBREW_', 'ELECTRON_', 'DELTA_', 'HIST', 'GPG_',
|
||||
)
|
||||
SESSION_NAMES = {
|
||||
'WAYLAND_DISPLAY', 'DESKTOP_SESSION', 'DESKTOP_STARTUP_ID', 'SESSION_MANAGER',
|
||||
@@ -23,6 +29,9 @@ SESSION_NAMES = {
|
||||
'LISTEN_FDS', 'LISTEN_PID', 'LISTEN_FDNAMES', 'COLORTERM', 'VTE_VERSION', 'WINDOWID',
|
||||
'WINDOWPATH', 'CHROME_DESKTOP', 'NO_AT_BRIDGE', 'MOTD_SHOWN', 'SNAP', 'APPIMAGE', 'APPDIR',
|
||||
'OWD', 'VIRTUAL_ENV', 'DEBUGINFOD_URLS', 'LS_COLORS', 'COLORFGBG', 'OLDPWD', 'SHLVL',
|
||||
'AGENT', 'NO_COLOR', 'TERM', 'VISUAL', 'PROMPT_COMMAND', 'HISTFILE', 'HISTSIZE',
|
||||
'SAVEHIST', 'HISTORY_IGNORE', 'PYTHONUNBUFFERED', 'LINES', 'COLUMNS', '_',
|
||||
'CI', 'EDITOR', 'PAGER', 'GIT_PAGER', 'SYSTEMD_PAGER', 'MANPAGER',
|
||||
}
|
||||
GUEST_SHELL = '/bin/zsh'
|
||||
|
||||
@@ -40,6 +49,11 @@ def filter_host_environment(environ):
|
||||
# The host login shell (for example /bin/fish) does not exist in the guest.
|
||||
if 'SHELL' not in keep:
|
||||
environ['SHELL'] = GUEST_SHELL
|
||||
# A host PATH names Linux directories; the guest always has the Mac layout.
|
||||
if 'PATH' not in keep:
|
||||
environ['PATH'] = '/usr/bin:/bin:/usr/sbin:/sbin'
|
||||
environ.pop('RCLOL_KEEP_HOST_ENV', None)
|
||||
environ.pop('RCLOL_FILTER_HOST_ENV', None)
|
||||
return removed
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@ for option in RCLOL_GPU_DIRECT_PRESENT RCLOL_GPU_DIRECT_ASYNC RCLOL_GPU_DIRECT_V
|
||||
case "$value" in 0|'') unset "$option";; *) export "$option=$value";; esac
|
||||
done
|
||||
prefix=$prefix_dir
|
||||
# Resolve the loader before the environment filter replaces PATH with the Mac layout.
|
||||
darling_bin=$(command -v darling) || {
|
||||
echo 'darling loader not found in PATH' >&2
|
||||
exit 1
|
||||
}
|
||||
# RIOT_GUEST_HOME is host-side; DYLD paths must be relative to the guest root.
|
||||
case "$guest_home" in
|
||||
"$prefix"/*) guest_path=/${guest_home#"$prefix"/} ;;
|
||||
@@ -136,6 +141,6 @@ exec python3 "$runner_dir/exec-guest.py" env -u ELECTRON_RUN_AS_NODE -u DYLD_INS
|
||||
DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH:-$guest_path/RuntimeLibraries}" \
|
||||
DYLD_FRAMEWORK_PATH="${DYLD_FRAMEWORK_PATH:-$guest_path/RuntimeFrameworks}" \
|
||||
DARLING_XSHM_LIBRARY="${DARLING_XSHM_LIBRARY:-$guest_path/libDarlingXShm.dylib}" \
|
||||
darling "$A" --region="${RCLOL_REGION:-EUW}" --locale="${RCLOL_LOCALE:-en_GB}" \
|
||||
"$darling_bin" "$A" --region="${RCLOL_REGION:-EUW}" --locale="${RCLOL_LOCALE:-en_GB}" \
|
||||
"$@" \
|
||||
--log-dir="$guest_path/Library/Logs/Riot Games/Riot Client"
|
||||
Reference in new issue
Block a user