diff options
author | aszlig <aszlig@nix.build> | 2018-03-07 05:03:24 +0100 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2018-03-07 05:03:24 +0100 |
commit | 14ff6e7d01ab66453e52a2c537bd6e3243946467 (patch) | |
tree | 72e00cf2ba633613e39ad4a5a5b5cc03025a021c | |
parent | 15925535271fd588b156f514c9bd2f8823cfff6b (diff) |
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 <aszlig@nix.build>
-rw-r--r-- | pkgs/games/gog/albion/default.nix | 1 | ||||
-rw-r--r-- | pkgs/games/gog/albion/wildmidi-build-fixes.patch | 25 |
2 files changed, 26 insertions, 0 deletions
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; |