From c4f611e09d0208392960320cfa32531b929191b6 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Mon, 24 Feb 2025 14:11:50 +0100 Subject: [PATCH] kitinerary: revbump for libpoppler Close: #54463 --- .../KMime_new_const_API-fix_compilation.patch | 22 +++++++++ .../kitinerary/patches/poppler_25.02.0.patch | 49 +++++++++++++++++++ srcpkgs/kitinerary/template | 2 +- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/kitinerary/patches/KMime_new_const_API-fix_compilation.patch create mode 100644 srcpkgs/kitinerary/patches/poppler_25.02.0.patch diff --git a/srcpkgs/kitinerary/patches/KMime_new_const_API-fix_compilation.patch b/srcpkgs/kitinerary/patches/KMime_new_const_API-fix_compilation.patch new file mode 100644 index 00000000000..659bacda8f5 --- /dev/null +++ b/srcpkgs/kitinerary/patches/KMime_new_const_API-fix_compilation.patch @@ -0,0 +1,22 @@ +--- a/src/lib/processors/mimedocumentprocessor.cpp 2024-08-16 07:00:56.000000000 +0200 ++++ b/src/lib/processors/mimedocumentprocessor.cpp 2025-02-24 14:03:09.980662872 +0100 +@@ -142,13 +142,14 @@ + } + + // special handling of multipart/related to add images to the corresponding HTML document +- if (ct && ct->isMultipart() && ct->isSubtype("related") && ct->parameter("type"_L1) == "text/html"_L1 && children.size() >= 2) { +- const auto child = children.front(); +- if (child->contentType(false) && child->contentType(false)->isHTMLText()) { ++ if (ct && ct->isMultipart() && ct->isSubtype("related") && ct->parameter("type") == "text/html"_L1 && children.size() >= 2) { ++ const KMime::Content *child = children.front(); ++ if (child->contentType() && child->contentType()->isHTMLText()) { + auto htmlNode = expandContentNode(node, child, engine); + for (auto it = std::next(children.begin()); it != children.end(); ++it) { +- auto imgNode = expandContentNode(htmlNode, (*it), engine); +- const auto cid = (*it)->contentID(false); ++ const KMime::Content *imgChild = *it; ++ auto imgNode = expandContentNode(htmlNode, imgChild, engine); ++ const auto cid = imgChild->contentID(); + if (cid) { + imgNode.setLocation(cid->identifier()); + } diff --git a/srcpkgs/kitinerary/patches/poppler_25.02.0.patch b/srcpkgs/kitinerary/patches/poppler_25.02.0.patch new file mode 100644 index 00000000000..520dd2a9b8a --- /dev/null +++ b/srcpkgs/kitinerary/patches/poppler_25.02.0.patch @@ -0,0 +1,49 @@ +--- a/src/lib/pdf/pdfdocument.cpp 2024-08-16 07:00:56.000000000 +0200 ++++ b/src/lib/pdf/pdfdocument.cpp 2025-02-23 22:41:15.141361948 +0100 +@@ -39,10 +39,15 @@ + m_doc->m_popplerDoc->displayPageSlice(&device, m_pageNum + 1, 72, 72, 0, false, true, false, -1, -1, -1, -1); + m_doc->m_popplerDoc->processLinks(&device, m_pageNum + 1); + device.finalize(); +- const auto pageRect = m_doc->m_popplerDoc->getPage(m_pageNum + 1)->getCropBox(); +- std::unique_ptr s(device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2)); + ++ const auto pageRect = m_doc->m_popplerDoc->getPage(m_pageNum + 1)->getCropBox(); ++#if KPOPPLER_VERSION < QT_VERSION_CHECK(25, 1, 0) ++ std::unique_ptr s(device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2)); + m_text = QString::fromUtf8(s->c_str()); ++#else ++ const auto s = device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2); ++ m_text = QString::fromUtf8(s.c_str()); ++#endif + m_images = std::move(device.m_images); + for (auto it = m_images.begin(); it != m_images.end(); ++it) { + (*it).d->m_page = this; +@@ -107,8 +112,13 @@ + + TextOutputDev device(nullptr, false, 0, false, false); + d->m_doc->m_popplerDoc->displayPageSlice(&device, d->m_pageNum + 1, 72, 72, 0, false, true, false, -1, -1, -1, -1); ++#if KPOPPLER_VERSION s(device.getText(l, t, r, b)); + return QString::fromUtf8(s->c_str()); ++#else ++ const auto s = device.getText(l, t, r, b); ++ return QString::fromUtf8(s.c_str()); ++#endif + } + + int PdfPage::imageCount() const +@@ -314,9 +324,14 @@ + #endif + return QString::fromUtf16(reinterpret_cast(s->toStr().c_str()), s->toStr().size() / 2); + } else { ++#if KPOPPLER_VERSION >= QT_VERSION_CHECK(25, 2, 0) ++ const auto utf16Data = pdfDocEncodingToUTF16(s->toStr()); ++ return QString::fromUtf16(reinterpret_cast(utf16Data.c_str()), utf16Data.size() / 2); ++#else + int len = 0; + std::unique_ptr utf16Data(pdfDocEncodingToUTF16(s->toStr(), &len)); + return QString::fromUtf16(reinterpret_cast(utf16Data.get()), len / 2); ++#endif + } + + return QString::fromUtf8(s->c_str()); diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template index 3ed42147944..90882f527b9 100644 --- a/srcpkgs/kitinerary/template +++ b/srcpkgs/kitinerary/template @@ -1,7 +1,7 @@ # Template file for 'kitinerary' pkgname=kitinerary version=24.08.0 -revision=1 +revision=2 build_style=cmake configure_args="-DBUILD_TESTING=OFF -DKF6_HOST_TOOLING=/usr/lib/cmake -DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins