joeylib2/installer/components/merlin32.sh
2026-10-13 14:01:46 -05:00

45 lines
1.2 KiB
Bash

# Part of JoeyLib, Copyright (c) 2026 Scott Duensing, under the MIT License.
# See LICENSE.md for license information.
# SPDX-License-Identifier: MIT
#
# Merlin32 1.1: 65816 assembler, used only for the NinjaTrackerPlus audio
# replayer (third-party Merlin source). The release zip carries a prebuilt
# x86-64 Linux binary.
compDescription="IIgs assembler: Merlin32 1.1 (for the NinjaTrackerPlus replayer)"
compGroups="toolchain:iigs"
compRequires="host"
compHostDeps="unzip"
compUrl="https://brutaldeluxe.fr/products/crossdevtools/merlin/Merlin32_v1.1.zip"
compSha256="6a4ebd09ed8800a3874b15e35b5d16469a8ad08dd477b9f84cbd5ce8832dc108"
compPin="$compSha256"
compInstall() {
local zip
local src
zip="$(fetchFile "$compUrl" "$compSha256")"
src="$(freshBuildDir "$compId")"
extractArchive "$zip" "$src"
install -D -m 755 "$src/Merlin32_v1.1/Linux/Merlin32" "$compDir/bin/merlin32"
dropBuildDir "$compId"
}
compInstalled() {
[ -x "$compDir/bin/merlin32" ]
}
compVerify() {
local banner
verifyLinked "$compDir/bin"
# Run with no arguments it prints its banner and exits non-zero.
banner="$("$compDir/bin/merlin32" 2>&1 || true)"
[[ "$banner" == *"v 1.1,"* ]]
}
compEnv() {
envVar IIGS_AS "$compDir/bin/merlin32"
}