Commit ec9f9bc6 authored by Sergei Trofimovich's avatar Sergei Trofimovich Committed by Anderson Torres
Browse files

dosbox-staging: pull upstream fixes for SDL2_net and SDL2_image headers

Without the change `dosbox-staging` fails to build as:

    FAILED: src/dos/libdos.a.p/program_serial.cpp.o
    g++ -Isrc/dos/libdos.a.p -Isrc/dos -I../src/dos -I../include -I. -I.. -Isrc/libs/ghc -I../src/libs/ghc -Isrc/libs/loguru -I../src/libs/loguru -I/nix/store/58cdrn1birpig59wqygva9cmsnxh7wwa-SDL2-2.26.4-dev/include -I/nix/store/58cdrn1birpig59wqygva9cmsnxh7wwa-SDL2-2.26.4-dev/include/SDL2 -I/nix/store/y8ab9wi9sldj6y7md833xkbppgimrs>
    In file included from ../src/dos/../hardware/serialport/softmodem.h:30,
                     from ../src/dos/program_serial.cpp:27:
    ../src/dos/../hardware/serialport/misc_util.h:59:10: fatal error: SDL_net.h: No such file or directory
       59 | #include <SDL_net.h>
          |          ^~~~~~~~~~~
parent 1eea8d50
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, SDL2
, SDL2_image
, SDL2_net
@@ -39,6 +40,25 @@ stdenv.mkDerivation (self: {
    hash = "sha256-I90poBeLSq1c8PXyjrx7/UcbfqFNnnNiXfJdWhLPGMc=";
  };

  patches = [
    # Pull missind SDL2_net dependency:
    #   https://github.com/dosbox-staging/dosbox-staging/pull/2358
    (fetchpatch {
      name = "sdl2-net.patch";
      url = "https://github.com/dosbox-staging/dosbox-staging/commit/1b02f187a39263f4b0285323dcfe184bccd749c2.patch";
      hash = "sha256-Ev97xApInu6r5wvI9Q7FhkSXqtMW/rwJj48fExvqnT0=";
    })

    # Pull missing SDL2_image dependency:
    #   https://github.com/dosbox-staging/dosbox-staging/pull/2239
    (fetchpatch {
      name = "sdl2-image.patch";
      url = "https://github.com/dosbox-staging/dosbox-staging/commit/ca8b7a906d29a3f8ce956c4af7dc829a6ac3e229.patch";
      hash = "sha256-WtTVSWWSlfXrdPVsnlDe4P5K/Fnj4QsOzx3Wo/Kusmg=";
      includes = [ "src/gui/meson.build" ];
    })
  ];

  nativeBuildInputs = [
    copyDesktopItems
    gtest
@@ -69,11 +89,6 @@ stdenv.mkDerivation (self: {
    speexdsp
  ];

  env.NIX_CFLAGS_COMPILE = toString [
    "-I${SDL2_image}/include/SDL2"
    "-I${SDL2_net}/include/SDL2"
  ];

  desktopItems = [
    (makeDesktopItem {
      name = "dosbox-staging";