makedeb


soh-bin 8.0.5-0


An unofficial port of The Legend of Zelda Ocarina of Time for PC

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for soh-bin.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
pkgname=soh-bin
_pkgname=soh
pkgver="8.0.5"
# the teenagers running the project have a second nonstandard version scheme just to annoy us 
_extraver="MacReady-Foxtrot"
pkgrel=0
pkgdesc="An unofficial port of The Legend of Zelda Ocarina of Time for PC"
arch=("amd64")
url="https://shipofharkinian.com/"
license=('freeware')
conflicts=('soh' 'soh-git' 'soh-otr-exporter' 'soh-otr-exporter-git' 'soh-otr-exporter-bin')
provides=('soh' 'soh-otr-exporter' 'soh-otr-exporter-bin')
optdepends=("zenity" "soh-otr")
# Performance
source=("soh-${pkgver}.zip::https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}/SoH-${_extraver}-Linux-Performance.zip")
# Compatibility
#source=("soh-${pkgver}.zip::https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}/SoH-${_extraver}-Linux-Compatibility.zip")
b2sums=('aed28c557407df46d56817e248999a54bcbacf3e454a6e31d7925112e5b3d7948be3f6377a1e8529ca7e924e25f337c141bf448dda024454c8bacd4775125de9')

prepare() {
  cd "$srcdir"
  chmod +x "${_pkgname}.appimage"
  ./"${_pkgname}.appimage" --appimage-extract

  # adjust soh.desktop
  # renamed executable
  sed -i 's!Exec=soh.sh!Exec=soh!' "$srcdir/squashfs-root/usr/share/applications/${_pkgname}.desktop"
  # Remove X-AppImage-Version
  sed -i '/AppImage/d' "$srcdir/squashfs-root/usr/share/applications/${_pkgname}.desktop"

  # adjust soh.sh
  # adjust paths
  sed -i '/export PATH=/d' "$srcdir/squashfs-root/usr/bin/soh.sh"
  sed -i '/^HERE=/d' "$srcdir/squashfs-root/usr/bin/soh.sh"
  sed -i "s!export LD_LIBRARY_PATH=.*!export LD_LIBRARY_PATH=\"/usr/lib/${_pkgname}\"!" "$srcdir/squashfs-root/usr/bin/soh.sh"
  sed -i "s!export SHIP_HOME=.*!export SHIP_HOME=\"\${XDG_CONFIG_HOME:-\$HOME/.config}/${_pkgname}\"!" "$srcdir/squashfs-root/usr/bin/soh.sh"
  sed -i "s!export SHIP_BIN_DIR=.*!export SHIP_BIN_DIR=\"/usr/libexec/${_pkgname}\"!" "$srcdir/squashfs-root/usr/bin/soh.sh"
  # link system otr
  sed -i 's!touch "$SHIP_HOME"/mods/custom_otr_files_go_here.txt!touch "$SHIP_HOME"/mods/custom_otr_files_go_here.txt\nfi\n\nif \[\[ (\! -e "$SHIP_HOME"/oot.otr) \&\& (\! -e "$SHIP_HOME"/oot-mq.otr) \&\& ( -z \"\$SOHEXTRACTONLY\" ) \]\]\; then\n  \[ -e /usr/share/games/soh/oot* ] \&\& ln -s /usr/share/games/soh/oot* "$SHIP_HOME"/!' "$srcdir/squashfs-root/usr/bin/soh.sh"
  # minnor bug
  sed -i "s!ln -s \"\$HERE\"/usr/bin!ln -s \"\$SHIP_BIN_DIR\"!" "$srcdir/squashfs-root/usr/bin/soh.sh"
  # extract without playing
  sed -i "s!(cd \"\$SHIP_BIN_DIR\"\;!\[ -z \"\$SOHEXTRACTONLY\" \] \&\& (cd \"\$SHIP_BIN_DIR\"\;!" "$srcdir/squashfs-root/usr/bin/soh.sh"
}

package() {
  cd "$srcdir"
  # Creating Directories
  install -m755 -d "$pkgdir/usr/"{games,libexec,lib,share/doc}
  # wrapper script
  mv "$srcdir/squashfs-root/usr/bin/soh.sh" "$pkgdir/usr/games/soh"
  # libexec
  mv  "$srcdir/squashfs-root/usr/bin" "$pkgdir/usr/libexec/${_pkgname}"
  # lib
  mv  "$srcdir/squashfs-root/usr/lib" "$pkgdir/usr/lib/${_pkgname}"
  # applications, icons
  mv  "$srcdir/squashfs-root/usr/share/"{applications,icons} "$pkgdir/usr/share/"
  # doc
  mv  "$srcdir/squashfs-root/usr/share/doc" "$pkgdir/usr/share/doc/${_pkgname}"
  install -Dm644 "$srcdir/readme.txt" "$pkgdir/usr/share/doc/$_pkgname/readme"
}