From 5c3433cf6a392c7af0211ea7012479bcd2fe2fe9 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 16 Sep 2025 18:34:35 +0300 Subject: [PATCH] libsndfile: fix build with gcc15 - add patch from merged upstream PR: https://www.github.com/libsndfile/libsndfile/pull/1055 Fixes build failure with gcc15: ``` src/ALAC/alac_decoder.c:42:9: error: cannot use keyword 'false' as enumeration constant 42 | { false = 0, | ^~~~~ src/ALAC/alac_decoder.c:42:9: note: 'false' is a keyword with '-std=c23' onwards src/ALAC/alac_decoder.c:44:3: error: expected ';', identifier or '(' before 'bool' 44 | } bool ; | ^~~~ src/ALAC/alac_decoder.c:44:3: warning: useless type name in empty declaration make[2]: *** [Makefile:2615: src/ALAC/alac_decoder.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... src/ALAC/alac_encoder.c:49:9: error: cannot use keyword 'false' as enumeration constant 49 | false = 0, | ^~~~~ src/ALAC/alac_encoder.c:49:9: note: 'false' is a keyword with '-std=c23' onwards src/ALAC/alac_encoder.c:51:3: error: expected ';', identifier or '(' before 'bool' 51 | } bool ; | ^~~~ ``` --- pkgs/by-name/li/libsndfile/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libsndfile/package.nix b/pkgs/by-name/li/libsndfile/package.nix index 3e894e8e40f4..4884e3480e49 100644 --- a/pkgs/by-name/li/libsndfile/package.nix +++ b/pkgs/by-name/li/libsndfile/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, autoreconfHook, autogen, pkg-config, @@ -35,6 +36,15 @@ stdenv.mkDerivation rec { hash = "sha256-MOOX/O0UaoeMaQPW9PvvE0izVp+6IoE5VbtTx0RvMkI="; }; + patches = [ + # Fix build with gcc15 + # https://github.com/libsndfile/libsndfile/pull/1055 + (fetchpatch { + url = "https://github.com/libsndfile/libsndfile/commit/2251737b3b175925684ec0d37029ff4cb521d302.patch"; + hash = "sha256-LaeptEicnjpVBExlK4dNMlN8+AAJhW8dIvemF6S4W2M="; + }) + ]; + nativeBuildInputs = [ autoreconfHook autogen