appdwarf/apps/mkwine

30 lines
977 B
Bash
Executable file

#!/bin/sh
PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/appdwarf/wine
mkdir -p $DIR
LINK="$(curl https://api.github.com/repos/Kron4ek/Wine-Builds/releases | grep -om1 http.\*-staging-tkg-amd64.tar.xz)"
[ "$1" = "proton" ] && LINK="$(curl https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases | grep -om1 http.\*tar.gz)" && shift
curl -L "$LINK" | bsdtar xf - -C$DIR
mv $DIR/wine*/* $DIR/GE-Proton*/files/* $DIR
rm -rf $DIR/wine*/ $DIR/GE-Proton*/
wget -O$DIR/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x $DIR/bin/winetricks
cat > $DIR/AppRun << 'EOF'
#!/bin/sh
export WINE="$APPDIR"/bin/wine
export WINE64="$WINE"64 WINESERVER="$WINE"server WINETRICKS="$WINE"tricks
export DXVK_STATE_CACHE_PATH=~/.cache DXVK_LOG_PATH=none
[ "$1" = "winetricks" ] && shift && exec "$WINETRICKS" "$@"
"$WINE64" "$@"
"$WINESERVER" -w
EOF
chmod +x $DIR/AppRun
appdwarf $DIR "$@"
rm -r $DIR
mv $DIR.sh wine