From a336da9b6cac774a6e9aabb31d5e5339013e79eb Mon Sep 17 00:00:00 2001 From: ghpzin Date: Fri, 19 Sep 2025 08:48:35 +0300 Subject: [PATCH] libodfgen: fix build with gcc15 - add patch that adds `#include ` to `OdfGenerator.cxx`, based on upstream commit that is not included in tagged versions: https://sourceforge.net/p/libwpd/libodfgen/ci/4da0b148def5b40ee60d4cd79762c0f158d64cc7/ Fixes build failure with gcc15: ``` OdfGenerator.cxx:53:9: error: 'uint8_t' was not declared in this scope 53 | uint8_t first; | ^~~~~~~ OdfGenerator.cxx:45:1: note: 'uint8_t' is defined in header ''; this is probably fixable by adding '#include ' 44 | #include "GraphicFunctions.hxx" +++ |+#include 45 | #include "InternalHandler.hxx" OdfGenerator.cxx:57:17: error: 'first' was not declared in this scope 57 | first = 0; | ^~~~~ ``` --- .../libodfgen-add-include-cstdint-gcc15.patch | 12 ++++++++++++ pkgs/by-name/li/libodfgen/package.nix | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/by-name/li/libodfgen/libodfgen-add-include-cstdint-gcc15.patch diff --git a/pkgs/by-name/li/libodfgen/libodfgen-add-include-cstdint-gcc15.patch b/pkgs/by-name/li/libodfgen/libodfgen-add-include-cstdint-gcc15.patch new file mode 100644 index 000000000000..c8ca813e9948 --- /dev/null +++ b/pkgs/by-name/li/libodfgen/libodfgen-add-include-cstdint-gcc15.patch @@ -0,0 +1,12 @@ +diff --git a/src/OdfGenerator.cxx b/src/OdfGenerator.cxx +index adf176b0a4..79de4dd2b7 100644 +--- a/src/OdfGenerator.cxx ++++ b/src/OdfGenerator.cxx +@@ -33,6 +33,7 @@ + #include + + #include ++#include + #include + #include + #include diff --git a/pkgs/by-name/li/libodfgen/package.nix b/pkgs/by-name/li/libodfgen/package.nix index d48a97088281..efaf663c9322 100644 --- a/pkgs/by-name/li/libodfgen/package.nix +++ b/pkgs/by-name/li/libodfgen/package.nix @@ -20,6 +20,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-Mj5JH5VsjKKrsSyZjjUGcJMKMjF7+WYrBhXdSzkiuDE="; }; + patches = [ + # Fix build with gcc15, based on: + # https://sourceforge.net/p/libwpd/libodfgen/ci/4da0b148def5b40ee60d4cd79762c0f158d64cc7/ + ./libodfgen-add-include-cstdint-gcc15.patch + ]; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ boost