[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1012846: Acknowledgement (karbon: Please update for Poppler 22.06)



I now attach the full debdiff since a new dependency in d/control is required.
diff -Nru calligra-3.2.1+dfsg/debian/changelog calligra-3.2.1+dfsg/debian/changelog
--- calligra-3.2.1+dfsg/debian/changelog	2022-06-21 18:48:42.000000000 -0300
+++ calligra-3.2.1+dfsg/debian/changelog	2022-06-30 10:03:11.000000000 -0300
@@ -1,3 +1,9 @@
+calligra (1:3.2.1+dfsg-5ubuntu1) kinetic; urgency=medium
+
+  * debian/patches/upstream_Fix-compile-with-poppler-22-06.patch
+
+ -- Nathan Pratta Teodosio <nathan.teodosio@canonical.com>  Thu, 30 Jun 2022 10:03:11 -0300
+
 calligra (1:3.2.1+dfsg-5build2) kinetic; urgency=medium
 
   * No-change rebuild against libpoppler122
diff -Nru calligra-3.2.1+dfsg/debian/control calligra-3.2.1+dfsg/debian/control
--- calligra-3.2.1+dfsg/debian/control	2022-06-21 18:48:42.000000000 -0300
+++ calligra-3.2.1+dfsg/debian/control	2022-06-30 10:03:11.000000000 -0300
@@ -60,6 +60,7 @@
                libphonon4qt5-dev,
                libphonon4qt5experimental-dev,
                libpoppler-private-dev,
+               libpoppler-qt5-dev,
                libqca-qt5-2-dev,
                libqt5opengl5-dev (>= 5.3.0),
                libqt5svg5-dev (>= 5.3.0),
diff -Nru calligra-3.2.1+dfsg/debian/patches/series calligra-3.2.1+dfsg/debian/patches/series
--- calligra-3.2.1+dfsg/debian/patches/series	2022-03-20 06:27:11.000000000 -0300
+++ calligra-3.2.1+dfsg/debian/patches/series	2022-06-30 10:03:11.000000000 -0300
@@ -4,3 +4,4 @@
 upstream_Update-Cmake-and-deps-Fix-Freetype-and-FontConfig-Li.patch
 upstream_Remove-old-std-c-11-setting-for-Vc.patch
 upstream_Fix-compile-with-newer-versions-of-poppler.patch
+upstream_Fix-compile-with-poppler-22-06.patch
diff -Nru calligra-3.2.1+dfsg/debian/patches/upstream_Fix-compile-with-poppler-22-06.patch calligra-3.2.1+dfsg/debian/patches/upstream_Fix-compile-with-poppler-22-06.patch
--- calligra-3.2.1+dfsg/debian/patches/upstream_Fix-compile-with-poppler-22-06.patch	1969-12-31 21:00:00.000000000 -0300
+++ calligra-3.2.1+dfsg/debian/patches/upstream_Fix-compile-with-poppler-22-06.patch	2022-06-30 10:03:11.000000000 -0300
@@ -0,0 +1,147 @@
+From 236bacbe13739414e919de868283b0caf2df5d8a Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid <aacid@kde.org>
+Date: Wed, 13 Apr 2022 01:25:44 +0200
+Subject: [PATCH] PdfImport: Fix compile with newer poppler
+
+Brings a dependency on poppler-qt5 to be able to include the version
+header, honestly it's not strictly needed, one could do a
+check_cxx_source_compiles, but I don't care about Calligra enough to
+spend more time making it compile while it's using poppler the wrong
+way.
+
+From 6b75bec784c9835c78993349845d8c2ef22ec3de Mon Sep 17 00:00:00 2001
+From: Dag Andersen <dag.andersen@kdemail.net>
+Date: Wed, 13 Apr 2022 14:45:33 +0200
+Subject: [PATCH] PdfImport: Fix compile with newer poppler
+
+Also fixes odg2pdf filter.
+
+Same solution as commit 236bacbe13739414e919de868283b0caf2df5d8a
+by accid@kde.org.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7d098c46a9e..de54f71ed20 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -959,6 +959,7 @@ calligra_drop_product_on_bad_condition( FILTER_WPG_TO_ODG
+ calligra_drop_product_on_bad_condition( FILTER_PDF_TO_SVG
+     NOT_WIN "not supported on Windows"
+     PopplerXPDFHeaders_FOUND "poppler xpdf headers not found"
++    Poppler_FOUND "poppler qt5 headers not found"
+     )
+ 
+ calligra_drop_product_on_bad_condition( FILTER_HTML_TO_ODS
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index 94d4071da3d..849baa70f12 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -19,7 +19,7 @@ set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp )
+ add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS})
+ calligra_filter_desktop_to_json(calligra_filter_pdf2svg calligra_filter_pdf2svg.desktop)
+ 
+-target_link_libraries(calligra_filter_pdf2svg komain Poppler::Core)
++target_link_libraries(calligra_filter_pdf2svg komain Poppler::Core Poppler::Qt5)
+ 
+ install(TARGETS calligra_filter_pdf2svg DESTINATION ${PLUGIN_INSTALL_DIR}/calligra/formatfilters)
+ 
+@@ -29,6 +29,6 @@ set(pdf2odg_PART_SRCS PdfImportDebug.cpp Pdf2OdgImport.cpp SvgOutputDev.cpp)
+ add_library(calligra_filter_pdf2odg MODULE ${pdf2odg_PART_SRCS})
+ calligra_filter_desktop_to_json(calligra_filter_pdf2odg calligra_filter_pdf2odg.desktop)
+ 
+-target_link_libraries(calligra_filter_pdf2odg kopageapp karbonui Poppler::Core)
++target_link_libraries(calligra_filter_pdf2odg kopageapp karbonui Poppler::Core Poppler::Qt5)
+ 
+ install(TARGETS calligra_filter_pdf2odg DESTINATION ${PLUGIN_INSTALL_DIR}/calligra/formatfilters)
+diff --git a/filters/karbon/pdf/Pdf2OdgImport.cpp b/filters/karbon/pdf/Pdf2OdgImport.cpp
+index f8a24c000b7..d23cc7ae1df 100644
+--- a/filters/karbon/pdf/Pdf2OdgImport.cpp
++++ b/filters/karbon/pdf/Pdf2OdgImport.cpp
+@@ -27,6 +27,8 @@
+ 
+ #include <kpluginfactory.h>
+ 
++#include <poppler-version.h>
++
+ // Don't show this warning: it's an issue in poppler
+ #ifdef __GNUC__
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
+@@ -36,6 +38,8 @@
+ #include <PDFDoc.h>
+ #include <GlobalParams.h>
+ 
++#define POPPLER_VERSION_MACRO ((POPPLER_VERSION_MAJOR << 16) | (POPPLER_VERSION_MINOR << 8) | (POPPLER_VERSION_MICRO))
++
+ K_PLUGIN_FACTORY_WITH_JSON(Pdf2OdgImportFactory, "calligra_filter_pdf2odg.json",
+                            registerPlugin<Pdf2OdgImport>();)
+ 
+@@ -73,8 +77,13 @@ KoFilter::ConversionStatus Pdf2OdgImport::convert(const QByteArray& from, const
+     if (! globalParams)
+         return KoFilter::NotImplemented;
+ 
++#if POPPLER_VERSION_MACRO < QT_VERSION_CHECK(22, 03, 0)
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+     PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++#else
++    std::unique_ptr<GooString> fname = std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data());
++    PDFDoc * pdfDoc = new PDFDoc(std::move(fname));
++#endif
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index 6309caefa8e..3219527b9ef 100644
+--- a/filters/karbon/pdf/PdfImport.cpp
++++ b/filters/karbon/pdf/PdfImport.cpp
+@@ -17,6 +17,10 @@
+ 
+ #include <kpluginfactory.h>
+ 
++#include <poppler-version.h>
++
++#define POPPLER_VERSION_MACRO ((POPPLER_VERSION_MAJOR << 16) | (POPPLER_VERSION_MINOR << 8) | (POPPLER_VERSION_MICRO))
++
+ // Don't show this warning: it's an issue in poppler
+ #ifdef __GNUC__
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
+@@ -60,8 +64,13 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt
+     if (! globalParams)
+         return KoFilter::NotImplemented;
+ 
++#if POPPLER_VERSION_MACRO < QT_VERSION_CHECK(22, 03, 0)
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+     PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++#else
++    std::unique_ptr<GooString> fname = std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data());
++    PDFDoc * pdfDoc = new PDFDoc(std::move(fname));
++#endif
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 6c9dddfc661..3a93304c7b8 100644
+--- a/filters/karbon/pdf/SvgOutputDev.cpp
++++ b/filters/karbon/pdf/SvgOutputDev.cpp
+@@ -22,6 +22,10 @@
+ #include <QPen>
+ #include <QImage>
+ 
++#include <poppler-version.h>
++
++#define POPPLER_VERSION_MACRO ((POPPLER_VERSION_MAJOR << 16) | (POPPLER_VERSION_MINOR << 8) | (POPPLER_VERSION_MICRO))
++
+ class SvgOutputDev::Private
+ {
+ public:
+@@ -398,7 +402,12 @@ void SvgOutputDev::drawString(GfxState * state, const GooString * s)
+     if (s->getLength() == 0)
+         return;
+ 
++#if POPPLER_VERSION_MACRO < QT_VERSION_CHECK(22, 03, 0)
+     GfxFont * font = state->getFont();
++#else
++    std::shared_ptr<GfxFont> font = state->getFont();
++#endif
++
+ 
+     QString str;
+ 

Reply to: