about summary refs log tree commit diff
path: root/pkgs/applications/emulators
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-12-03 23:18:22 +0100
committerGitHub <noreply@github.com>2023-12-03 23:18:22 +0100
commit091198f215b30eec589f7c40461940c0240c3fc0 (patch)
tree80480473933fabc50d16f16c4f21044f560a5a01 /pkgs/applications/emulators
parent694dce5e3c732f4308bfa75fc00387381ac52215 (diff)
parent2473cdbf73f8e3c88fd68e7a2497cd6b5233eef8 (diff)
Merge pull request #271207 from OPNA2608/fix/dosbox-x_modem
{dosbox,dosbox-x}: Fix modem & IPX support, fix crash with Windows 3.0
Diffstat (limited to 'pkgs/applications/emulators')
-rw-r--r--pkgs/applications/emulators/dosbox-x/default.nix19
-rw-r--r--pkgs/applications/emulators/dosbox/default.nix3
2 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/applications/emulators/dosbox-x/default.nix b/pkgs/applications/emulators/dosbox-x/default.nix
index 3c0805e270b46..f26a128842221 100644
--- a/pkgs/applications/emulators/dosbox-x/default.nix
+++ b/pkgs/applications/emulators/dosbox-x/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , alsa-lib
 , AudioUnit
 , autoreconfHook
@@ -36,6 +37,21 @@ stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-YNYtYqcpTOx4xS/LXI53h3S+na8JVpn4w8Dhf4fWNBQ=";
   };
 
+  patches = [
+    # 2 patches which fix stack smashing when launching Windows 3.0
+    # Remove when version > 2023.10.06
+    (fetchpatch {
+      name = "0001-dosbox-x-Attempt-to-fix-graphical-palette-issues-added-by-TTF-fix.patch";
+      url = "https://github.com/joncampbell123/dosbox-x/commit/40bf135f70376b5c3944fe2e972bdb7143439bcc.patch";
+      hash = "sha256-9whtqBkivYVYaPObyTODtwcfjaoK+rLqhCNZ7zVoiGI=";
+    })
+    (fetchpatch {
+      name = "0002-dosbox-x-Fix-Sid-Meiers-Civ-crash.patch";
+      url = "https://github.com/joncampbell123/dosbox-x/compare/cdcfb554999572e758b81edf85a007d398626b78..ac91760d9353c301e1da382f93e596238cf6d336.patch";
+      hash = "sha256-G7HbUhYEi6JJklN1z3JiOTnWLuWb27bMDyB/iGwywuY=";
+    })
+  ];
+
   strictDeps = true;
 
   nativeBuildInputs = [
@@ -66,6 +82,9 @@ stdenv.mkDerivation (finalAttrs: {
     Cocoa
   ];
 
+  # Tests for SDL_net.h for modem & IPX support, not automatically picked up due to being in SDL2 subdirectory
+  env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_net}/include/SDL2";
+
   configureFlags = [ "--enable-sdl2" ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/emulators/dosbox/default.nix b/pkgs/applications/emulators/dosbox/default.nix
index d0c9d8450e2b4..f17d3a783ba9d 100644
--- a/pkgs/applications/emulators/dosbox/default.nix
+++ b/pkgs/applications/emulators/dosbox/default.nix
@@ -50,6 +50,9 @@ stdenv.mkDerivation rec {
     libGLU
   ]);
 
+  # Tests for SDL_net.h for modem & IPX support, not automatically picked up due to being in SDL subdirectory
+  env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL_net}/include/SDL";
+
   hardeningDisable = [ "format" ];
 
   configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";