From 9fc91f061e2a8991e278c4fa7787763d5108cb8d Mon Sep 17 00:00:00 2001 From: whispers Date: Sat, 4 Jul 2026 23:37:15 -0400 Subject: [PATCH] spice: apply upstream patches for gcc 16 c++ does not allow designated initializers to refer to members of anonymous unions, and gcc 16 rejects this. this appears in two places in spice, so we pull the upstream patches that fix this but have not yet made it into a release. --- pkgs/by-name/sp/spice/package.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/by-name/sp/spice/package.nix b/pkgs/by-name/sp/spice/package.nix index 73e906604be8..da68b72128ec 100644 --- a/pkgs/by-name/sp/spice/package.nix +++ b/pkgs/by-name/sp/spice/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, meson, ninja, pkg-config, @@ -38,6 +39,22 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./remove-rt-on-darwin.patch + + # C++ does not allow designated initializers to refer to members of + # anonymous unions. This fails with GCC 16, and was fixed upstream across + # two merge requests but not yet released. + # https://gitlab.freedesktop.org/spice/spice/-/merge_requests/246 + (fetchpatch { + name = "spice-test-display-base-initializer-anonymous-union.patch"; + url = "https://gitlab.freedesktop.org/spice/spice/-/commit/59bc22a40611121b2ea7888bf3c1a501c4fc0b91.patch"; + hash = "sha256-VQ+DrzmIws3EyZU5c0OqMZwMltUvCW34h5oXuHB8YWs="; + }) + # https://gitlab.freedesktop.org/spice/spice/-/merge_requests/244 + (fetchpatch { + name = "spice-test-gst-initializer-anonymous-union.patch"; + url = "https://gitlab.freedesktop.org/spice/spice/-/commit/a904cd86430aa555a50730e9389e210637a546c1.patch"; + hash = "sha256-6GGqi+Y4I/oftE8zXuRnX021+r7SrQPUdAdBsCv9MIw="; + }) ]; nativeBuildInputs = [