# Maintainer: ris pkgname=warcraft3-ris pkgver=1.26 pkgrel=1 pkgdesc="Warcraft III: The Frozen Throne" arch=('x86_64') license=('Custom') depends=('wine' 'xorg-xrandr') makedepends=('xorg-server-xvfb' 'imagemagick') options=('!strip' '!zipman') install=warcraft3-ris.install _install_path="/home/ris/Games/Wine/Warcraft-III" prepare() { cat << 'EOF' > "${srcdir}/run.sh" #!/usr/bin/env bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" export WINEPREFIX="${SCRIPT_DIR}" export WINEDEBUG="-all" RES=$(xrandr --current 2>/dev/null | grep '*' | head -n1 | awk '{print $1}') RES=${RES:-"1920x1080"} WIDTH="${RES%x*}" HEIGHT="${RES#*x}" if [ ! -f "${WINEPREFIX}/system.reg" ]; then WINEDLLOVERRIDES="mscoree=d;mshtml=d" /usr/bin/wineboot -u >/dev/null 2>&1 wineserver -w wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Gameplay" /v customkeys /t REG_DWORD /d 1 /f wine reg add "HKCU\Software\Wine\Explorer" /v "Desktop" /t REG_SZ /d "${WIDTH}x${HEIGHT}" /f wine reg add "HKCU\Software\Wine\Explorer\Desktops" /v "default" /t REG_SZ /d "${WIDTH}x${HEIGHT}" /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "reswidth" /t REG_DWORD /d $WIDTH /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "resheight" /t REG_DWORD /d $HEIGHT /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "colordepth" /t REG_DWORD /d 16 /f fi WINEDLLOVERRIDES="mscoree=d;mshtml=d" exec /usr/bin/wine "Frozen Throne.exe" -opengl -width "$WIDTH" -height "$HEIGHT" "$@" EOF cat << 'EOF' > "${srcdir}/run-reignofchaos.sh" #!/usr/bin/env bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" export WINEPREFIX="${SCRIPT_DIR}" export WINEDEBUG="-all" RES=$(xrandr --current 2>/dev/null | grep '*' | head -n1 | awk '{print $1}') RES=${RES:-"1920x1080"} WIDTH="${RES%x*}" HEIGHT="${RES#*x}" if [ ! -f "${WINEPREFIX}/system.reg" ]; then WINEDLLOVERRIDES="mscoree=d;mshtml=d" /usr/bin/wineboot -u >/dev/null 2>&1 wineserver -w wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Gameplay" /v customkeys /t REG_DWORD /d 1 /f wine reg add "HKCU\Software\Wine\Explorer" /v "Desktop" /t REG_SZ /d "${WIDTH}x${HEIGHT}" /f wine reg add "HKCU\Software\Wine\Explorer\Desktops" /v "default" /t REG_SZ /d "${WIDTH}x${HEIGHT}" /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "reswidth" /t REG_DWORD /d $WIDTH /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "resheight" /t REG_DWORD /d $HEIGHT /f wine reg add "HKCU\Software\Blizzard Entertainment\Warcraft III\Video" /v "colordepth" /t REG_DWORD /d 16 /f fi WINEDLLOVERRIDES="mscoree=d;mshtml=d" exec /usr/bin/wine "Warcraft III.exe" -opengl -width "$WIDTH" -height "$HEIGHT" "$@" EOF cat << 'EOF' > "${srcdir}/warcraft3-reignofchaos.desktop" [Desktop Entry] Type=Application Name=Warcraft 3 Reign of Chaos Exec=sh -c 'cd "\$(dirname "%k")" && ./run-reignofchaos.sh' Icon=warcraft3-reignofchaos Terminal=false Categories=Game;StrategyGame; EOF cat << EOF > "${srcdir}/warcraft3-reignofchaos-menu.desktop" [Desktop Entry] Type=Application Name=Warcraft 3 Reign of Chaos Exec=${_install_path}/run-reignofchaos.sh Icon=warcraft3-reignofchaos Terminal=false Categories=Game;StrategyGame; EOF cat << 'EOF' > "${srcdir}/warcraft3.desktop" [Desktop Entry] Type=Application Name=Warcraft III: The Frozen Throne Exec=sh -c 'cd "\$(dirname "%k")" && ./run.sh' Icon=warcraft3 Terminal=false Categories=Game;StrategyGame; EOF cat << EOF > "${srcdir}/warcraft3-menu.desktop" [Desktop Entry] Type=Application Name=Warcraft III: The Frozen Throne Exec=${_install_path}/run.sh Icon=warcraft3 Terminal=false Categories=Game;StrategyGame; EOF } package() { local user_home="/home/ris" local icondir="${user_home}/.local/share/icons/hicolor" local appdir="${user_home}/.local/share/applications" mkdir -p "${pkgdir}${_install_path}" chmod 755 "$pkgdir/home" chmod 700 "$pkgdir/home/ris" tar --strip-components=1 -xvf "$startdir/assets/Warcraft-III.tar.zst" -C "${pkgdir}${_install_path}" install -Dm755 "${srcdir}/run.sh" "${pkgdir}${_install_path}/run.sh" install -Dm755 "${srcdir}/run-reignofchaos.sh" "${pkgdir}${_install_path}/run-reignofchaos.sh" install -Dm644 "${srcdir}/warcraft3.desktop" "${pkgdir}${_install_path}/warcraft3.desktop" install -Dm644 "${srcdir}/warcraft3-menu.desktop" "${pkgdir}${appdir}/warcraft3.desktop" install -Dm644 "${srcdir}/warcraft3-reignofchaos.desktop" "${pkgdir}${_install_path}/warcraft3-reignofchaos.desktop" install -Dm644 "${srcdir}/warcraft3-reignofchaos-menu.desktop" "${pkgdir}${appdir}/warcraft3-reignofchaos.desktop" cp "$startdir/assets/zkratky/CustomKeys.txt" "${pkgdir}${_install_path}/" local ico_path="${pkgdir}${_install_path}/Frozen Throne.ico" install -d "${pkgdir}${icondir}/16x16/apps" install -d "${pkgdir}${icondir}/24x24/apps" install -d "${pkgdir}${icondir}/32x32/apps" install -d "${pkgdir}${icondir}/256x256/apps" magick "${ico_path}[0]" "${pkgdir}${icondir}/256x256/apps/warcraft3.png" magick "${ico_path}[4]" "${pkgdir}${icondir}/32x32/apps/warcraft3.png" magick "${ico_path}[5]" "${pkgdir}${icondir}/16x16/apps/warcraft3.png" magick "$ico_path" \ \( -clone 0 -resize 24x24 +write "${pkgdir}${icondir}/24x24/apps/warcraft3.png" \) \ -exit local ico_path="${pkgdir}${_install_path}/Warcraft III.ico" magick "${ico_path}[0]" "${pkgdir}${icondir}/256x256/apps/warcraft3-reignofchaos.png" magick "${ico_path}[4]" "${pkgdir}${icondir}/32x32/apps/warcraft3-reignofchaos.png" magick "${ico_path}[5]" "${pkgdir}${icondir}/16x16/apps/warcraft3-reignofchaos.png" magick "$ico_path" \ \( -clone 0 -resize 24x24 +write "${pkgdir}${icondir}/24x24/apps/warcraft3-reignofchaos.png" \) \ -exit install -Dm644 "$startdir/PKGBUILD" -t "$pkgdir/usr/share/doc/$pkgname/" chown -R ris:ris "${pkgdir}/home/ris" } : << 'COMMENT' Beh pres celou obrazovku bey exkluzivniho fullscreenu: - pridat do sekce applications v souboru /home/ris/.config/openbox/lxde-rc.xml yes yes normal no true samotna hra se pak spousti s parametrem -windowed WINEDLLOVERRIDES="mscoree=d;mshtml=d" exec /usr/bin/wine "Frozen Throne.exe" -opengl -windowed "$@" COMMENT