mirror of
https://github.com/lobomfz/VIctory-xmem.git
synced 2026-12-06 05:48:38 +00:00
57 lines
2.2 KiB
Bash
57 lines
2.2 KiB
Bash
root=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
[ -f "$root/run.conf" ] && source "$root/run.conf"
|
|
state=$root/local
|
|
export WINEPREFIX=$state/prefix
|
|
export WINEDEBUG=${WINEDEBUG:--all}
|
|
export WINEFSYNC=${WINEFSYNC:-1}
|
|
export GLIBC_TUNABLES=${GLIBC_TUNABLES:-glibc.pthread.rseq=0}
|
|
export VK_DRIVER_FILES=$root/deps/mesa-inst/share/vulkan/icd.d/radeon_icd.x86_64.json
|
|
export MESA_SHADER_CACHE_DIR=$state/mesa-cache
|
|
export VKD3D_SHADER_CACHE_PATH=$state/vkd3d-cache
|
|
|
|
# Auto-detect Proton (matches the tested Proton-CachyOS / GE-Proton setup) unless
|
|
# USE_SYSTEM_WINE=1 is set. Users can also set PROTON=/path/to/proton in run.conf.
|
|
PROTON_DIR=""
|
|
if [ -n "${PROTON:-}" ]; then
|
|
if [ ! -x "$PROTON/files/bin/wine" ]; then echo "no proton at $PROTON"; exit 1; fi
|
|
PROTON_DIR="$PROTON"
|
|
if [ "${USE_SYSTEM_WINE:-0}" = 1 ]; then export WINEPREFIX=$state/prefix-proton; fi
|
|
elif [ "${USE_SYSTEM_WINE:-0}" != 1 ]; then
|
|
for cand in \
|
|
/usr/share/steam/compatibilitytools.d/proton-cachyos-slr \
|
|
"$HOME/.local/share/Steam/compatibilitytools.d"/GE-Proton* \
|
|
"$HOME/.local/share/Steam/steamapps/common/Proton - Experimental" \
|
|
"$HOME/.local/share/Steam/steamapps/common"/Proton*; do
|
|
if [ -x "$cand/files/bin/wine" ]; then
|
|
PROTON_DIR="$cand"
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [ -n "$PROTON_DIR" ]; then
|
|
export PROTON_DIR
|
|
export WINE_BIN="$PROTON_DIR/files/bin/wine"
|
|
export WINESERVER_BIN="${PATCHED_WINESERVER:-$PROTON_DIR/files/bin/wineserver}"
|
|
export WINE_LIB_DIR="$PROTON_DIR/files/lib/x86_64-linux-gnu"
|
|
if [ -d "$WINE_LIB_DIR" ]; then
|
|
export LD_LIBRARY_PATH="$WINE_LIB_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
fi
|
|
else
|
|
export WINE_BIN="$(command -v wine 2>/dev/null || echo wine)"
|
|
export WINESERVER_BIN="${PATCHED_WINESERVER:-$(command -v wineserver 2>/dev/null || echo wineserver)}"
|
|
fi
|
|
|
|
win() { printf 'Z:%s' "${1//\//\\}"; }
|
|
|
|
patched() {
|
|
git -C "$1" diff "${2:---full-index}" --ignore-submodules=dirty HEAD
|
|
git -C "$1" submodule -q foreach --recursive "git diff ${2:---full-index} --ignore-submodules=dirty HEAD"
|
|
}
|
|
|
|
submodule_of() {
|
|
local name=${2##*/}
|
|
name=${name#*.}
|
|
git -C "$1" submodule -q foreach --recursive 'echo "$displaypath"' | awk -F/ -v name="${name%.patch}" '$NF == name && !found { print; found = 1 }'
|
|
}
|