Commit 80487ae2 authored by ghpzin's avatar ghpzin Committed by Bjørn Forsman
Browse files

freeglut: fix build with gcc15

- add patch from merged upstream PR:
https://www.github.com/freeglut/freeglut/pull/187

Fixes build failure with gcc15:
```
/build/freeglut-3.6.0/src/x11/fg_init_x11.c:297:6: error: conflicting
types for 'fgPlatformDestroyContext'; have 'void(SFG_PlatformDisplay,
struct __GLXcontextRec *)' {aka 'void(struct tagSFG_PlatformDisplay,
struct __GLXcontextRec *)'}
  297 | void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/freeglut-3.6.0/src/x11/fg_init_x11.c:34:
/build/freeglut-3.6.0/src/egl/fg_init_egl.h:31:13: note: previous
declaration of 'fgPlatformDestroyContext' with type 'void(void)'
   31 | extern void fgPlatformDestroyContext();
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
/build/freeglut-3.6.0/src/x11/fg_init_x11.c:297:6: error: conflicting
types for 'fgPlatformDestroyContext'; have 'void(SFG_PlatformDisplay,
struct __GLXcontextRec *)' {aka 'void(struct tagSFG_PlatformDisplay,
struct __GLXcontextRec *)'}
  297 | void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext )
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /build/freeglut-3.6.0/src/x11/fg_init_x11.c:34:
/build/freeglut-3.6.0/src/egl/fg_init_egl.h:31:13: note: previous
declaration of 'fgPlatformDestroyContext' with type 'void(void)'
   31 | extern void fgPlatformDestroyContext();
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
```
parent bc22ff6f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -29,6 +29,14 @@ stdenv.mkDerivation (finalAttrs: {
      url = "https://github.com/freeglut/freeglut/commit/2294389397912c9a6505a88221abb7dca0a4fb79.patch";
      hash = "sha256-buNhlVUbDekklnar6KFWN/GUKE+jMEqTGrY3LY0LwVs=";
    })

    # 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=";
    })
  ];

  outputs = [