]> git.pld-linux.org Git - packages/inkscape.git/commitdiff
- fix building with poppler 0.83
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 23 Mar 2020 08:49:20 +0000 (09:49 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 23 Mar 2020 08:49:20 +0000 (09:49 +0100)
inkscape-poppler0.83.patch [new file with mode: 0644]
inkscape.spec

diff --git a/inkscape-poppler0.83.patch b/inkscape-poppler0.83.patch
new file mode 100644 (file)
index 0000000..a06171f
--- /dev/null
@@ -0,0 +1,104 @@
+From 51351358a62acb6887eab49bc0dc4a7a3d18c17a Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <jtojnar@gmail.com>
+Date: Tue, 3 Dec 2019 00:17:05 +0100
+Subject: [PATCH] Fix build with Poppler 0.83.0
+
+---
+ src/extension/internal/pdfinput/pdf-input.cpp        |  6 +++---
+ src/extension/internal/pdfinput/pdf-parser.cpp       |  4 ++--
+ .../internal/pdfinput/poppler-transition-api.h       | 12 ++++++++++++
+ src/extension/internal/pdfinput/svg-builder.cpp      |  4 ++--
+ 4 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index e46ab9778b..472dc732de 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -689,12 +689,12 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+         //
+         gchar const *poppler_datadir = g_getenv("POPPLER_DATADIR");
+         if (poppler_datadir != NULL) {
+-            globalParams = new GlobalParams(poppler_datadir);
++            globalParams = _POPPLER_NEW_GLOBAL_PARAMS(poppler_datadir);
+         } else {
+-            globalParams = new GlobalParams();
++            globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
+         }
+ #else
+-        globalParams = new GlobalParams();
++        globalParams = _POPPLER_NEW_GLOBAL_PARAMS();
+ #endif // ENABLE_OSX_APP_LOCATIONS
+     }
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index 4eae275757..4513ad94c5 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -267,7 +267,7 @@ public:
+     ClipHistoryEntry *save();
+     ClipHistoryEntry *restore();
+     GBool hasSaves() { return saved != nullptr; }
+-    void setClip(GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
++    void setClip(_POPPLER_CONST_83 GfxPath *newClipPath, GfxClipType newClipType = clipNormal);
+     GfxPath *getClipPath() { return clipPath; }
+     GfxClipType getClipType() { return clipType; }
+@@ -3377,7 +3377,7 @@ ClipHistoryEntry::~ClipHistoryEntry()
+     }
+ }
+-void ClipHistoryEntry::setClip(GfxPath *clipPathA, GfxClipType clipTypeA) {
++void ClipHistoryEntry::setClip(_POPPLER_CONST_83 GfxPath *clipPathA, GfxClipType clipTypeA) {
+     // Free previous clip path
+     if (clipPath) {
+         delete clipPath;
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 01834007e8..96718118db 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ #include <glib/poppler-features.h>
++#if POPPLER_CHECK_VERSION(0, 83, 0)
++#define _POPPLER_CONST_83 const
++#else
++#define _POPPLER_CONST_83
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 82, 0)
+ #define _POPPLER_CONST_82 const
+ #else
+@@ -26,6 +32,12 @@
+ #define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse)
+ #endif
++#if POPPLER_CHECK_VERSION(0, 83, 0)
++#define _POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr<GlobalParams>(new GlobalParams(args))
++#else
++#define _POPPLER_NEW_GLOBAL_PARAMS(args...) new GlobalParams(args)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 72, 0)
+ #define getCString c_str
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index a7134684a0..d04173b289 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -262,10 +262,10 @@ static void svgSetTransform(Inkscape::XML::Node *node, double c0, double c1,
+ /**
+  * \brief Generates a SVG path string from poppler's data structure
+  */
+-static gchar *svgInterpretPath(GfxPath *path) {
++static gchar *svgInterpretPath(_POPPLER_CONST_83 GfxPath *path) {
+     Inkscape::SVG::PathString pathString;
+     for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) {
+-        GfxSubpath *subpath = path->getSubpath(i);
++        _POPPLER_CONST_83 GfxSubpath *subpath = path->getSubpath(i);
+         if (subpath->getNumPoints() > 0) {
+             pathString.moveTo(subpath->getX(0), subpath->getY(0));
+             int j = 1;
+-- 
+2.24.1
+
index 1eadba47e576102b751411b3192ae6b9c26bb32a..b278cbfc4cb48263e37fa072c99a529c48086253 100644 (file)
@@ -22,6 +22,7 @@ Patch1:               %{name}-gtk3.patch
 Patch2:                %{name}-poppler0.76.patch
 # https://gitlab.com/inkscape/inkscape/merge_requests/986.patch
 Patch3:                %{name}-poppler0.82.patch
+Patch4:                %{name}-poppler0.83.patch
 URL:           https://inkscape.org/
 BuildRequires: ImageMagick-c++-devel
 BuildRequires: aspell-devel
@@ -113,6 +114,7 @@ dwuwymiarowej grafiki wektorowej.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %{__sed} -i -e 's,po/Makefile.in,,' configure.ac
 
This page took 0.144248 seconds and 4 git commands to generate.