mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 14:00:04 +00:00
dosbox-x: Add a basic installCheck
Start up its PC-98 machine emulation and run `VER` to get the emulated DOS version. Would like to do smth more complex (custom DOS binary that uses INT 21h, AH=09h to print the text, or maybe some interrupts more specific to the PC-98 series to test if it's actually emulating the right machine), but would need OpenWatcom for compiling that, which we consider unfree due to the Sybase Open Watcom Public License being quite badly written.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
writers,
|
||||
alsa-lib,
|
||||
autoreconfHook,
|
||||
ffmpeg,
|
||||
@@ -27,6 +28,14 @@
|
||||
zlib,
|
||||
}:
|
||||
|
||||
let
|
||||
check-dosbox-conf = writers.writeText "check-dosbox.conf" ''
|
||||
[autoexec]
|
||||
MOUNT C .
|
||||
|
||||
VER > C:\BLUB
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "dosbox-x";
|
||||
version = "2026.08.31";
|
||||
@@ -111,6 +120,26 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
makeWrapper $out/Applications/dosbox-x.app/Contents/MacOS/dosbox-x $out/bin/dosbox-x
|
||||
'';
|
||||
|
||||
# Can't personally check Darwin anymore
|
||||
doInstallCheck = !stdenv.hostPlatform.isDarwin;
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
env \
|
||||
SDL_AUDIODRIVER=dummy \
|
||||
SDL_VIDEODRIVER=dummy \
|
||||
$out/bin/dosbox-x \
|
||||
-nopromptfolder -nogui \
|
||||
-exit \
|
||||
-machine pc98 \
|
||||
-conf ${check-dosbox-conf}
|
||||
|
||||
grep -q 'Reported DOS version' BLUB
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests.version = testers.testVersion {
|
||||
package = finalAttrs.finalPackage;
|
||||
|
||||
Reference in New Issue
Block a user