From a46d0d93a7d8b0cbd31e410f9638af434caee146 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 10 Mar 2023 03:00:24 +1000 Subject: [PATCH] Linux launch script refactors - remove unused WINE libs from `LD_LIBRARY_PATH` - add usage reminder for `--mono-no-redirect`, printed to stderr - use `MONO_WINFORMS_XIM_STYLE=disabled` on all distros - use `MONO_CRASH_NOFILE` to stop useless core dumps from clogging dir --- Assets/EmuHawkMono.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Assets/EmuHawkMono.sh b/Assets/EmuHawkMono.sh index a0fcecb55c..01583339cf 100755 --- a/Assets/EmuHawkMono.sh +++ b/Assets/EmuHawkMono.sh @@ -5,12 +5,11 @@ if [ "$(ps -C "mono" -o "cmd" --no-headers | grep "EmuHawk.exe")" ]; then exit 0 fi libpath="" -winepath="" if [ "$(command -v lsb_release)" ]; then case "$(lsb_release -i | cut -c17- | tr -d "\n" | tr A-Z a-z)" in - "arch"|"manjarolinux"|"artix") libpath="/usr/lib";; - "fedora") libpath="/usr/lib64"; export MONO_WINFORMS_XIM_STYLE=disabled;; # see https://bugzilla.xamarin.com/show_bug.cgi?id=28047#c9 - "debian"|"linuxmint"|"ubuntu"|"pop") libpath="/usr/lib/x86_64-linux-gnu"; export MONO_WINFORMS_XIM_STYLE=disabled;; # ditto + "arch"|"artix"|"manjarolinux") libpath="/usr/lib";; + "fedora") libpath="/usr/lib64";; + "debian"|"linuxmint"|"pop"|"ubuntu") libpath="/usr/lib/x86_64-linux-gnu";; esac else printf "Distro does not provide LSB release info API! (You've met with a terrible fate, haven't you?)\n" @@ -19,8 +18,9 @@ if [ -z "$libpath" ]; then printf "%s\n" "Unknown distro, assuming system-wide libraries are in /usr/lib..." libpath="/usr/lib" fi -if [ -z "$winepath" ]; then winepath="$libpath/wine"; fi -export LD_LIBRARY_PATH="$PWD/dll:$PWD:$winepath:$libpath" +export LD_LIBRARY_PATH="$PWD/dll:$PWD:$libpath" +export MONO_CRASH_NOFILE=1 +export MONO_WINFORMS_XIM_STYLE=disabled # see https://bugzilla.xamarin.com/show_bug.cgi?id=28047#c9 export BIZHAWK_INT_SYSLIB_PATH="$libpath" if [ "$1" = "--mono-no-redirect" ]; then shift @@ -28,5 +28,6 @@ if [ "$1" = "--mono-no-redirect" ]; then printf "(received --mono-no-redirect, stderr was not captured)\n" >EmuHawkMono_laststderr.txt mono ./EmuHawk.exe "$@" else + printf "(output captured in %s/EmuHawkMono_last*.txt, pass --mono-no-redirect as first argument to disable)\n" "$PWD" >&2 mono ./EmuHawk.exe "$@" >EmuHawkMono_laststdout.txt 2>EmuHawkMono_laststderr.txt fi