commit:     91bae785446138e2818ca1c76de35b731c8fae45
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 25 21:14:54 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Dec 25 21:20:14 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91bae785

app-office/calligra: Fix build with app-text/poppler-0.83.0

Package-Manager: Portage-2.3.83, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 app-office/calligra/calligra-3.1.0-r4.ebuild       |  4 ++
 .../files/calligra-3.1.0-poppler-0.83.patch        | 69 ++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/app-office/calligra/calligra-3.1.0-r4.ebuild 
b/app-office/calligra/calligra-3.1.0-r4.ebuild
index 411c8177f1c..f4c78118f36 100644
--- a/app-office/calligra/calligra-3.1.0-r4.ebuild
+++ b/app-office/calligra/calligra-3.1.0-r4.ebuild
@@ -139,6 +139,10 @@ src_prepare() {
                eapply "${FILESDIR}/${P}-poppler-0.82.patch" # TODO: make 
upstreamable patch
        fi
 
+       if has_version ">=app-text/poppler-0.83"; then
+               eapply "${FILESDIR}/${P}-poppler-0.83.patch" # TODO: make 
upstreamable patch
+       fi
+
        if ! use test; then
                sed -e "/add_subdirectory( *benchmarks *)/s/^/#DONT/" \
                        -i libs/pigment/CMakeLists.txt || die

diff --git a/app-office/calligra/files/calligra-3.1.0-poppler-0.83.patch 
b/app-office/calligra/files/calligra-3.1.0-poppler-0.83.patch
new file mode 100644
index 00000000000..383131ab387
--- /dev/null
+++ b/app-office/calligra/files/calligra-3.1.0-poppler-0.83.patch
@@ -0,0 +1,69 @@
+Source: Timo Gurr <tg...@exherbo.org>
+Upstream: Reported, https://bugs.kde.org/show_bug.cgi?id=414795
+Reason: Fix build with poppler 0.83.0
+
+diff -Naur calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp 
calligra-3.1.0.new/filters/karbon/pdf/PdfImport.cpp
+--- calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp    2019-12-04 
12:41:13.000000000 +0100
++++ calligra-3.1.0.new/filters/karbon/pdf/PdfImport.cpp        2019-12-04 
12:39:03.000000000 +0100
+@@ -60,19 +60,17 @@
+     }
+ 
+     // read config file
+-    globalParams = new GlobalParams();
++    globalParams.reset(new GlobalParams());
+     if (! globalParams)
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new 
GooString(QFile::encodeName(m_chain->inputFile()).data());
+     PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+     if (! pdfDoc) {
+-        delete globalParams;
+         return KoFilter::StupidError;
+     }
+ 
+     if (! pdfDoc->isOk()) {
+-        delete globalParams;
+         delete pdfDoc;
+         return KoFilter::StupidError;
+     }
+@@ -99,7 +97,6 @@
+ 
+     delete dev;
+     delete pdfDoc;
+-    delete globalParams;
+     globalParams = 0;
+ 
+     return KoFilter::OK;
+diff -Naur calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.cpp 
calligra-3.1.0.new/filters/karbon/pdf/SvgOutputDev.cpp
+--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.cpp 2019-12-04 
12:41:14.000000000 +0100
++++ calligra-3.1.0.new/filters/karbon/pdf/SvgOutputDev.cpp     2019-12-04 
12:35:30.000000000 +0100
+@@ -172,7 +172,7 @@
+     *d->body << "/>" << endl;
+ }
+ 
+-QString SvgOutputDev::convertPath(GfxPath *path)
++QString SvgOutputDev::convertPath(const GfxPath *path)
+ {
+     if (! path)
+         return QString();
+@@ -180,7 +180,7 @@
+     QString output;
+ 
+     for (int i = 0; i < path->getNumSubpaths(); ++i) {
+-        GfxSubpath * subpath = path->getSubpath(i);
++        const GfxSubpath * subpath = path->getSubpath(i);
+         if (subpath->getNumPoints() > 0) {
+             output += QString("M%1 
%2").arg(subpath->getX(0)).arg(subpath->getY(0));
+             int j = 1;
+diff -Naur calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h 
calligra-3.1.0.new/filters/karbon/pdf/SvgOutputDev.h
+--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h   2019-12-04 
12:41:14.000000000 +0100
++++ calligra-3.1.0.new/filters/karbon/pdf/SvgOutputDev.h       2019-12-04 
12:30:41.000000000 +0100
+@@ -83,7 +83,7 @@
+     /// Dumps content to svg file
+     void dumpContent();
+ private:
+-    QString convertPath(GfxPath *path);
++    QString convertPath(const GfxPath *path);
+     QString convertMatrix(const QMatrix &matrix);
+     QString convertMatrix(const double * matrix);
+     QString printFill();

Reply via email to