summary refs log tree commit diff
path: root/pkgs/applications/audio/gmu
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2021-11-07 09:47:57 +0000
committerSergei Trofimovich <slyich@gmail.com>2021-11-07 09:51:15 +0000
commitdee3169047a7f5cf4713ca7dc85a8e491354c418 (patch)
tree7f4c2cd6c69315b944fbd13e2b9059ab302b4add /pkgs/applications/audio/gmu
parent83c93c8e1c01425d69bf06b2bf3c0ac5f9282443 (diff)
downloadnixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar.gz
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar.bz2
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar.lz
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar.xz
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.tar.zst
nixpkgs-dee3169047a7f5cf4713ca7dc85a8e491354c418.zip
gmu: pull pending upstream inclusion fix for ncurses-6.3
Without the fix build on ncurses-6.3 fails as:

    src/tools/ui.c: In function 'ui_draw_footer_button':
    src/tools/ui.c:329:9: error: format not a string literal and no format arguments [-Werror=format-security]
      329 |         wprintw(ui->win_footer->win, key);
          |         ^~~~~~~

While at it pulled fix for upstream gcc-10 and clang-12 which
default to -fno-common. Otherwise build would fail as:

    $ nix build --impure --expr 'with import ./. {}; gmu.override { stdenv = clang12Stdenv; }' -L
    ...
    gmu> ld: feloader.o:(.bss+0x8): multiple definition of `dlsymunion';
      decloader.o:(.bss+0x8): first defined here
Diffstat (limited to 'pkgs/applications/audio/gmu')
-rw-r--r--pkgs/applications/audio/gmu/default.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/pkgs/applications/audio/gmu/default.nix b/pkgs/applications/audio/gmu/default.nix
index b2b9f5e3475..cc2b46cd6ac 100644
--- a/pkgs/applications/audio/gmu/default.nix
+++ b/pkgs/applications/audio/gmu/default.nix
@@ -1,4 +1,4 @@
-{lib, stdenv, fetchurl, SDL, SDL_gfx, SDL_image, tremor, flac, mpg123, libmikmod
+{lib, stdenv, fetchurl, fetchpatch, SDL, SDL_gfx, SDL_image, tremor, flac, mpg123, libmikmod
 , speex, ncurses
 , keymap ? "default"
 , conf ? "unknown"
@@ -13,6 +13,24 @@ stdenv.mkDerivation rec {
     sha256 = "03x0mc0xw2if0bpf0a15yprcyx1xccki039zvl2099dagwk6xskv";
   };
 
+  patches = [
+     # pull pending upstream inclusion fix for ncurses-6.3:
+     #  https://github.com/jhe2/gmu/pull/7
+     (fetchpatch {
+       name = "ncurses-6.3.patch";
+       url = "https://github.com/jhe2/gmu/commit/c8b3a10afee136feb333754ef6ec26383b11072f.patch";
+       sha256 = "0xp2j3jp8pkmv6yvnzi378m2dylbfsaqrsrkw7hbxw6kglzj399r";
+     })
+
+     # pull upstream fix for -fno-common toolchains like
+     # upstream gcc-10 of clang-13.
+     (fetchpatch {
+       name = "fno-common.patch";
+       url = "https://github.com/jhe2/gmu/commit/b705209f08ddfda141ad358ccd0c3d2d099be5e6.patch";
+       sha256 = "1ci2b8kz3r58rzmivlfhqjmcgqwlkwlzzhnyxlk36vmk240a3gqq";
+     })
+  ];
+
   buildInputs = [ SDL SDL_gfx SDL_image tremor flac mpg123 libmikmod speex ncurses ];
 
   makeFlags = [ "PREFIX=$(out)" ];