commit:     bdc2e1a66c748d7f05e2b14a0f20bc4899968a98
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Fri Nov  7 13:55:38 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov  9 06:02:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdc2e1a6

app-office/dia: fix build with poppler-25.11

Closes: https://bugs.gentoo.org/965768
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44524
Closes: https://github.com/gentoo/gentoo/pull/44524
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-office/dia/dia-0.98_pre20250913.ebuild           |  1 +
 app-office/dia/files/dia-0.98-fix_poppler_2510.patch | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/app-office/dia/dia-0.98_pre20250913.ebuild 
b/app-office/dia/dia-0.98_pre20250913.ebuild
index 0b77d26b9249..247d49809994 100644
--- a/app-office/dia/dia-0.98_pre20250913.ebuild
+++ b/app-office/dia/dia-0.98_pre20250913.ebuild
@@ -53,6 +53,7 @@ PATCHES=(
        "${WORKDIR}"/dia-0.98-patches/${PN}-0.98-revert_xpm_replacement.patch
        "${WORKDIR}"/dia-0.98-patches/${PN}-0.98-use_gtkfontbutton.patch
        "${WORKDIR}"/dia-0.98-patches/${PN}-0.98-deps_optional.patch
+       "${FILESDIR}"/${PN}-0.98-fix_poppler_2510.patch #965768
 )
 
 pkg_setup() {

diff --git a/app-office/dia/files/dia-0.98-fix_poppler_2510.patch 
b/app-office/dia/files/dia-0.98-fix_poppler_2510.patch
new file mode 100644
index 000000000000..fa521d371759
--- /dev/null
+++ b/app-office/dia/files/dia-0.98-fix_poppler_2510.patch
@@ -0,0 +1,18 @@
+fix compile with >=poppler-25.10
+see https://bugs.gentoo.org/965768
+reported https://gitlab.gnome.org/GNOME/dia/-/issues/572
+--- a/plug-ins/pdf/pdf-import.cpp
++++ b/plug-ins/pdf/pdf-import.cpp
+@@ -776,7 +776,11 @@ void
+ DiaOutputDev::drawString(GfxState *state, GooString *s)
+ {
+   Color text_color = this->fill_color;
+-  int len = s->getLength();
++#if POPPLER_VERSION_MAJOR > 25 || (POPPLER_VERSION_MAJOR == 25 && 
POPPLER_VERSION_MINOR >= 10)
++  int len = s->size();
++#else
++  int len = s->getLength();
++#endif
+   DiaObject *obj;
+   gchar *utf8 = NULL;
+   DiaFont *font;

Reply via email to