-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emulators/wine-proton: add wow64 wrapper.
PR: 255381
- Loading branch information
Showing
5 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh -e | ||
if [ "$(id -u)" = 0 ] | ||
then | ||
echo "Don't run this script as root!" | ||
exit 1 | ||
fi | ||
|
||
I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}" | ||
|
||
mkdir -p "$I386_ROOT" | ||
ABI=$(pkg config ABI | sed s/amd64/i386/) | ||
echo pkg -o ABI="$ABI" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" | ||
exec pkg -o ABI="$ABI" -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh -e | ||
TARGET="$(realpath "$0")" | ||
PREFIX="${TARGET%/*/*}" | ||
LOCALBASE="${PREFIX%/*}" | ||
|
||
I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}" | ||
|
||
export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH:+$LIBGL_DRIVERS_PATH:}$LOCALBASE/lib/dri:$LOCALBASE/lib32/dri:$I386_ROOT/$LOCALBASE/lib/dri" | ||
export LD_32_LIBRARY_PATH="${LD_32_LIBRARY_PATH:+$LD_32_LIBRARY_PATH:}$I386_ROOT/$PREFIX/lib/wine:$LOCALBASE/lib32:$I386_ROOT/$LOCALBASE/lib:$I386_ROOT/$LOCALBASE/llvm10/lib:$I386_ROOT/$LOCALBASE/llvm11/lib" | ||
export LD_32_LIBRARY_PATH_RPATH=y | ||
|
||
if [ -z "$WINE_NO_WOW64" ] | ||
then | ||
export PATH="${TARGET%/*}:${PATH}" | ||
export WINESERVER="${TARGET}server" | ||
fi | ||
|
||
if [ ! -f "$I386_ROOT/$PREFIX/bin/wine" ] | ||
then | ||
printf "%s doesn't exist!\n\n" "$I386_ROOT/$PREFIX/bin/wine" | ||
printf "Try installing 32-bit wine with\n\t%s\n" "$PREFIX/bin/pkg32.sh install wine-proton mesa-dri" | ||
exit 1 | ||
fi | ||
|
||
WINE32_VERSION=$(env -u WINELOADERNOEXEC "$I386_ROOT/$PREFIX/bin/wine" --version) | ||
WINE64_VERSION=$(env -u WINELOADERNOEXEC "${TARGET}64" --version) | ||
if [ "$WINE32_VERSION" != "$WINE64_VERSION" ] | ||
then | ||
printf "wine [%s] and wine64 [%s] versions do not match!\n\n" "$WINE32_VERSION" "$WINE64_VERSION" | ||
printf "Try updating 32-bit wine with\n\t%s\n" "$PREFIX/bin/pkg32.sh upgrade" | ||
exit 1 | ||
fi | ||
|
||
exec "$I386_ROOT/$PREFIX/bin/wine" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
#!/bin/sh | ||
TARGET="`realpath $0`" | ||
export WINESERVER=${WINESERVER-${TARGET}server32} | ||
exec "${TARGET}32" "$@" | ||
TARGET="$(realpath "$0")" | ||
|
||
if [ -z "$WINESERVER" ] && [ -f "${TARGET}server32" ] | ||
then | ||
export WINESERVER="${TARGET}server32" | ||
fi | ||
|
||
export GST_PLUGIN_SYSTEM_PATH_1_0="${TARGET%/*/*/*}/lib/gstreamer-1.0" | ||
|
||
# workaround for https://bugs.winehq.org/show_bug.cgi?id=50257 | ||
export LD_BIND_NOW=1 | ||
export LD_32_BIND_NOW=1 | ||
|
||
# workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255336 | ||
if [ "$(uname -p)" = amd64 ] | ||
then | ||
export LD_LIBMAP="libgcc_s.so.1=/lib/libgcc_s.so.1,${LD_LIBMAP}" | ||
fi | ||
|
||
exec "${TARGET}.bin" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters