diff options
author | Stelios Tsampas | 2024-02-26 19:28:10 +0200 |
---|---|---|
committer | Stelios Tsampas | 2024-02-26 19:28:10 +0200 |
commit | 9dc462fcf79df51e142582a7a255d3bb5e995506 (patch) | |
tree | 32367ff2ac89e773e3f058048385dffdac241c6b | |
parent | e47859aa6b2aa9e8a5f7c09db9a9324fd8ef1170 (diff) | |
download | aur-9dc462fcf79df51e142582a7a255d3bb5e995506.tar.gz |
[dxvk-mingw] Update setup script
-rw-r--r-- | PKGBUILD | 2 | ||||
-rwxr-xr-x | setup_dxvk.sh | 72 |
2 files changed, 33 insertions, 41 deletions
@@ -113,5 +113,5 @@ package() { sha256sums=('SKIP' 'bcc15521e4c7f966a0192a1dabb7fb4935b33db39344ab5b861f9d81486f1362' - 'e1d8623ea117be3d2537cc7f7465cae6e45d0309a502a0ed2b3bd9cd41e14e0e' + 'c3daf448a0460f36ac471d2d4982874207888148ac3f03fbc2f003eccc2c2a45' 'c1f6a18b03d1612b60f8081428f00cfac5e66315fe9d42719f01cf5564deeeff') diff --git a/setup_dxvk.sh b/setup_dxvk.sh index 287a27244f58..773a141b697c 100755 --- a/setup_dxvk.sh +++ b/setup_dxvk.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -set -x - # default directories dxvk_lib32=${dxvk_lib32:-"x32"} dxvk_lib64=${dxvk_lib64:-"x64"} @@ -55,15 +53,15 @@ export WINEDEBUG=-all export WINEDLLOVERRIDES="mscoree,mshtml=" wineserver="wineserver" -wine="wine" -wine64="wine64" -wineboot="wineboot" # $PATH is the way for user to control where wine is located (including custom Wine versions). # Pure 64-bit Wine (non Wow64) requires skipping 32-bit steps. # In such case, wine64 and winebooot will be present, but wine binary will be missing, # however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing. wine_path=$(dirname "$(which $wineserver)") +wine="$wine_path/wine" +wine64="$wine_path/wine64" +wineboot="$wine_path/wineboot" # Thank you winetricks! get_file_arch() @@ -74,8 +72,6 @@ get_file_arch() case "${_W_ob_output}" in "3e") _W_file_arch="x86_64" ;; "03"|"06") _W_file_arch="i386" ;; - "b7") _W_file_arch="aarch64" ;; - "28") _W_file_arch="aarch32" ;; *) _W_file_arch="" ;; esac @@ -83,11 +79,9 @@ get_file_arch() } if [ -z "$WINEARCH" ]; then - wine_arch=$(get_file_arch "$wine_path/$wine") - wine64_arch=$(get_file_arch "$wine_path/$wine64") - if [ "$wine_arch" == "i386" ] && [ "$wine64_arch" == "x86_64" ]; then - arch=win64 - elif [ "$wine_arch" == "x86_64" ]; then + wine_arch=$(get_file_arch "$wine") + wine64_arch=$(get_file_arch "$wine64") + if [ "$wine_arch" == "x86_64" ] || [ "$wine64_arch" == "x86_64" ]; then arch=win64 elif [ "$wine_arch" == "i386" ] && [ "$wine64_arch" == "" ]; then arch=win32 @@ -96,8 +90,8 @@ else arch="$WINEARCH" fi -if ! [ -f "$wine_path/$wine64" ]; then - wine64="$wine_path/$wine" +if ! [ -f "$wine64" ]; then + wine64="$wine" fi if [ "$arch" == "win32" ]; then @@ -105,9 +99,9 @@ if [ "$arch" == "win32" ]; then fi # resolve 32-bit and 64-bit system32 path -winever="$($wineserver --version 2>&1 >/dev/null | grep Wine)" -if [ -z "$winever" ]; then - echo "$wineserver:"' Not a wine executable. Check your $wine.' >&2 +wine_ver="$($wineserver --version 2>&1 >/dev/null | grep Wine)" +if [ -z "$wine_ver" ]; then + echo "$wineserver:"' Not a wine executable. Check your wine install.' >&2 exit 1 fi @@ -135,7 +129,7 @@ overrideDll() { # remove dll override restoreDll() { - if ! $wine64 reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /f > /dev/null 2>&1; then + if ! $wine64 reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /f >/dev/null 2>&1; then echo "Failed to remove override for $1" fi } @@ -195,41 +189,39 @@ uninstallFile() { install() { if [ "$arch" == "win32" ]; then - installFile "$system32_path" "$dxvk_lib32" "$1" - inst64_ret="$?" + lib="$dxvk_lib32" + dll="${1}" else - installFile "$system32_path" "$dxvk_lib64" "$1" - inst64_ret="$?" + lib="$dxvk_lib64" + dll="${1}" fi - - inst32_ret=-1 - if [ -d "$syswow64_path" ]; then - installFile "$syswow64_path" "$dxvk_lib32" "$1" - inst32_ret="$?" + if installFile "$system32_path" "$lib" "$dll"; then + overrideDll "$dll" fi - if (( (inst32_ret == 0) || (inst64_ret == 0) )); then - overrideDll "$1" + if [ -d "$syswow64_path" ]; then + if installFile "$syswow64_path" "$dxvk_lib32" "$1"; then + overrideDll "$1" + fi fi } uninstall() { if [ "$arch" == "win32" ]; then - uninstallFile "$system32_path" "$dxvk_lib32" "$1" - uninst64_ret="$?" + lib="$dxvk_lib32" + dll="${1}" else - uninstallFile "$system32_path" "$dxvk_lib64" "$1" - inst64_ret="$?" + lib="$dxvk_lib64" + dll="${1}" fi - - uninst32_ret=-1 - if [ -d "$syswow64_path" ]; then - uninstallFile "$syswow64_path" "$dxvk_lib32" "$1" - uninst32_ret="$?" + if uninstallFile "$system32_path" "$lib" "$dll"; then + restoreDll "$dll" fi - if (( (uninst32_ret == 0) || (uninst64_ret == 0) )); then - restoreDll "$1" + if [ -d "$syswow64_path" ]; then + if uninstallFile "$syswow64_path" "$dxvk_lib32" "$1"; then + restoreDll "$1" + fi fi } |