From a0a5a11236cfb7aa3779ddc81c9657d2b950ca40 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Wed, 3 Dec 2025 04:29:04 +0300 Subject: [PATCH] glpk: fix build with gcc15 - add patch from debian replacing `bool` typedef and `true`/`false` defines with `#include `: https://sources.debian.org/data/main/g/glpk/5.0-2/debian/patches/gcc-15.patch Upstream issue: https://lists.gnu.org/archive/html/bug-glpk/2025-05/msg00000.html (recommends to use `CFLAGS="-ansi"` instead) Fixes build failure with gcc15: ``` In file included from api/minisat1.c:23: ./minisat/minisat.h:37:13: error: 'bool' cannot be defined via 'typedef' 37 | typedef int bool; | ^~~~ ./minisat/minisat.h:37:13: note: 'bool' is a keyword with '-std=c23' onwards ./minisat/minisat.h:37:1: warning: useless type name in empty declaration 37 | typedef int bool; | ^~~~~~~ ``` --- pkgs/by-name/gl/glpk/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/gl/glpk/package.nix b/pkgs/by-name/gl/glpk/package.nix index ab7cae435b80..7a2d8532d6d9 100644 --- a/pkgs/by-name/gl/glpk/package.nix +++ b/pkgs/by-name/gl/glpk/package.nix @@ -3,6 +3,7 @@ stdenv, fetchurl, fetchpatch, + fetchDebianPatch, libmysqlclient, # Excerpt from glpk's INSTALL file: # This feature allows the exact simplex solver to use the GNU MP @@ -51,6 +52,14 @@ stdenv.mkDerivation rec { url = "https://raw.githubusercontent.com/sagemath/sage/d3c1f607e32f964bf0cab877a63767c86fd00266/build/pkgs/glpk/patches/error_recovery.patch"; sha256 = "sha256-2hNtUEoGTFt3JgUvLH3tPWnz+DZcXNhjXzS+/V89toA="; }) + + # Fix build with gcc15 + (fetchDebianPatch { + inherit pname version; + debianRevision = "2"; + patch = "gcc-15.patch"; + hash = "sha256-wuWPYqJKIKJAJaeJXW7lhvapu8Fd3zHjLAv7Ve7q8Qw="; + }) ]; postPatch =