commit:     a72e808bf95d6da1e63fd059918f3d0faa9698df
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 20 12:41:40 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Oct 20 15:36:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a72e808b

media-gfx/inkscape: Fix build w/ app-text/poppler-25.10.0

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/inkscape-1.4.2-poppler-25.10.patch       | 91 ++++++++++++++++++++++
 media-gfx/inkscape/inkscape-1.4.2.ebuild           |  2 +-
 2 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/media-gfx/inkscape/files/inkscape-1.4.2-poppler-25.10.patch 
b/media-gfx/inkscape/files/inkscape-1.4.2-poppler-25.10.patch
new file mode 100644
index 000000000000..a4ad26ba0258
--- /dev/null
+++ b/media-gfx/inkscape/files/inkscape-1.4.2-poppler-25.10.patch
@@ -0,0 +1,91 @@
+From 4dba481fe898c6317696d50b109f5aed8f269c19 Mon Sep 17 00:00:00 2001
+From: mike kowalski <[email protected]>
+Date: Sun, 12 Oct 2025 10:04:22 -0700
+Subject: [PATCH] Replace getLength() with size() on a GooString (Poppler)
+
+GooString in poppler no longer defines getLength() method.
+Call size() from base string directly.
+
+(cherry picked from commit ace884e13e413b0cc49ece80936584ef92c986f5)
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp    | 4 ++--
+ src/extension/internal/pdfinput/poppler-utils.cpp | 6 +++---
+ src/extension/internal/pdfinput/poppler-utils.h   | 9 +++++++++
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp 
b/src/extension/internal/pdfinput/pdf-parser.cpp
+index 0d62c20875..ba6c448513 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2256,7 +2256,7 @@ void PdfParser::doShowText(GooString *s) {
+     auto font = state->getFont();
+     int wMode = font->getWMode(); // Vertical/Horizontal/Invalid
+ 
+-    builder->beginString(state, s->getLength());
++    builder->beginString(state, get_goostring_length(*s));
+ 
+     // handle a Type 3 char
+     if (font->getType() == fontType3) {
+@@ -2267,7 +2267,7 @@ void PdfParser::doShowText(GooString *s) {
+     state->textTransformDelta(0, state->getRise(), &riseX, &riseY);
+ 
+     auto p = s->getCString(); // char* or const char*
+-    int len = s->getLength();
++    int len = get_goostring_length(*s);
+ 
+     while (len > 0) {
+ 
+diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp 
b/src/extension/internal/pdfinput/poppler-utils.cpp
+index 8110a3e085..cef753dab8 100644
+--- a/src/extension/internal/pdfinput/poppler-utils.cpp
++++ b/src/extension/internal/pdfinput/poppler-utils.cpp
+@@ -168,7 +168,7 @@ void InkFontDict::hashFontObject1(const Object *obj, 
FNVHash *h)
+         case objString:
+             h->hash('s');
+             s = obj->getString();
+-            h->hash(s->c_str(), s->getLength());
++            h->hash(s->c_str(), get_goostring_length(*s));
+             break;
+         case objName:
+             h->hash('n');
+@@ -586,10 +586,10 @@ std::string getDictString(Dict *dict, const char *key)
+ std::string getString(const GooString *value)
+ {
+     if (_POPPLER_HAS_UNICODE_BOM(value)) {
+-        return g_convert(value->getCString () + 2, value->getLength () - 2,
++        return g_convert(value->getCString () + 2, 
get_goostring_length(*value) - 2,
+                          "UTF-8", "UTF-16BE", NULL, NULL, NULL);
+     } else if (_POPPLER_HAS_UNICODE_BOMLE(value)) {
+-        return g_convert(value->getCString () + 2, value->getLength () - 2,
++        return g_convert(value->getCString () + 2, 
get_goostring_length(*value) - 2,
+                          "UTF-8", "UTF-16LE", NULL, NULL, NULL);
+     }
+     return value->toStr();
+diff --git a/src/extension/internal/pdfinput/poppler-utils.h 
b/src/extension/internal/pdfinput/poppler-utils.h
+index e51d6a9da3..15b5ed81e7 100644
+--- a/src/extension/internal/pdfinput/poppler-utils.h
++++ b/src/extension/internal/pdfinput/poppler-utils.h
+@@ -19,6 +19,7 @@
+ #include <string>
+ #include <unordered_set>
+ #include <vector>
++#include <goo/GooString.h>
+ 
+ #include "poppler-transition-api.h"
+ 
+@@ -104,4 +105,12 @@ private:
+     void hashFontObject1(const Object *obj, FNVHash *h);
+ };
+ 
++inline size_t get_goostring_length(const GooString& str) {
++#if POPPLER_CHECK_VERSION(25, 10, 0)
++    return str.size();
++#else
++    return str.getLength();
++#endif
++}
++
+ #endif /* POPPLER_UTILS_H */
+-- 
+GitLab
+

diff --git a/media-gfx/inkscape/inkscape-1.4.2.ebuild 
b/media-gfx/inkscape/inkscape-1.4.2.ebuild
index 8d768fe8d4e3..8de2e2958362 100644
--- a/media-gfx/inkscape/inkscape-1.4.2.ebuild
+++ b/media-gfx/inkscape/inkscape-1.4.2.ebuild
@@ -113,7 +113,7 @@ DEPEND="${COMMON_DEPEND}
 "
 
 PATCHES=(
-        "${FILESDIR}"/${P}-poppler-25.{06,07,09}.patch # bugs 949531, 957137, 
962278
+        "${FILESDIR}"/${P}-poppler-25.{06,07,09,10}.patch # bugs 949531, 
957137, 962278
 )
 
 pkg_pretend() {

Reply via email to