From 0bdff8af0d23e85ca587cc37a6f25495dbc76733 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Wed, 17 Sep 2025 13:40:24 +0300 Subject: [PATCH] gfxstream: fix build with gcc15 - add patch that adds missing `#include `, similar to what fedora does: https://src.fedoraproject.org/rpms/gfxstream/raw/2c7cbc24596973e2efc8180af81e57ddfa24654b/f/fix_missing_cstdint.patch (it applies, but somehow we hit more places with missing headers even with that patch) Fixes build failure with gcc15: ``` In file included from ../host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp:15: ../host/compressedTextureFormats/AstcCpuDecompressor.h:48:32: error: 'uint32_t' has not been declared 48 | virtual int32_t decompress(uint32_t imgWidth, uint32_t imgHeight, uint32_t blockWidth, | ^~~~~~~~ ../host/compressedTextureFormats/AstcCpuDecompressor.h:18:1: note: 'uint32_t' is defined in header ''; this is probably fixable by adding '#include ' 17 | #include +++ |+#include 18 | ../host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp:25:43: error: 'uint32_t' has not been declared 25 | int32_t decompress(uint32_t imgWidth, uint32_t imgHeight, uint32_t blockWidth, | ^~~~~~~~ ../host/compressedTextureFormats/AstcCpuDecompressorNoOp.cpp:25:43: note: 'uint32_t' is defined in header ''; this is probably fixable by adding '#include ' ``` --- .../gfxstream-add-include-cstdint.patch | 49 +++++++++++++++++++ pkgs/by-name/gf/gfxstream/package.nix | 5 ++ 2 files changed, 54 insertions(+) create mode 100644 pkgs/by-name/gf/gfxstream/gfxstream-add-include-cstdint.patch diff --git a/pkgs/by-name/gf/gfxstream/gfxstream-add-include-cstdint.patch b/pkgs/by-name/gf/gfxstream/gfxstream-add-include-cstdint.patch new file mode 100644 index 000000000000..97f4c12cc5cc --- /dev/null +++ b/pkgs/by-name/gf/gfxstream/gfxstream-add-include-cstdint.patch @@ -0,0 +1,49 @@ +diff --git a/host/BorrowedImage.h b/host/BorrowedImage.h +index ed2890568..51ea2b6b1 100644 +--- a/host/BorrowedImage.h ++++ b/host/BorrowedImage.h +@@ -12,6 +12,7 @@ + // See the License for the specific language governing permissions and + // limitations under the License. + ++#include + #pragma once + + namespace gfxstream { +diff --git a/host/compressedTextureFormats/AstcCpuDecompressor.h b/host/compressedTextureFormats/AstcCpuDecompressor.h +index 4823ee255..3af0bdc64 100644 +--- a/host/compressedTextureFormats/AstcCpuDecompressor.h ++++ b/host/compressedTextureFormats/AstcCpuDecompressor.h +@@ -15,6 +15,7 @@ + + #include + #include ++#include + + namespace gfxstream { + namespace vk { +diff --git a/host/magma/DrmContext.h b/host/magma/DrmContext.h +index db3ef45e4..5030c7dd6 100644 +--- a/host/magma/DrmContext.h ++++ b/host/magma/DrmContext.h +@@ -16,6 +16,7 @@ + + #include + #include ++#include + + #include "aemu/base/Compiler.h" + +diff --git a/host/vulkan/BufferVk.h b/host/vulkan/BufferVk.h +index 9016fd745..a8a3fe3eb 100644 +--- a/host/vulkan/BufferVk.h ++++ b/host/vulkan/BufferVk.h +@@ -14,6 +14,7 @@ + + #include + #include ++#include + + namespace gfxstream { + namespace vk { + diff --git a/pkgs/by-name/gf/gfxstream/package.nix b/pkgs/by-name/gf/gfxstream/package.nix index 60eaf27d23be..8f8fbddbde2a 100644 --- a/pkgs/by-name/gf/gfxstream/package.nix +++ b/pkgs/by-name/gf/gfxstream/package.nix @@ -25,6 +25,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-AN6OpZQ2te4iVuh/kFHXzmLAWIMyuoj9FHTVicnbiPw="; }; + patches = [ + # Fix build with gcc15 + ./gfxstream-add-include-cstdint.patch + ]; + # Ensure that meson can find an Objective-C compiler on Darwin. postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace meson.build \