app-office/calligra: Fix build with poppler-0.82.0
authorAndreas Sturmlechner <asturm@gentoo.org>
Fri, 1 Nov 2019 20:07:56 +0000 (21:07 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 2 Nov 2019 15:22:29 +0000 (16:22 +0100)
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
app-office/calligra/calligra-3.1.0-r4.ebuild
app-office/calligra/files/calligra-3.1.0-poppler-0.82.patch [new file with mode: 0644]

index 37e03558459c64c39790a1c65698d7407bdadb5a..411c8177f1c4902db913dbb084baefc581805db9 100644 (file)
@@ -135,6 +135,10 @@ pkg_setup() {
 src_prepare() {
        kde5_src_prepare
 
+       if has_version ">=app-text/poppler-0.82"; then
+               eapply "${FILESDIR}/${P}-poppler-0.82.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.82.patch b/app-office/calligra/files/calligra-3.1.0-poppler-0.82.patch
new file mode 100644 (file)
index 0000000..4cb9d18
--- /dev/null
@@ -0,0 +1,35 @@
+Patch stolen from Mageia Cauldron but had to be modified quite a bit.
+
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index ffdbf01..70bc9f8 100644
+--- a/filters/karbon/pdf/SvgOutputDev.cpp
++++ b/filters/karbon/pdf/SvgOutputDev.cpp
+@@ -405,7 +405,7 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s)
+     const char * p = s->c_str();
+     int len = s->getLength();
+     CharCode code;
+-    Unicode *u = nullptr;
++    const Unicode *u = nullptr;
+     int uLen;
+     double dx, dy, originX, originY;
+     while (len > 0) {
+@@ -545,7 +545,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
+ void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
+                              int width, int height, GfxImageColorMap *colorMap,
+-                             bool /*interpolate*/, int *maskColors, bool inlineImg)
++                             bool /*interpolate*/, const int *maskColors, bool inlineImg)
+ {
+     drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg);
+ }
+--- a/filters/karbon/pdf/SvgOutputDev.h
++++ b/filters/karbon/pdf/SvgOutputDev.h
+@@ -63,7 +63,7 @@ public:
+     // images
+     void drawImage(GfxState *state, Object *ref, Stream *str,
+                            int width, int height, GfxImageColorMap *colorMap,
+-                           bool interpolate, int *maskColors, bool inlineImg) override;
++                           bool interpolate, const int *maskColors, bool inlineImg) override;
+     // styles
+     virtual void updateAll(GfxState *state);