From d933df8d01ddf3c6fdccd17039ec105fcfbd176d Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 7 Oct 2025 14:26:14 +0300 Subject: [PATCH] mupdf: fix build of vendored freeglut with gcc15 - add patch from `freeglut` upstream to vendored fork version: https://www.github.com/freeglut/freeglut/pull/187 Fixes build failure with gcc15: ``` /build/source/src/x11/fg_init_x11.c:348:6: error: conflicting types for 'fgPlatformDestroyContext'; have 'void(SFG_PlatformDisplay, struct __GLXcontextRec *)' {aka 'void(struct tagSFG_PlatformDisplay, struct __GLXcontextRec *)'} 348 | void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext ) | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /build/source/src/x11/fg_init_x11.c:34: /build/source/src/egl/fg_init_egl.h:31:13: note: previous declaration of 'fgPlatformDestroyContext' with type 'void(void)' 31 | extern void fgPlatformDestroyContext(); | ^~~~~~~~~~~~~~~~~~~~~~~~ ``` --- pkgs/by-name/mu/mupdf/package.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/mu/mupdf/package.nix b/pkgs/by-name/mu/mupdf/package.nix index cd1bea612afa..492322fd7f9b 100644 --- a/pkgs/by-name/mu/mupdf/package.nix +++ b/pkgs/by-name/mu/mupdf/package.nix @@ -55,7 +55,15 @@ let hash = "sha256-0fuE0lm9rlAaok2Qe0V1uUrgP4AjMWgp3eTbw8G6PMM="; }; - patches = [ ]; + patches = [ + # Fix build with gcc15 + # https://github.com/freeglut/freeglut/pull/187 + (fetchpatch { + name = "freeglut-fix-fgPlatformDestroyContext-prototype-for-C23.patch"; + url = "https://github.com/freeglut/freeglut/commit/800772e993a3ceffa01ccf3fca449d3279cde338.patch"; + hash = "sha256-agXw3JHq81tx5514kkorvuU5mX4E3AV930hy1OJl4L0="; + }) + ]; # cmake 4 compatibility, upstream is dead postPatch = ''