Skip to content

Commit

Permalink
winetricks: workaround missing /usr/bin/wine64
Browse files Browse the repository at this point in the history
  • Loading branch information
jre-wine committed Feb 18, 2024
1 parent a9a5567 commit b449a07
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/winetricks
Original file line number Diff line number Diff line change
Expand Up @@ -5089,10 +5089,31 @@ winetricks_set_wineprefix()
elif command -v "${WINE}64" >/dev/null 2>&1; then
WINE64="${WINE}64"
else
# Handle case where wine binaries (or binary wrappers) have a suffix
WINE64="$(dirname "${WINE}")/"
[ "${WINE64}" = "./" ] && WINE64=""
WINE64="${WINE64}$(basename "${WINE}" | sed 's/^wine/wine64/')"
# wineboot often is a link next to wineserver (whose path we already know)
# pointing to wineapploader in Wine's bindir. So try this to figure out Wine's bindir.
WINEBOOT_BIN="$(echo "${WINESERVER_BIN}"|sed 's,wineserver,wineboot,')"
if [ -x "${WINEBOOT_BIN}" ]; then
if [ -n "${READLINK_F}" ]; then
true
elif [ "$(uname -s)" = "Darwin" ]; then
# readlink exists on MacOS, but does not support "-f" on MacOS < 12.3
# Use perl instead
READLINK_F="perl -MCwd=abs_path -le 'print abs_path readlink(shift);'"
else
READLINK_F="readlink -f"
fi
WINE_BINDIR="$(dirname "$(${READLINK_F} "${WINEBOOT_BIN}" 2>/dev/null)" 2>/dev/null)"
if [ -x "${WINE_BINDIR}/wine64" ]; then
# Workaround case where wine and related binaries are in path,
# but wine64 is only in Wine's bindir
WINE64="${WINE_BINDIR}/wine64"
fi
else
# Handle case where wine binaries (or binary wrappers) have a suffix
WINE64="$(dirname "${WINE}")/"
[ "${WINE64}" = "./" ] && WINE64=""
WINE64="${WINE64}$(basename "${WINE}" | sed 's/^wine/wine64/')"
fi
fi
WINE_ARCH="${WINE64}"
WINE_MULTI="${WINE}"
Expand Down

0 comments on commit b449a07

Please sign in to comment.