From 27ad68cde0af3d74d5d0350f2d2776de41fa363e Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 16 Sep 2025 14:24:55 +0300 Subject: [PATCH] graphite2: fix build with gcc15 - add patch from fedora, that adds missing `#include ` Fixes build failure with gcc15: ``` /build/graphite2-1.3.14/tests/featuremap/featuremaptest.cpp: In function 'void testFeatTable(const T&, const std::string&)': /build/graphite2-1.3.14/tests/featuremap/featuremaptest.cpp:310:14: error: 'uint16_t' was not declared in this scope [-Wtemplate-body] 310 | for (uint16_t j = 0; j < table.m_defs[i].m_numFeatSettings; j++) | ^~~~~~~~ /build/graphite2-1.3.14/tests/featuremap/featuremaptest.cpp:310:14: note: 'uint16_t' is defined in header ''; this is probably fixable by adding '#include ' /build/graphite2-1.3.14/tests/featuremap/featuremaptest.cpp:310:30: error: 'j' was not declared in this scope [-Wtemplate-body] 310 | for (uint16_t j = 0; j < table.m_defs[i].m_numFeatSettings; j++) | ^ ``` --- pkgs/development/libraries/silgraphite/graphite2.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix index 5a25cb3571d7..768e4a0ec359 100644 --- a/pkgs/development/libraries/silgraphite/graphite2.nix +++ b/pkgs/development/libraries/silgraphite/graphite2.nix @@ -2,6 +2,7 @@ lib, stdenv, llvmPackages, + fetchpatch, fetchurl, pkg-config, freetype, @@ -39,7 +40,14 @@ stdenv.mkDerivation (finalAttrs: { } ); - patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./macosx.patch ]; + patches = [ + # Fix build with gcc15 + (fetchpatch { + url = "https://src.fedoraproject.org/rpms/graphite2/raw/deba28323b0a3b7a3dcfd06df1efc2195b102ed7/f/graphite2-1.3.14-gcc15.patch"; + hash = "sha256-vkkGkHkcsj1mD3OHCHLWWgpcmFDv8leC4YQm+TsbIUw="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ ./macosx.patch ]; postPatch = '' # disable broken 'nametabletest' test, fails on gcc-13: # https://github.com/silnrsi/graphite/pull/74