makedeb


diablorl-wine 0.5.0-1


A roguelike game based on Blizzard's Diablo game (wine)

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for diablorl-wine.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>

# You need to activate multiarch for wine32
# sudo dpkg --add-architecture i386

_pkgname=diablorl
pkgname=diablorl-wine
pkgver=0.5.0
_dlname=diablorl-win-050
pkgrel=1
pkgdesc="A roguelike game based on Blizzard's Diablo game (wine)"
arch=("all")
url="https://diablo.chaosforge.org/"
license=("GPL3")
depends=('wine')
# for sound, edit config.lua and pass it the path to DIABDAT.MPQ from yout Diablo installation.
optdepends=('wine32: will be replaced by wow64'
            'diablo-data: packaged diablo data file for sound')
extensions=()
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("https://diablo.chaosforge.org/file_download/11/diablorl-win-050.zip"
        "${pkgname}.png::https://raw.githubusercontent.com/chaosforgeorg/diablorl/refs/heads/development/install/logo512t.png")
b2sums=('1759dc6185ae2d521cc44bc93cfefa7932f6d14da28d91c126885d433feda4e96ef3ac279ac27af3263b7175a844b9f4a855bd7eb86ae5098052193e60944e1a'
        '71a2c66ea7b9257f3230aff992107463926c92e46f1e6d5e5ec8845b8b0a4f77587df36c20d1fcd19561fc97c50561515d388a74a2a3b19a9388bb1d89a45198')

prepare() {
  # Warning about multiarch
  printf "\33[2K\r\033[1;33m%s\033[0m" "Warning:" >&2
  echo "You need to activate multiarch for wine32"
  printf "\33[2K\r\033[1;33m%s\033[0m" "Warning:" >&2
  echo "sudo dpkg --add-architecture i386"
  # cd
  cd "$srcdir/${_dlname}/"
  # fix permissions
  chmod 644 *
  # Unix line terminators
  sed -i 's/\r//' *.txt *.lua
  # DIABDAT.MPQ config 
  sed -i 's!sound     =.*!sound     = "DEFAULT"!;s!mpq       =.*!mpq       = "Z:\\\\usr\\\\share\\\\games\\\\diablo\\\\DIABDAT.MPQ"!' config.lua
  # Junk?
  rm fmod64.dll libpng13.dll
}

package() {
  cd "$srcdir/${_dlname}"
  # Creating Directories
  install -dm755 $pkgdir/usr/{games,share/{games/${_pkgname},doc/${_pkgname},applications,pixmaps}}
  # Install
  install -Dm644 *.exe *.dll *.lua *.mpq *.png "${pkgdir}/usr/share/games/${_pkgname}"

  # wrapper
echo '#!/bin/sh

set -eu

prog_name="diablo"
prog_real_path="/usr/share/games/diablorl"
prog_real_doc_path="/usr/share/doc/diablorl"
prog_home="${XDG_CONFIG_HOME:-$HOME/.config}/diablorl/wine"
prog_bin="rl.exe"
# home folder
mkdir -p "$prog_home"
cp -n "$prog_real_path/"*.lua "$prog_home"
cp -nas "$prog_real_path/"*.exe "$prog_real_path/"*.mpq "$prog_real_path/"*.png "$prog_home"
cp -nas "$prog_real_doc_path/manual" "$prog_home/manual.txt"
# cd
cd "$prog_home"
# exec
export WINEPATH="$prog_real_path"
exec wineconsole "$prog_home/$prog_bin" "$@"' > "$pkgdir/usr/games/${_pkgname}"
  chmod 755 "$pkgdir/usr/games/${_pkgname}"

  # doc
  install -Dm644 readme.txt "$pkgdir/usr/share/doc/${_pkgname}/readme"
  install -Dm644 version.txt "$pkgdir/usr/share/doc/${_pkgname}/changelog"
  install -Dm644 manual.txt "$pkgdir/usr/share/doc/${_pkgname}/manual"
  ln -s "/usr/share/common-licenses/GPL-3" "${pkgdir}/usr/share/doc/${_pkgname}/GPL-3"
  gzip "$pkgdir/usr/share/doc/${_pkgname}/changelog"

  # Deskrop file
echo "[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=${_pkgname}.png
Name=${_pkgname}
Comment=A roguelike based on Blizzard's Diablo game.
Exec=${_pkgname}
Categories=Application;Game;" > "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
  # Icon
  install -Dm644 "../${pkgname}.png" "$pkgdir/usr/share/pixmaps/${_pkgname}.png"
}