joeylib2/installer/components/dosbox.sh
2026-09-29 19:31:34 -05:00

42 lines
1.2 KiB
Bash

# DOSBox Staging 0.83.0: the DOS emulator (for DOS and for DVX, which runs
# on it), as the project's own prebuilt Linux release (bundled libraries),
# because Debian/Ubuntu only package the old 0.74 and the gates are written
# for Staging.
compDescription="emulator: DOSBox Staging 0.83.0 (MS-DOS, DVX; upstream Linux release)"
compGroups="emulator:dos emulator:dvx"
compRequires="host"
compHostDeps="xz"
compUrl="https://github.com/dosbox-staging/dosbox-staging/releases/download/v0.83.0/dosbox-staging-linux-x86_64-v0.83.0.tar.xz"
compSha256="d3a94f7f1c3e68a47ec88d61145506c7904452adb0c9c5928cb8cfe2331d6c5c"
compPin="$compSha256"
compInstall() {
local archive
archive="$(fetchFile "$compUrl" "$compSha256")"
rm -rf "$compDir"
extractArchive "$archive" "$compDir" 1
}
compInstalled() {
[ -x "$compDir/dosbox" ]
}
compVerify() {
local xdg
local version
verifyLinked "$compDir"
# Isolated: even --version creates ~/.config/dosbox otherwise.
xdg="$(mktemp -d)"
version="$(XDG_CONFIG_HOME="$xdg" "$compDir/dosbox" --noprimaryconf --nolocalconf --version 2>&1 || true)"
rm -rf "$xdg"
[[ "$version" == *"version 0.83.0"* ]]
}
compEnv() {
envVar DOSBOX "$compDir/dosbox"
}