From f31c1a89d995c224f9f6dea51b59e3e5a3db03c9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Jan 2026 15:38:56 +0100 Subject: [PATCH 1/2] libretro.same_cdi: fix build with GCC 15 - Fix sol2 library compatibility by replacing this->construct() with this->emplace() (https://github.com/ThePhD/sol2/issues/1657) - Add missing cstdint include for uint8_t --- pkgs/applications/emulators/libretro/cores/same_cdi.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/emulators/libretro/cores/same_cdi.nix b/pkgs/applications/emulators/libretro/cores/same_cdi.nix index 517fd721caea..a92e4390b89e 100644 --- a/pkgs/applications/emulators/libretro/cores/same_cdi.nix +++ b/pkgs/applications/emulators/libretro/cores/same_cdi.nix @@ -30,6 +30,15 @@ mkLibretroCore { }) ]; + postPatch = '' + # Fix sol2 compatibility with GCC 15 (construct -> emplace) + # https://github.com/ThePhD/sol2/issues/1657 + sed -i 's/this->construct(std::forward(args)\.\.\.);/this->emplace(std::forward(args)...);/g' 3rdparty/sol2/sol/sol.hpp + + # Fix missing cstdint include for uint8_t + sed -i '1i #include ' src/lib/util/corestr.cpp + ''; + extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib From 226ae141f95e0321cb401545eb29e5fdeef902ec Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Jan 2026 15:39:26 +0100 Subject: [PATCH 2/2] libretro.scummvm: fix build with GCC 15 Rename index/rindex functions in bundled libfaad to avoid conflict with glibc's string.h declarations. --- pkgs/applications/emulators/libretro/cores/scummvm.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/emulators/libretro/cores/scummvm.nix b/pkgs/applications/emulators/libretro/cores/scummvm.nix index acd4315d0ed5..fe52e890a40b 100644 --- a/pkgs/applications/emulators/libretro/cores/scummvm.nix +++ b/pkgs/applications/emulators/libretro/cores/scummvm.nix @@ -50,6 +50,9 @@ mkLibretroCore { cp -a ${libretro-deps-src}/* deps/libretro-deps chmod -R u+w deps/ + # Fix conflicts with glibc index/rindex functions + sed -i 's/\bindex\b/faad_index/g; s/\brindex\b/faad_rindex/g' deps/libretro-deps/libfaad/libfaad/common.h + patchShebangs ./scripts/* '';