makedeb


soh-letitsnow-bin 8.0.3-0


Christmas 2023 SoH version

Viewing /PKGBUILD.

View raw.

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

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
pkgname=soh-letitsnow-bin
_pkgname=soh
__pkgname=soh-letitsnow
pkgver="8.0.3"
# the teenagers running the project have a second nonstandard version scheme just to annoy us 
_extraver="Holiday-2023"
pkgrel=0
pkgdesc="Christmas 2023 SoH version"
arch=("amd64")
url="https://shipofharkinian.com/"
license=('freeware')
conflicts=('soh-letitsnow')
provides=('soh-letitsnow' 'soh-letitsnow-otr-exporter' 'soh-letitsnow-otr-exporter-bin')
optdepends=("zenity" "soh-letitsnow-otr")
# Performance
source=("soh-${pkgver}.zip::https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}-letitsnow/SoH-${_extraver}-Linux-Performance.zip"
        "https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}-letitsnow/HM64_Holiday_2023_AssetPack.zip")
# Compatibility
#source=("soh-${pkgver}.zip::https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}-letitsnow/SoH-${_extraver}-Linux-Compatibility.zip"
#        "https://github.com/HarbourMasters/Shipwright/releases/download/${pkgver}-letitsnow/HM64_Holiday_2023_AssetPack.zip")
b2sums=('527cbeb22d3778e4a2fafd2fbbef7992629fdfb44b1707e216b450d86a9bf79534a2e3c1e629a69ca1296e572e9c6ababd4d9c4bf14b76cfd32b85297cb177fc'
        '52c3648389458034b5640aa5cef0adc02f937be29750b9f672201a004d10cc4ede3d9d54000777736c6153c268ba9ec30ff3aa1bdf3267ecc1d47f550a88b3b5')

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

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

  # adjust icon
  mv "$srcdir/squashfs-root/usr/share/icons/hicolor/512x512/apps/sohIcon.png" "$srcdir/squashfs-root/usr/share/icons/hicolor/512x512/apps/${__pkgname}Icon.png"

  # 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/mod
  sed -i 's!touch "$SHIP_HOME"/mods/custom_otr_files_go_here.txt!touch "$SHIP_HOME"/mods/custom_otr_files_go_here.txt\nln -s "/usr/share/games/soh-letitsnow/mods/HolidaysInHyrule"* "$SHIP_HOME/mods/"\nfi\n\nif \[\[ (\! -e "$SHIP_HOME"/oot.otr) \&\& (\! -e "$SHIP_HOME"/oot-mq.otr) \&\& ( -z \"\$SOHEXTRACTONLY\" ) \]\]\; then\n  \[ -e /usr/share/games/soh-letitsnow/oot* ] \&\& ln -s /usr/share/games/soh-letitsnow/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,games/${__pkgname}/mods}}
  # wrapper script
  mv "$srcdir/squashfs-root/usr/bin/soh.sh" "$pkgdir/usr/games/${__pkgname}"
  # libexec
  mv  "$srcdir/squashfs-root/usr/bin" "$pkgdir/usr/libexec/${__pkgname}"
  # lib
  mv  "$srcdir/squashfs-root/usr/lib" "$pkgdir/usr/lib/${__pkgname}"
  # mod
  mv  "$srcdir/HolidaysInHyrule"* "$pkgdir/usr/share/games/${__pkgname}/mods/"
  # 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"
}