Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/scribus/files/, app-office/scribus/
Date: Sun, 29 Dec 2019 11:55:00
Message-Id: 1577620470.ffabc71c416a88c0b4a588b6a480c4206245d4d6.asturm@gentoo
1 commit: ffabc71c416a88c0b4a588b6a480c4206245d4d6
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 29 11:51:36 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 29 11:54:30 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffabc71c
7
8 app-office/scribus: Fix build with app-text/poppler-0.83.0
9
10 Closes: https://bugs.gentoo.org/704162
11 Package-Manager: Portage-2.3.84, Repoman-2.3.20
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13
14 .../scribus/files/scribus-1.5.5-poppler-0.83.patch | 153 +++++++++++++++++++++
15 app-office/scribus/scribus-1.5.5.ebuild | 1 +
16 2 files changed, 154 insertions(+)
17
18 diff --git a/app-office/scribus/files/scribus-1.5.5-poppler-0.83.patch b/app-office/scribus/files/scribus-1.5.5-poppler-0.83.patch
19 new file mode 100644
20 index 00000000000..0d52486da92
21 --- /dev/null
22 +++ b/app-office/scribus/files/scribus-1.5.5-poppler-0.83.patch
23 @@ -0,0 +1,153 @@
24 +Source/Upstream: Yes fixed in svn
25 +Reason: Fix build with poppler 0.83.0
26 +
27 +From b51c2bab4d57d685f96d427d6816bdd4ecfb4674 Mon Sep 17 00:00:00 2001
28 +From: Jean Ghali <jghali@×××××××××××.fr>
29 +Date: Wed, 4 Dec 2019 05:51:19 +0000
30 +Subject: [PATCH] #15985: Fix failure to build against poppler 0.83.0
31 +
32 +git-svn-id: svn://scribus.net/trunk/Scribus@23395 11d20701-8431-0410-a711-e3c959e3b870
33 +---
34 + scribus/plugins/import/pdf/importpdf.cpp | 22 ++++++++++++++++++++
35 + scribus/plugins/import/pdf/importpdfconfig.h | 6 ++++++
36 + scribus/plugins/import/pdf/slaoutput.cpp | 4 ++--
37 + scribus/plugins/import/pdf/slaoutput.h | 2 +-
38 + 4 files changed, 31 insertions(+), 3 deletions(-)
39 +
40 +diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
41 +index 2ab38ac758..427cd66ef2 100644
42 +--- a/scribus/plugins/import/pdf/importpdf.cpp
43 ++++ b/scribus/plugins/import/pdf/importpdf.cpp
44 +@@ -74,7 +74,11 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int flags)
45 + QImage PdfPlug::readThumbnail(const QString& fName)
46 + {
47 + QString pdfFile = QDir::toNativeSeparators(fName);
48 ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
49 ++ globalParams.reset(new GlobalParams());
50 ++#else
51 + globalParams = new GlobalParams();
52 ++#endif
53 + if (globalParams)
54 + {
55 + #if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
56 +@@ -89,7 +93,9 @@ QImage PdfPlug::readThumbnail(const QString& fName)
57 + if (pdfDoc->getErrorCode() == errEncrypted)
58 + {
59 + delete pdfDoc;
60 ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
61 + delete globalParams;
62 ++#endif
63 + return QImage();
64 + }
65 + if (pdfDoc->isOk())
66 +@@ -133,11 +139,15 @@ QImage PdfPlug::readThumbnail(const QString& fName)
67 + image.setText("YSize", QString("%1").arg(h));
68 + delete dev;
69 + delete pdfDoc;
70 ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
71 + delete globalParams;
72 ++#endif
73 + return image;
74 + }
75 + delete pdfDoc;
76 ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
77 + delete globalParams;
78 ++#endif
79 + }
80 + }
81 + return QImage();
82 +@@ -343,7 +353,11 @@ bool PdfPlug::convert(const QString& fn)
83 + qApp->processEvents();
84 + }
85 +
86 ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
87 ++ globalParams.reset(new GlobalParams());
88 ++#else
89 + globalParams = new GlobalParams();
90 ++#endif
91 + GooString *userPW = nullptr;
92 + if (globalParams)
93 + {
94 +@@ -385,7 +399,9 @@ bool PdfPlug::convert(const QString& fn)
95 + if (progressDialog)
96 + progressDialog->close();
97 + delete pdfDoc;
98 ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
99 + delete globalParams;
100 ++#endif
101 + return false;
102 + }
103 + if (progressDialog)
104 +@@ -430,7 +446,9 @@ bool PdfPlug::convert(const QString& fn)
105 + progressDialog->close();
106 + delete optImp;
107 + delete pdfDoc;
108 ++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
109 + delete globalParams;
110 ++#endif
111 + return false;
112 + }
113 + pageString = optImp->getPagesString();
114 +@@ -843,8 +861,12 @@ bool PdfPlug::convert(const QString& fn)
115 + }
116 + delete pdfDoc;
117 + }
118 ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
119 ++ globalParams.release();
120 ++#else
121 + delete globalParams;
122 + globalParams = nullptr;
123 ++#endif
124 +
125 + // qDebug() << "converting finished";
126 + // qDebug() << "Imported" << Elements.count() << "Elements";
127 +diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
128 +index 9913ee382c..5a7e0d2162 100644
129 +--- a/scribus/plugins/import/pdf/importpdfconfig.h
130 ++++ b/scribus/plugins/import/pdf/importpdfconfig.h
131 +@@ -58,4 +58,10 @@ for which a new license (GPL+exception) is in place.
132 + #define POPPLER_CONST_082
133 + #endif
134 +
135 ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
136 ++#define POPPLER_CONST_083 const
137 ++#else
138 ++#define POPPLER_CONST_083
139 ++#endif
140 ++
141 + #endif
142 +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
143 +index 5e4d32a551..ffcfa8450b 100644
144 +--- a/scribus/plugins/import/pdf/slaoutput.cpp
145 ++++ b/scribus/plugins/import/pdf/slaoutput.cpp
146 +@@ -3678,7 +3678,7 @@ QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
147 + return fNam;
148 + }
149 +
150 +-QString SlaOutputDev::convertPath(GfxPath *path)
151 ++QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
152 + {
153 + if (! path)
154 + return QString();
155 +@@ -3688,7 +3688,7 @@ QString SlaOutputDev::convertPath(GfxPath *path)
156 +
157 + for (int i = 0; i < path->getNumSubpaths(); ++i)
158 + {
159 +- GfxSubpath * subpath = path->getSubpath(i);
160 ++ POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
161 + if (subpath->getNumPoints() > 0)
162 + {
163 + output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
164 +diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
165 +index 60fb900618..d928fada81 100644
166 +--- a/scribus/plugins/import/pdf/slaoutput.h
167 ++++ b/scribus/plugins/import/pdf/slaoutput.h
168 +@@ -282,7 +282,7 @@ class SlaOutputDev : public OutputDev
169 + void getPenState(GfxState *state);
170 + QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
171 + QString getAnnotationColor(const AnnotColor *color);
172 +- QString convertPath(GfxPath *path);
173 ++ QString convertPath(POPPLER_CONST_083 GfxPath *path);
174 + int getBlendMode(GfxState *state);
175 + void applyMask(PageItem *ite);
176 + void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
177
178 diff --git a/app-office/scribus/scribus-1.5.5.ebuild b/app-office/scribus/scribus-1.5.5.ebuild
179 index c00d61006ab..cd725acf6b8 100644
180 --- a/app-office/scribus/scribus-1.5.5.ebuild
181 +++ b/app-office/scribus/scribus-1.5.5.ebuild
182 @@ -69,6 +69,7 @@ RDEPEND="${DEPEND}
183 PATCHES=(
184 # upstream svn trunk
185 "${FILESDIR}"/${P}-poppler-0.82.patch
186 + "${FILESDIR}"/${P}-poppler-0.83.patch
187 # non(?)-upstreamable
188 "${FILESDIR}"/${PN}-1.5.3-fpic.patch
189 "${FILESDIR}"/${P}-docdir.patch