app-office/libreoffice: Fix build with poppler-0.71, poppler-0.72
authorAndreas Sturmlechner <asturm@gentoo.org>
Tue, 8 Jan 2019 00:16:23 +0000 (01:16 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Tue, 8 Jan 2019 00:17:15 +0000 (01:17 +0100)
Bug: https://bugs.gentoo.org/670692
Package-Manager: Portage-2.3.54, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-1.patch [new file with mode: 0644]
app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-2.patch [new file with mode: 0644]
app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.72.patch [new file with mode: 0644]
app-office/libreoffice/libreoffice-6.2.9999.ebuild

diff --git a/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-1.patch b/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-1.patch
new file mode 100644 (file)
index 0000000..9899f58
--- /dev/null
@@ -0,0 +1,164 @@
+From 5e8bdd9203dd642111c62a6668ee665a20d4ba19 Mon Sep 17 00:00:00 2001
+From: Mike Kaganski <mike.kaganski@collabora.com>
+Date: Tue, 20 Nov 2018 08:45:38 +0100
+Subject: poppler dropped GBool since 0.71
+
+See https://lists.freedesktop.org/archives/libreoffice/2018-November/081410.html
+
+Change-Id: I258e08894486a925bed50a3a4232b6e805af6784
+Reviewed-on: https://gerrit.libreoffice.org/63625
+Tested-by: Jenkins
+Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
+---
+ .../pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx       | 21 +++++++------
+ .../pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx       | 35 +++++++++++++---------
+ 2 files changed, 31 insertions(+), 25 deletions(-)
+
+diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+index 575a90a..ab74b36 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -514,7 +514,7 @@ void PDFOutDev::printPath( GfxPath* pPath )
+ PDFOutDev::PDFOutDev( PDFDoc* pDoc ) :
+     m_pDoc( pDoc ),
+     m_aFontMap(),
+-    m_pUtf8Map( new UnicodeMap("UTF-8", gTrue, &mapUTF8) ),
++    m_pUtf8Map( new UnicodeMap("UTF-8", true, &mapUTF8) ),
+     m_bSkipImages(false)
+ {
+ }
+@@ -939,9 +939,9 @@ void PDFOutDev::endTextObject(GfxState*)
+ }
+ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
+-                              int width, int height, GBool invert,
+-                              GBool /*interpolate*/,
+-                              GBool /*inlineImg*/ )
++                              int width, int height, poppler_bool invert,
++                              poppler_bool /*interpolate*/,
++                              poppler_bool /*inlineImg*/ )
+ {
+     if (m_bSkipImages)
+         return;
+@@ -969,8 +969,8 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
+ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
+                           int width, int height, GfxImageColorMap* colorMap,
+-                          GBool /*interpolate*/,
+-                          int* maskColors, GBool /*inlineImg*/ )
++                          poppler_bool /*interpolate*/,
++                          int* maskColors, poppler_bool /*inlineImg*/ )
+ {
+     if (m_bSkipImages)
+         return;
+@@ -1018,11 +1018,10 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
+ void PDFOutDev::drawMaskedImage(GfxState*, Object*, Stream* str,
+                                 int width, int height,
+                                 GfxImageColorMap* colorMap,
+-                                GBool /*interpolate*/,
++                                poppler_bool /*interpolate*/,
+                                 Stream* maskStr,
+                                 int maskWidth, int maskHeight,
+-                                GBool maskInvert
+-                                , GBool /*maskInterpolate*/
++                                poppler_bool maskInvert, poppler_bool /*maskInterpolate*/
+                                )
+ {
+     if (m_bSkipImages)
+@@ -1036,11 +1035,11 @@ void PDFOutDev::drawMaskedImage(GfxState*, Object*, Stream* str,
+ void PDFOutDev::drawSoftMaskedImage(GfxState*, Object*, Stream* str,
+                                     int width, int height,
+                                     GfxImageColorMap* colorMap,
+-                                    GBool /*interpolate*/,
++                                    poppler_bool /*interpolate*/,
+                                     Stream* maskStr,
+                                     int maskWidth, int maskHeight,
+                                     GfxImageColorMap* maskColorMap
+-                                    , GBool /*maskInterpolate*/
++                                    , poppler_bool /*maskInterpolate*/
+                                    )
+ {
+     if (m_bSkipImages)
+diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+index da021a2a..a6135fa 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+@@ -130,6 +130,13 @@ namespace pdfi
+         { return const_cast<GooString &>(familyName); }
+     };
++    // Versions before 0.15 defined GBool as int; 0.15 redefined it as bool; 0.71 dropped GBool
++#if POPPLER_VERSION_MAJOR == 0 && POPPLER_VERSION_MINOR < 71
++    typedef GBool poppler_bool;
++#else
++    typedef bool poppler_bool;
++#endif
++
+     class PDFOutDev : public OutputDev
+     {
+         // not owned by this class
+@@ -151,17 +158,17 @@ namespace pdfi
+         // Does this device use upside-down coordinates?
+         // (Upside-down means (0,0) is the top left corner of the page.)
+-        virtual GBool upsideDown() override { return gTrue; }
++        virtual poppler_bool upsideDown() override { return true; }
+         // Does this device use drawChar() or drawString()?
+-        virtual GBool useDrawChar() override { return gTrue; }
++        virtual poppler_bool useDrawChar() override { return true; }
+         // Does this device use beginType3Char/endType3Char?  Otherwise,
+         // text in Type 3 fonts will be drawn with drawChar/drawString.
+-        virtual GBool interpretType3Chars() override { return gFalse; }
++        virtual poppler_bool interpretType3Chars() override { return false; }
+         // Does this device need non-text content?
+-        virtual GBool needNonText() override { return gTrue; }
++        virtual poppler_bool needNonText() override { return true; }
+         //----- initialization and control
+@@ -233,29 +240,29 @@ namespace pdfi
+         //----- image drawing
+         virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
+-                                   int width, int height, GBool invert,
+-                                   GBool interpolate,
+-                                   GBool inlineImg) override;
++                                   int width, int height, poppler_bool invert,
++                                   poppler_bool interpolate,
++                                   poppler_bool inlineImg) override;
+         virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+                                int width, int height, GfxImageColorMap *colorMap,
+-                               GBool interpolate,
+-                               int *maskColors, GBool inlineImg) override;
++                               poppler_bool interpolate,
++                               int* maskColors, poppler_bool inlineImg) override;
+         virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
+                                      int width, int height,
+                                      GfxImageColorMap *colorMap,
+-                                     GBool interpolate,
++                                     poppler_bool interpolate,
+                                      Stream *maskStr, int maskWidth, int maskHeight,
+-                                     GBool maskInvert
+-                                     , GBool maskInterpolate
++                                     poppler_bool maskInvert,
++                                     poppler_bool maskInterpolate
+                                     ) override;
+         virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
+                                          int width, int height,
+                                          GfxImageColorMap *colorMap,
+-                                         GBool interpolate,
++                                         poppler_bool interpolate,
+                                          Stream *maskStr,
+                                          int maskWidth, int maskHeight,
+                                          GfxImageColorMap *maskColorMap
+-                                         , GBool maskInterpolate
++                                         , poppler_bool maskInterpolate
+                                         ) override;
+         static void setPageNum( int nNumPages );
+-- 
+cgit v1.1
+
diff --git a/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-2.patch b/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.71-2.patch
new file mode 100644 (file)
index 0000000..37b4455
--- /dev/null
@@ -0,0 +1,72 @@
+From 8ff41a26caf51544699863c89598d37d93dc1b21 Mon Sep 17 00:00:00 2001
+From: Aleksei Nikiforov <darktemplar@basealt.ru>
+Date: Thu, 22 Nov 2018 17:54:00 +0300
+Subject: Fix build with poppler 0.71
+
+Change-Id: I470ece9dc4766e10e1ccb5e99b25a8d8cc4cbf38
+Reviewed-on: https://gerrit.libreoffice.org/63860
+Tested-by: Jenkins
+Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
+---
+ sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 4 ++++
+ sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 4 ++++
+ sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx    | 4 ++--
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+index ab74b36..101e3be 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -578,7 +578,11 @@ void PDFOutDev::restoreState(GfxState*)
+     printf( "restoreState\n" );
+ }
++#if POPPLER_CHECK_VERSION(0, 71, 0)
++void PDFOutDev::setDefaultCTM(const double *pMat)
++#else
+ void PDFOutDev::setDefaultCTM(double *pMat)
++#endif
+ {
+     assert(pMat);
+diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+index a6135fa..98d8ede 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+@@ -173,7 +173,11 @@ namespace pdfi
+         //----- initialization and control
+         // Set default transform matrix.
++#if POPPLER_CHECK_VERSION(0, 71, 0)
++        virtual void setDefaultCTM(const double *ctm) override;
++#else
+         virtual void setDefaultCTM(double *ctm) override;
++#endif
+         // Start a page.
+         virtual void startPage(int pageNum, GfxState *state
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index 0f4a35b..b0a6ac4 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -69,7 +69,7 @@ int main(int argc, char **argv)
+     // read config file
+     globalParams = new GlobalParams();
+-    globalParams->setErrQuiet(gTrue);
++    globalParams->setErrQuiet(true);
+ #if defined(_MSC_VER)
+     globalParams->setupBaseFonts(nullptr);
+ #endif
+@@ -145,7 +145,7 @@ int main(int argc, char **argv)
+                 i,
+                 PDFI_OUTDEV_RESOLUTION,
+                 PDFI_OUTDEV_RESOLUTION,
+-                0, gTrue, gTrue, gTrue);
++                0, true, true, true);
+         rDoc.processLinks(&aOutDev, i);
+     }
+-- 
+cgit v1.1
+
diff --git a/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.72.patch b/app-office/libreoffice/files/libreoffice-6.2.0.1-poppler-0.72.patch
new file mode 100644 (file)
index 0000000..07e7a17
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx    2019-01-07 23:10:04.301278414 +0100
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx    2019-01-07 23:29:11.653479068 +0100
+@@ -555,7 +555,11 @@
+     LinkAction* pAction = link->getAction();
+     if (pAction && pAction->getKind() == actionURI)
+     {
++#if POPPLER_CHECK_VERSION(0, 72, 0)
++        const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->c_str();
++#else
+         const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString();
++#endif
+         std::vector<char> aEsc( lcl_escapeLineFeeds(pURI) );
+@@ -757,7 +761,11 @@
+             aFont = it->second;
++#if POPPLER_CHECK_VERSION(0, 72, 0)
++            std::vector<char> aEsc( lcl_escapeLineFeeds(aFont.familyName.c_str()) );
++#else
+             std::vector<char> aEsc( lcl_escapeLineFeeds(aFont.familyName.getCString()) );
++#endif
+             printf( " %d %d %d %d %f %d %s",
+                     aFont.isEmbedded,
+                     aFont.isBold,
index b75bd717a2508b3c5cf66cccbb6628b79c336549..f50c9dc307128e2915d6cb9f5c88b7ee8b06684f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -251,6 +251,13 @@ PATCHES=(
        "${FILESDIR}/${PN}-5.4-system-pyuno.patch"
        "${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
        "${FILESDIR}/${PN}-6.1-nomancompress.patch"
+
+       # master branch
+       "${FILESDIR}/${PN}-6.2.0.1-poppler-0.71-1.patch"
+       "${FILESDIR}/${PN}-6.2.0.1-poppler-0.71-2.patch"
+
+       # pending upstream
+       "${FILESDIR}/${PN}-6.2.0.1-poppler-0.72.patch"
 )
 
 S="${WORKDIR}/${PN}-${MY_PV}"