commit:     9f2169be9339bfaad54aa9bf60373ff01a79f8c3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  2 04:25:00 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep  2 04:37:27 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f2169be

media-gfx/inkscape: fix build with Poppler 22.09.0

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/inkscape-1.2.1-poppler-22.09.0.patch     | 35 ++++++++++++++++++++++
 media-gfx/inkscape/inkscape-1.2.1.ebuild           |  4 +++
 2 files changed, 39 insertions(+)

diff --git a/media-gfx/inkscape/files/inkscape-1.2.1-poppler-22.09.0.patch 
b/media-gfx/inkscape/files/inkscape-1.2.1-poppler-22.09.0.patch
new file mode 100644
index 000000000000..2e5d3b4782f3
--- /dev/null
+++ b/media-gfx/inkscape/files/inkscape-1.2.1-poppler-22.09.0.patch
@@ -0,0 +1,35 @@
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -697,7 +697,11 @@ void PdfParser::opSetDash(Object args[], int /*numArgs*/)
+       _POPPLER_FREE(obj);
+     }
+   }
++#if POPPLER_CHECK_VERSION(22, 9, 0)
++  state->setLineDash(std::vector<double> (*dash, length), args[1].getNum());
++#else
+   state->setLineDash(dash, length, args[1].getNum());
++#endif
+   builder->updateStyle(state);
+ }
+ 
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -388,10 +388,17 @@ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, 
GfxState *state) {
+     sp_repr_css_set_property(css, "stroke-miterlimit", os_ml.str().c_str());
+ 
+     // Line dash
+-    double *dash_pattern;
+     int dash_length;
+     double dash_start;
++#if POPPLER_CHECK_VERSION(22, 9, 0)
++    const double *dash_pattern;
++    const std::vector<double> &dash = state->getLineDash(&dash_start);
++    dash_pattern = dash.data();
++    dash_length = dash.size();
++#else
++    double *dash_pattern;
+     state->getLineDash(&dash_pattern, &dash_length, &dash_start);
++#endif
+     if ( dash_length > 0 ) {
+         Inkscape::CSSOStringStream os_array;
+         for ( int i = 0 ; i < dash_length ; i++ ) {

diff --git a/media-gfx/inkscape/inkscape-1.2.1.ebuild 
b/media-gfx/inkscape/inkscape-1.2.1.ebuild
index e2183428d93b..a0df591ee0d9 100644
--- a/media-gfx/inkscape/inkscape-1.2.1.ebuild
+++ b/media-gfx/inkscape/inkscape-1.2.1.ebuild
@@ -108,6 +108,10 @@ RESTRICT="!test? ( test )"
 
 S="${WORKDIR}/${MY_P}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.2.1-poppler-22.09.0.patch
+)
+
 pkg_pretend() {
        [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
 }

Reply via email to