makedeb
An unofficial port of The Legend of Zelda Ocarina of Time for PC
Viewing /PKGBUILD
.
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.6"
# the teenagers running the project have a second nonstandard version scheme just to annoy us
_extraver="MacReady-Golf"
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=('b2a279e4b3a3632a4c7da85a2c22dd9c4874b1e3df2b1df718dd4d88733f27a677f8161d38d9a0f15daf1b310e4b2d038af6d75baa9dee61a5da35830787e902')
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"
}