media-gfx/inkscape: Fix build with poppler-0.82.0
authorAndreas Sturmlechner <asturm@gentoo.org>
Fri, 8 Nov 2019 23:21:17 +0000 (00:21 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 9 Nov 2019 08:57:43 +0000 (09:57 +0100)
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
media-gfx/inkscape/files/inkscape-1.0_beta1-poppler-0.82.patch [new file with mode: 0644]
media-gfx/inkscape/inkscape-1.0_beta1.ebuild

diff --git a/media-gfx/inkscape/files/inkscape-1.0_beta1-poppler-0.82.patch b/media-gfx/inkscape/files/inkscape-1.0_beta1-poppler-0.82.patch
new file mode 100644 (file)
index 0000000..4c5bff4
--- /dev/null
@@ -0,0 +1,70 @@
+From 324c7903d9fd62e74c042c31477299be3b980fd2 Mon Sep 17 00:00:00 2001
+From: Thomas Holder <thomas@thomas-holder.de>
+Date: Sat, 26 Oct 2019 14:39:31 +0200
+Subject: [PATCH] fix poppler 0.82.0 build
+
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp           | 2 +-
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp          | 2 +-
+ src/extension/internal/pdfinput/svg-builder.h            | 2 +-
+ 4 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index 4f798e35bf..4eae275757 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2405,7 +2405,7 @@ void PdfParser::doShowText(GooString *s) {
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+-  Unicode *u = nullptr;
++  Unicode _POPPLER_CONST_82 *u = nullptr;
+   double x, y, dx, dy, tdx, tdy;
+   double originX, originY, tOriginX, tOriginY;
+   double oldCTM[6], newCTM[6];
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 5e8bc4ae90..01834007e8 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, 82, 0)
++#define _POPPLER_CONST_82 const
++#else
++#define _POPPLER_CONST_82
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 76, 0)
+ #define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse)
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index 14727eba5f..a7134684a0 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -1395,7 +1395,7 @@ void SvgBuilder::beginString(GfxState *state) {
+ void SvgBuilder::addChar(GfxState *state, double x, double y,
+                          double dx, double dy,
+                          double originX, double originY,
+-                         CharCode /*code*/, int /*nBytes*/, Unicode *u, int uLen) {
++                         CharCode /*code*/, int /*nBytes*/, Unicode const *u, int uLen) {
+     bool is_space = ( uLen == 1 && u[0] == 32 );
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index c42d694dec..050465d4bf 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -142,7 +142,7 @@ public:
+     void addChar(GfxState *state, double x, double y,
+                  double dx, double dy,
+                  double originX, double originY,
+-                 CharCode code, int nBytes, Unicode *u, int uLen);
++                 CharCode code, int nBytes, Unicode const *u, int uLen);
+     void beginTextObject(GfxState *state);
+     void endTextObject(GfxState *state);
+-- 
+2.22.0
index 9ec18d3c5b9d1d7ce45f841ddaee7269c7b9e2a1..759c5313e0392d7fea1aa6385c9e633a669e6aef 100644 (file)
@@ -101,6 +101,7 @@ RESTRICT="test"
 PATCHES=(
        "${FILESDIR}"/${P}-detect-imagemagick.patch
        "${FILESDIR}"/${P}-do-not-compress-man.patch
+       "${FILESDIR}"/${P}-poppler-0.82.patch
 )
 
 pkg_pretend() {