joeylib2/installer/components/ptplayer.sh

48 lines
1.5 KiB
Bash

# shellcheck shell=bash
# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License.
# See LICENSE.md for license information.
# SPDX-License-Identifier: MIT
#
# PTPlayer 6.4: Frank Wille's ProTracker replayer for the Amiga, used by
# the Amiga audio HAL, with JoeyLib's patches (installer/patches/ptplayer),
# which make it play as Protracker 2.3 and the other ports' module player do.
# Aminet's URL is not versioned, so the pin is the archive's checksum.
compDescription="Amiga audio: PTPlayer 6.4 (ProTracker replayer) + JoeyLib patch"
compGroups="toolchain:amiga"
compRequires="host"
compHostDeps="lhasa patch"
compUrl="http://aminet.net/mus/play/ptplayer.lha"
compSha256="5ba1285e91413f6b6cb72768c0c31cff90029af6920870d9f589689aa2e2161a"
patchDir="$JOEY_PATCHES/ptplayer"
# Editing a patch reinstalls PTPlayer, so the patches are part of the pin.
compPin="$compSha256 $(cat "$patchDir"/*.patch | sha256sum | cut -d' ' -f1)"
compInstall() {
local lha
local p
lha="$(fetchFile "$compUrl" "$compSha256")"
rm -rf "$compDir"
extractArchive "$lha" "$compDir"
for p in "$patchDir"/*.patch; do
info "applying $(basename "$p")"
patch -d "$compDir" -p1 -s -F0 --no-backup-if-mismatch < "$p"
done
}
compInstalled() {
[ -f "$compDir/ptplayer.asm" ]
}
# The patch is in: its volume slide that leaves the period alone.
compVerify() {
grep -q 'mt_volslide_noper' "$compDir/ptplayer.asm"
}
compEnv() {
envVar AMIGA_PTPLAYER "$compDir"
}