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

62 lines
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
#
# FS-UAE 3.1.66: the Amiga emulator. Debian and Ubuntu package exactly this
# version; Fedora does not package FS-UAE at all, so on dnf systems it is
# built from the upstream release tarball into toolchains/opt/fsuae.
compDescription="emulator: FS-UAE 3.1.66 (Amiga; distribution package, source build on dnf)"
compGroups="emulator:amiga"
compRequires="host"
compUrl="https://fs-uae.net/files/FS-UAE/Stable/3.1.66/fs-uae-3.1.66.tar.xz"
compSha256="606e1868b500413d69bd33bb469f8fd08d6c08988801f17b7dd022f3fbe23832"
if [ "$(distroFamily)" = "dnf" ]; then
fsuaeBin="$compDir/bin/fs-uae"
compHostDeps="build-tools make pkg-config gettext zip glib-dev openal-dev png-dev sdl2-dev zlib-dev gl-dev x11-dev xi-dev"
compPin="$compSha256"
else
fsuaeBin="$(command -v fs-uae || true)"
compHostDeps="fs-uae"
compPin="distro"
fi
compInstall() {
local src
local archive
if [ "$compPin" = "distro" ]; then
[ -n "$fsuaeBin" ] || die "fs-uae is not on PATH after installing host packages"
return 0
fi
src="$(freshBuildDir "$compId")"
archive="$(fetchFile "$compUrl" "$compSha256")"
extractArchive "$archive" "$src" 1
# libmpeg2 only plays CD32 FMV; nothing here needs it.
(cd "$src" && ./configure --prefix="$compDir" --without-libmpeg2)
make -C "$src" -j"$JOEY_JOBS"
rm -rf "$compDir"
make -C "$src" install
dropBuildDir "$compId"
}
compInstalled() {
[ -n "$fsuaeBin" ] && [ -x "$fsuaeBin" ]
}
compVerify() {
local version
version="$("$fsuaeBin" --version 2>&1)" || return 1
version="${version%%$'\n'*}"
# Another version still runs programs; only the gates may disagree.
if [ "$version" != "3.1.66" ]; then
warn "found FS-UAE '$version'; the Amiga gates were written against 3.1.66"
fi
}
compEnv() {
envVar FSUAE "$fsuaeBin"
}