From 14ff6e7d01ab66453e52a2c537bd6e3243946467 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 7 Mar 2018 05:03:24 +0100 Subject: games/albion: Fix ancient wildmidi against GCC 7 The first error is that there was a case statement fallthrough which was actually unintended and is a bug in the ancient wildmidi used here, while the second one was because of a structure that wasn't initialized to zero before first use. Signed-off-by: aszlig --- pkgs/games/gog/albion/default.nix | 1 + pkgs/games/gog/albion/wildmidi-build-fixes.patch | 25 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/games/gog/albion/wildmidi-build-fixes.patch (limited to 'pkgs/games') diff --git a/pkgs/games/gog/albion/default.nix b/pkgs/games/gog/albion/default.nix index 1242ecb7..8ecc6e6e 100644 --- a/pkgs/games/gog/albion/default.nix +++ b/pkgs/games/gog/albion/default.nix @@ -22,6 +22,7 @@ let src = "${staticRecompilerSource}/midi-libs/${variant}-0.2.3.5svn"; nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ alsaLib ]; + patches = [ ./wildmidi-build-fixes.patch ]; postPatch = "sed -i -e '/^CFLAGS/s/-pedantic//' configure.ac"; }; diff --git a/pkgs/games/gog/albion/wildmidi-build-fixes.patch b/pkgs/games/gog/albion/wildmidi-build-fixes.patch new file mode 100644 index 00000000..204637ba --- /dev/null +++ b/pkgs/games/gog/albion/wildmidi-build-fixes.patch @@ -0,0 +1,25 @@ +diff --git a/src/wildmidi.c b/src/wildmidi.c +index 87a8861..6401b9b 100644 +--- a/src/wildmidi.c ++++ b/src/wildmidi.c +@@ -786,7 +786,7 @@ main (int argc, char **argv) { + + #ifndef _WIN32 + int my_tty; +- struct termios _tty; ++ struct termios _tty = {0}; + tcflag_t _res_oflg = _tty.c_oflag; + tcflag_t _res_lflg = _tty.c_lflag; + +diff --git a/src/wildmidi_lib.c b/src/wildmidi_lib.c +index 61df0cd..d527c94 100644 +--- a/src/wildmidi_lib.c ++++ b/src/wildmidi_lib.c +@@ -1852,6 +1852,7 @@ midi_setup_control (struct _mdi *mdi, unsigned char channel, unsigned char contr + case 98: + case 99: + tmp_event = *do_control_non_registered_param; ++ break; + case 100: + tmp_event = *do_control_registered_param_fine; + break; -- cgit 1.4.1