From 1d43588b3046fc0ca6cea5963b8dfc8de5a55dc9 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 24 Feb 2026 21:44:27 +0000 Subject: [PATCH] sgfutils: fix `gcc-15` build Without the chnage the build fails on `master` as: ``` sgfinfo.c: In function 'report_on_single_game': sgfinfo.c:948:27: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(int)' [-Wincompatible-pointer-types] 948 | outmovefn = fns[(optM-1) % 3]; | ^ sgfinfo.c:952:25: error: too many arguments to function 'outmovefn'; expected 0, have 1 952 | outmovefn(i); | ^~~~~~~~~ ~ ``` --- pkgs/by-name/sg/sgfutils/gcc-15.patch | 26 ++++++++++++++++++++++++++ pkgs/by-name/sg/sgfutils/package.nix | 4 ++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/by-name/sg/sgfutils/gcc-15.patch diff --git a/pkgs/by-name/sg/sgfutils/gcc-15.patch b/pkgs/by-name/sg/sgfutils/gcc-15.patch new file mode 100644 index 000000000000..d1f74ec30596 --- /dev/null +++ b/pkgs/by-name/sg/sgfutils/gcc-15.patch @@ -0,0 +1,26 @@ +Generated as: +$ curl -L https://github.com/yangboz/sgfutils/pull/3.diff > gcc-15.patch + +Fix `gcc-15` build failure related to `c23` changes. +--- a/gib2sgf.c ++++ b/gib2sgf.c +@@ -433,7 +433,7 @@ static void stoline(char *buf) { + readmove(buf); + } + +-static void (*inputline[])() = { ++static void (*inputline[])(char*) = { + inline0, inline1, iniline, stoline + }; + +--- a/sgfinfo.c ++++ b/sgfinfo.c +@@ -940,7 +940,7 @@ void report_on_single_game() { + if (optM) { + int imin, imax; + void (*fns[3])(int) = { outmove, outmovec, outmovex }; +- void (*outmovefn)(); ++ void (*outmovefn)(int); + + /* 1..3 moves / 4..6 init / 7..9 both */ + imin = ((optM < 4) ? initct : 0); diff --git a/pkgs/by-name/sg/sgfutils/package.nix b/pkgs/by-name/sg/sgfutils/package.nix index 2658be5957fd..138de47b1987 100644 --- a/pkgs/by-name/sg/sgfutils/package.nix +++ b/pkgs/by-name/sg/sgfutils/package.nix @@ -17,6 +17,10 @@ stdenv.mkDerivation { rev = "11ab171c46cc16cc71ac6fc901d38ea88d6532a4"; hash = "sha256-KWYgTxz32WK3MKouj1WAJtZmleKt5giCpzQPwfWruZQ="; }; + patches = [ + # FIx gcc-15 build failure: https://github.com/yangboz/sgfutils/pull/3 + ./gcc-15.patch + ]; nativeBuildInputs = [ makeWrapper ]; buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; buildPhase = ''