pkgsrc-Changes archive

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

CVS commit: pkgsrc/graphics/inkscape



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed May  4 21:13:52 UTC 2022

Modified Files:
        pkgsrc/graphics/inkscape: distinfo
Added Files:
        pkgsrc/graphics/inkscape/patches:
            patch-src_extension_internal_pdfinput_pdf-parser.cpp
            patch-src_extension_internal_pdfinput_poppler-transition-api.h
            patch-src_extension_internal_pdfinput_svg-builder.cpp
            patch-src_extension_internal_pdfinput_svg-builder.h

Log Message:
nkscape: fix build with poppler 22.04.0

Using upstream patches


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 pkgsrc/graphics/inkscape/distinfo
cvs rdiff -u -r0 -r1.17 \
    pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h \
    pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h
cvs rdiff -u -r0 -r1.6 \
    pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/inkscape/distinfo
diff -u pkgsrc/graphics/inkscape/distinfo:1.88 pkgsrc/graphics/inkscape/distinfo:1.89
--- pkgsrc/graphics/inkscape/distinfo:1.88      Wed Mar  9 09:10:16 2022
+++ pkgsrc/graphics/inkscape/distinfo   Wed May  4 21:13:52 2022
@@ -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 @@ Size (inkscape-1.1.2.tar.xz) = 34222832 
 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

Added files:

Index: pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp
diff -u /dev/null pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp:1.17
--- /dev/null   Wed May  4 21:13:52 2022
+++ pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp       Wed May  4 21:13:52 2022
@@ -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 {

Index: pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h
diff -u /dev/null pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h:1.3
--- /dev/null   Wed May  4 21:13:52 2022
+++ pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_poppler-transition-api.h     Wed May  4 21:13:52 2022
@@ -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
Index: pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h
diff -u /dev/null pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h:1.3
--- /dev/null   Wed May  4 21:13:52 2022
+++ pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.h        Wed May  4 21:13:52 2022
@@ -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;

Index: pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp
diff -u /dev/null pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp:1.6
--- /dev/null   Wed May  4 21:13:52 2022
+++ pkgsrc/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp      Wed May  4 21:13:52 2022
@@ -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;
+ }
+ 



Home | Main Index | Thread Index | Old Index