void-packages/srcpkgs/wine/files/wine

46 lines
1.3 KiB
Bash

#!/bin/sh -e
# Based on the Debian wrapper script written by Jens Reyer and Michael Gilbert
# SPDX-License-Identifier: LGPL-2.1-or-later
wine32=/usr/libexec/wine/wine
wine64=/usr/libexec/wine/wine64
wine32_hint () {
if [ "$(xbps-uhelper arch)" = "x86_64-musl" ]; then
echo "wine support under musl is limited to 64bit"
else
echo "it looks like wine-32bit is missing, you should install it."
if uname -a | grep "x86_64" > /dev/null && xbps-query -l | grep void-repo-multilib > /dev/null; then
echo "the multilib repository needs to be enabled first. as root, please"
echo "execute \"xbps-install -S void-repo-multilib && xbps-install -S wine-32bit\""
else
echo "as root, please execute \"xbps-install -S wine-32bit\""
fi
fi
}
if test -x $wine32; then
wine=$wine32
elif test -x $wine64; then
wine=$wine64
if test -z "$WINELOADER"; then
export WINELOADER=$wine64
fi
case "x$WINEDEBUG" in
x-all*|x*,-all*|x*err-all*)
;;
*)
wine32_hint >&2
;;
esac
else
echo "error: unable to find wine executable. this shouldn't happen." >&2
exit 1
fi
if test -z "$WINEDEBUG"; then
export WINEDEBUG=fixme-all
fi
exec $wine "$@"