Unverified Commit 58071b89 authored by ghpzin's avatar ghpzin
Browse files

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();
      |     ^~~~~~~~~
```
parent 600472ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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/;