pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/inkscape nkscape: fix build with poppler 22.04.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c42b6f08f913
branches:  trunk
changeset: 378608:c42b6f08f913
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Wed May 04 21:13:52 2022 +0000

description:
nkscape: fix build with poppler 22.04.0

Using upstream patches

diffstat:

 graphics/inkscape/distinfo                                                               |   6 +-
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp           |  65 ++++++++++
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h |  20 +++
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp          |  36 +++++
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h            |  15 ++
 5 files changed, 141 insertions(+), 1 deletions(-)

diffs (169 lines):

diff -r 70ff6ea06956 -r c42b6f08f913 graphics/inkscape/distinfo
--- a/graphics/inkscape/distinfo        Wed May 04 21:05:40 2022 +0000
+++ b/graphics/inkscape/distinfo        Wed May 04 21:13:52 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.88 2022/03/09 09:10:16 wiz Exp $
+$NetBSD: distinfo,v 1.89 2022/05/04 21:13:52 wiz Exp $
 
 BLAKE2s (inkscape-1.1.2.tar.xz) = 4f7f3cad6faa377e25671a22bd156453b7d74cb7f0d8ecbc1e2ed6fcb2b540d3
 SHA512 (inkscape-1.1.2.tar.xz) = 55884f34e6fcc604027e7ea60f67702a658d3838332c1f3b56ec2cb05ab44992df0651ed741d6e7e807848366b24ee7415d0908ed1143b0bfb33ddbf26ae5c16
@@ -6,3 +6,7 @@
 SHA1 (patch-CMakeScripts_DefineDependsandFlags.cmake) = 26351c300629e28f6523fe2167a2eed5802435cf
 SHA1 (patch-src_extension_implementation_script.cpp) = da46549f688da5c9c0ecbeaeac7962e4f261cae4
 SHA1 (patch-src_extension_internal_pdfinput_pdf-input.cpp) = f3d7874690a099d6cdc47bf776caf6bb6c84cd44
+SHA1 (patch-src_extension_internal_pdfinput_pdf-parser.cpp) = 9987647cd8e0fe8c8379536618bbb3b82f9000f2
+SHA1 (patch-src_extension_internal_pdfinput_poppler-transition-api.h) = b8b96ebf6dacb9862c7d402cbe974c426777ada5
+SHA1 (patch-src_extension_internal_pdfinput_svg-builder.cpp) = e142052a75f92c7e3b110299037e5a40214516b8
+SHA1 (patch-src_extension_internal_pdfinput_svg-builder.h) = c6a719094bef815653e50ff6b3e5cfebb4924140
diff -r 70ff6ea06956 -r c42b6f08f913 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp    Wed May 04 21:13:52 2022 +0000
@@ -0,0 +1,65 @@
+$NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.17 2022/05/04 21:13:52 wiz Exp $
+
+Fix build with poppler-22.4.0
+https://gitlab.com/inkscape/inkscape/-/issues/3387
+
+--- src/extension/internal/pdfinput/pdf-parser.cpp.orig        2022-02-05 01:12:19.000000000 +0000
++++ src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object 
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[],
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooStri
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s)
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s)
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+                              code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-      if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+         pushResources(resDict);
+-      }
++    }
+       if (charProc.isStream()) {
+         //parse(&charProc, gFalse); // TODO: parse into SVG font
+       } else {
diff -r 70ff6ea06956 -r c42b6f08f913 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h  Wed May 04 21:13:52 2022 +0000
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_extension_internal_pdfinput_poppler-transition-api.h,v 1.3 2022/05/04 21:13:52 wiz Exp $
+
+Fix build with poppler-22.4.0
+https://gitlab.com/inkscape/inkscape/-/issues/3387
+
+--- src/extension/internal/pdfinput/poppler-transition-api.h.orig      2022-02-05 01:12:19.000000000 +0000
++++ src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
diff -r 70ff6ea06956 -r c42b6f08f913 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp   Wed May 04 21:13:52 2022 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_extension_internal_pdfinput_svg-builder.cpp,v 1.6 2022/05/04 21:13:52 wiz Exp $
+
+Fix build with poppler-22.4.0
+https://gitlab.com/inkscape/inkscape/-/issues/3387
+
+--- src/extension/internal/pdfinput/svg-builder.cpp.orig       2022-02-05 01:21:47.000000000 +0000
++++ src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1021,11 +1020,8 @@ void SvgBuilder::updateFont(GfxState *st
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1171,7 +1167,6 @@ void SvgBuilder::updateFont(GfxState *st
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
diff -r 70ff6ea06956 -r c42b6f08f913 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h     Wed May 04 21:13:52 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_extension_internal_pdfinput_svg-builder.h,v 1.3 2022/05/04 21:13:52 wiz Exp $
+
+Fix build with poppler-22.4.0
+https://gitlab.com/inkscape/inkscape/-/issues/3387
+
+--- src/extension/internal/pdfinput/svg-builder.h.orig 2022-02-05 01:21:47.000000000 +0000
++++ src/extension/internal/pdfinput/svg-builder.h
+@@ -203,7 +203,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;



Home | Main Index | Thread Index | Old Index