From 58071b89703da188f7a7ae93587fff8d0d054594 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Wed, 17 Sep 2025 21:36:53 +0300 Subject: [PATCH] timidity: fix build with gcc15 - add "-std=gnu17" to `env.NIX_CFLAGS_COMPILE` Upstream had no version updates since 2018 Other distros also opted for "-std=gnu11" or "-std=gnu17": https://src.fedoraproject.org/rpms/timidity++/c/ce4c5633a1d10d9065a0da748e27308a7c5c4bc7 https://github.com/gentoo/gentoo/commit/80744c4db244cadc7a5bf9da9d975404222431d6 Fixes build failure with gcc15: ``` nkflib.c:389:5: error: conflicting types for 'line_fold'; have 'int(void)' 389 | int line_fold(); | ^~~~~~~~~ nkflib.c:319:17: note: previous declaration of 'line_fold' with type 'int(int, int)' 319 | static int line_fold(int c2,int c1); | ^~~~~~~~~ nkflib.c: In function 'e_oconv': nkflib.c:1594:16: error: too many arguments to function 'line_fold'; expected 0, have 2 1594 | switch(line_fold(c2,c1)) { | ^~~~~~~~~ ~~ nkflib.c:389:5: note: declared here 389 | int line_fold(); | ^~~~~~~~~ nkflib.c: In function 's_oconv': nkflib.c:1646:16: error: too many arguments to function 'line_fold'; expected 0, have 2 1646 | switch(line_fold(c2,c1)) { | ^~~~~~~~~ ~~ nkflib.c:389:5: note: declared here 389 | int line_fold(); | ^~~~~~~~~ nkflib.c: In function 'j_oconv': nkflib.c:1694:16: error: too many arguments to function 'line_fold'; expected 0, have 2 1694 | switch(line_fold(c2,c1)) { | ^~~~~~~~~ ~~ nkflib.c:389:5: note: declared here 389 | int line_fold(); | ^~~~~~~~~ nkflib.c: At top level: nkflib.c:1829:1: error: conflicting types for 'line_fold'; have 'int(int, int)' 1829 | line_fold(int c2, int c1) | ^~~~~~~~~ nkflib.c:389:5: note: previous declaration of 'line_fold' with type 'int(void)' 389 | int line_fold(); | ^~~~~~~~~ ``` --- pkgs/by-name/ti/timidity/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/ti/timidity/package.nix b/pkgs/by-name/ti/timidity/package.nix index 73300dfa3cd5..1d26190c5b52 100644 --- a/pkgs/by-name/ti/timidity/package.nix +++ b/pkgs/by-name/ti/timidity/package.nix @@ -99,6 +99,9 @@ stdenv.mkDerivation rec { sed -i 's/^\(calcnewt\$(EXEEXT):\).*/\1/g' timidity/Makefile ''; + # Fix build with gcc15 + env.NIX_CFLAGS_COMPILE = "-std=gnu17"; + # the instruments could be compressed (?) postInstall = '' mkdir -p $out/share/timidity/;