commit:     2e621bc252b697c7d04a355bd3326c763de68cec
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  3 15:59:02 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Sep  3 16:15:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e621bc2

media-gfx/inkscape: Fix build w/ >=app-text/poppler-25.09.0

Closes: https://bugs.gentoo.org/962278
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/inkscape-1.4-poppler-25.09.0.patch       | 109 +++++++++++++++++++++
 media-gfx/inkscape/inkscape-1.4-r3.ebuild          |   3 +-
 2 files changed, 110 insertions(+), 2 deletions(-)

diff --git a/media-gfx/inkscape/files/inkscape-1.4-poppler-25.09.0.patch 
b/media-gfx/inkscape/files/inkscape-1.4-poppler-25.09.0.patch
new file mode 100644
index 000000000000..3c2b71a7e2a8
--- /dev/null
+++ b/media-gfx/inkscape/files/inkscape-1.4-poppler-25.09.0.patch
@@ -0,0 +1,109 @@
+From b60d81745016b5f20d4c6aec6d073b8a6f3e499c Mon Sep 17 00:00:00 2001
+From: mike kowalski <[email protected]>
+Date: Tue, 2 Sep 2025 07:17:25 -0700
+Subject: [PATCH] Fix build with poppler 25.09.0
+
+API changes: double* -> std::array necessitates fixes in Inkscape.
+The goal is to make it build with older poppler versions too.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp                | 3 +--
+ src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp | 2 +-
+ src/extension/internal/pdfinput/poppler-utils.cpp             | 4 ++++
+ src/extension/internal/pdfinput/poppler-utils.h               | 4 ++++
+ src/extension/internal/pdfinput/svg-builder.cpp               | 4 ++--
+ 5 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp 
b/src/extension/internal/pdfinput/pdf-parser.cpp
+index 50d5e8ef8e1..1bdd0c6374c 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -1656,12 +1656,11 @@ void PdfParser::doFunctionShFill1(GfxFunctionShading 
*shading,
+   GfxColor color0M, color1M, colorM0, colorM1, colorMM;
+   GfxColor colors2[4];
+   double functionColorDelta = colorDeltas[pdfFunctionShading-1];
+-  const double *matrix;
+   double xM, yM;
+   int nComps, i, j;
+ 
+   nComps = shading->getColorSpace()->getNComps();
+-  matrix = shading->getMatrix();
++  const auto& matrix = shading->getMatrix();
+ 
+   // compare the four corner colors
+   for (i = 0; i < 4; ++i) {
+diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp 
b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
+index cfc6961f629..986c19e1d81 100644
+--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
++++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
+@@ -633,7 +633,7 @@ static cairo_status_t 
_init_type3_glyph(cairo_scaled_font_t *scaled_font, cairo_
+ 
+     info = (type3_font_info_t 
*)cairo_font_face_get_user_data(cairo_scaled_font_get_font_face(scaled_font),
+                                                               
&type3_font_key);
+-    const double *mat = info->font->getFontBBox();
++    const auto& mat = info->font->getFontBBox();
+     extents->ascent = mat[3];   /* y2 */
+     extents->descent = -mat[3]; /* -y1 */
+     extents->height = extents->ascent + extents->descent;
+diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp 
b/src/extension/internal/pdfinput/poppler-utils.cpp
+index 6af37ce7f95..a50f59001bb 100644
+--- a/src/extension/internal/pdfinput/poppler-utils.cpp
++++ b/src/extension/internal/pdfinput/poppler-utils.cpp
+@@ -39,6 +39,10 @@ Geom::Affine ctmToAffine(const double *ctm)
+     return Geom::Affine(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
+ }
+ 
++Geom::Affine ctmToAffine(const std::array<double, 6>& ctm) {
++    return ctmToAffine(ctm.data());
++}
++
+ void ctmout(const char *label, const double *ctm)
+ {
+     std::cout << "C:" << label << ":" << ctm[0] << "," << ctm[1] << "," << 
ctm[2] << "," << ctm[3] << "," << ctm[4]
+diff --git a/src/extension/internal/pdfinput/poppler-utils.h 
b/src/extension/internal/pdfinput/poppler-utils.h
+index 705665a8cd6..55c7ae4da54 100644
+--- a/src/extension/internal/pdfinput/poppler-utils.h
++++ b/src/extension/internal/pdfinput/poppler-utils.h
+@@ -13,6 +13,7 @@
+ #ifndef POPPLER_UTILS_H
+ #define POPPLER_UTILS_H
+ 
++#include <array>
+ #include <map>
+ #include <memory>
+ #include <string>
+@@ -36,7 +37,10 @@ class Ref;
+ class XRef;
+ 
+ Geom::Affine stateToAffine(GfxState *state);
++// this function is for Poppler older than v25.09.0
+ Geom::Affine ctmToAffine(const double *ctm);
++// this flavor is for Poppler v25.09.0 and above
++Geom::Affine ctmToAffine(const std::array<double, 6>& ctm);
+ 
+ void ctmout(const char *label, const double *ctm);
+ void affout(const char *label, Geom::Affine affine);
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp 
b/src/extension/internal/pdfinput/svg-builder.cpp
+index d612602738f..fbc39653c38 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -1136,7 +1136,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern 
*tiling_pattern,
+     pattern_node->setAttribute("patternUnits", "userSpaceOnUse");
+     // Set pattern tiling
+     // FIXME: don't ignore XStep and YStep
+-    const double *bbox = tiling_pattern->getBBox();
++    const auto& bbox = tiling_pattern->getBBox();
+     pattern_node->setAttributeSvgDouble("x", 0.0);
+     pattern_node->setAttributeSvgDouble("y", 0.0);
+     pattern_node->setAttributeSvgDouble("width", bbox[2] - bbox[0]);
+@@ -1367,7 +1367,7 @@ void SvgBuilder::updateFont(GfxState *state, 
std::shared_ptr<CairoFont> cairo_fo
+ 
+     auto new_font_size = state->getFontSize();
+     if (font->getType() == fontType3) {
+-        const double *font_matrix = font->getFontMatrix();
++        const auto& font_matrix = font->getFontMatrix();
+         if (font_matrix[0] != 0.0) {
+             new_font_size *= font_matrix[3] / font_matrix[0];
+         }
+-- 
+GitLab
+

diff --git a/media-gfx/inkscape/inkscape-1.4-r3.ebuild 
b/media-gfx/inkscape/inkscape-1.4-r3.ebuild
index 1c57853950f5..43f52d8b9600 100644
--- a/media-gfx/inkscape/inkscape-1.4-r3.ebuild
+++ b/media-gfx/inkscape/inkscape-1.4-r3.ebuild
@@ -116,8 +116,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.4-gcc15.patch
        "${FILESDIR}"/${PN}-1.4-poppler-24.10-fix-backport.patch
        "${FILESDIR}"/${P}-poppler-24.{11,12}.0.patch # bugs 943499, 946597
-       "${FILESDIR}"/${P}-poppler-25.{02,06}.0.patch # bugs 949531, 957137
-       "${FILESDIR}"/${P}-poppler-25.07.0.patch # pending for git master
+       "${FILESDIR}"/${P}-poppler-25.{02,06,07,09}.0.patch # bugs 949531, 
957137, 962278
        "${FILESDIR}"/${P}-cmake4.patch
 )
 

Reply via email to