Browse Source

ArchLinux tdegraphics: Backport patch for support Poppler >= 21.11.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/109/head
Slávek Banko 5 months ago
parent
commit
f187a33f40
Signed by: SlavekB
GPG Key ID: 608F5293A04BE668
  1. 14
      arch/tde-base/tde-tdegraphics/PKGBUILD
  2. 60
      arch/tde-base/tde-tdegraphics/bp000-544868bcc9.diff

14
arch/tde-base/tde-tdegraphics/PKGBUILD

@ -7,7 +7,7 @@ _kdemod="${_mod/tde/kde}"
pkgname="tde-${_mod}"
pkgver=14.0.11
pkgrel=1
pkgrel=2
pkgdesc="Trinity Desktop Graphics Components"
arch=('i686' 'x86_64')
url="https://scm.trinitydesktop.org/scm/git/${_mod}"
@ -19,12 +19,20 @@ provides=("${_mod}")
conflicts=("trinity-${_mod}" "trinity-${_kdemod}")
replaces=("trinity-${_mod}")
options=('staticlibs' 'libtool' '!strip')
source=("https://mirror.ppa.trinitydesktop.org/trinity/releases/R${pkgver}/main/${_cat}${_mod}-trinity-${pkgver}.tar.xz")
md5sums=('04d2c95040a3a5664c4b0dca8556d10d')
source=("https://mirror.ppa.trinitydesktop.org/trinity/releases/R${pkgver}/main/${_cat}${_mod}-trinity-${pkgver}.tar.xz"
"bp000-544868bcc9.diff")
md5sums=('04d2c95040a3a5664c4b0dca8556d10d'
"17ef39c263fb05827242762813b8c4b2")
# install=''
[ -n "$TDEDIR" ] || TDEDIR=/opt/trinity
prepare() {
msg "Apply backported patches"
cd ${srcdir}/${pkgname#*-}-trinity-${pkgver} || exit 1
patch -p1 < ${srcdir}/bp000-544868bcc9.diff
}
build() {
msg "Creating out-of-source build directory: ${srcdir}/build"
mkdir -p ${srcdir}/build

60
arch/tde-base/tde-tdegraphics/bp000-544868bcc9.diff

@ -0,0 +1,60 @@
commit 9cde144216b331f0eef2ce2c3800d8356109ccc7
Author: Slávek Banko <slavek.banko@axis.cz>
Date: Wed Dec 15 17:30:53 2021 +0100
Add support for Poppler >= 21.11.
This resolves issue #36.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
diff --git a/config.h.cmake b/config.h.cmake
index b3b6d1ec..fa71d600 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,6 +1,7 @@
#cmakedefine VERSION "@VERSION@"
// poppler-tqt
+#cmakedefine HAVE_POPPLER_2111
#cmakedefine HAVE_POPPLER_2108
#cmakedefine HAVE_POPPLER_086
#cmakedefine HAVE_POPPLER_083
diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
index 9c15e64f..78f6ffbc 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
+++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
@@ -24,7 +24,7 @@ check_cxx_source_compiles("
HAVE_POPPLER_030 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
-foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 0.83 0.86 21.08 )
+foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 0.83 0.86 21.08 21.11 )
string( REPLACE "." "" _poppler_str "${_poppler_ver}" )
if( NOT DEFINED HAVE_POPPLER_${_poppler_str} )
message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" )
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp
index 426b750f..9b4f6208 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp
@@ -173,7 +173,11 @@ TQValueList<TextBox*> Page::textList() const
data->doc->data->doc.displayPageSlice(output_dev, data->index + 1, 72, 72,
0, false, false, false, -1, -1, -1, -1);
+# if defined(HAVE_POPPLER_2111)
+ std::unique_ptr<TextWordList> word_list = output_dev->makeWordList();
+# else
TextWordList *word_list = output_dev->makeWordList();
+# endif
if (!word_list) {
delete output_dev;
@@ -193,7 +197,9 @@ TQValueList<TextBox*> Page::textList() const
output_list.append(text_box);
}
+# if !defined(HAVE_POPPLER_2111)
delete word_list;
+# endif
delete output_dev;
return output_list;
Loading…
Cancel
Save