Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] poppler: update to 22.03.0
@ 2022-03-26  1:37 oreo639
  2022-03-26  1:39 ` [PR PATCH] [Updated] " oreo639
                   ` (63 more replies)
  0 siblings, 64 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  1:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

There is a new pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 10312 bytes --]

From cb12aa83acb54e6d90a6ab141ea122e3969d7b6b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 |  7 ++++---
 3 files changed, 5 insertions(+), 25 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..eb0fdf3a622f 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,14 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 
 build_options="gir boost"
 build_options_default="gir boost"

From 12bc0a5f814f9c950e4b4ce83a86d32b1983c205 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 71babf949ed99b901397e967049e2dca7144c512 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..469d8cde88b2 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,6 +1,6 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"

From e9a0f75155905173bb867efad1cabb8f0437585b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From d1d5e030bc350ef4d02212e8e69d6a288f9d6e07 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 4ce3e43c2df8b348d1c7665eaeb403d3c3f88e67 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 9172dfbbacda75176b7f61f41eb915c119cbaa36 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 6242e59fe8ae8bdb65a7b2d2bac9405a4b7bd21b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..791cdea712c5 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
@ 2022-03-26  1:39 ` oreo639
  2022-03-26  3:40 ` oreo639
                   ` (62 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  1:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 10698 bytes --]

From cb12aa83acb54e6d90a6ab141ea122e3969d7b6b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 |  7 ++++---
 3 files changed, 5 insertions(+), 25 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..eb0fdf3a622f 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,14 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 
 build_options="gir boost"
 build_options_default="gir boost"

From 12bc0a5f814f9c950e4b4ce83a86d32b1983c205 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 1f574db6c704fb4642c85f9e9cf6d57cf02ac080 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From cc84f6b6514e27f31fd226460403b713d0a41f80 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 14ec4f4caf2eb1fdc22e61f990d68e64ca380c05 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From ceb4b5e8178d8215998fbabcef931b17ce758b22 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From c4e15398e700b0f3bd284e46c22bd2745ed3a591 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From d9dd1f7240e3a7c523491e1bc4d54aa8d9f5e555 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..791cdea712c5 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
  2022-03-26  1:39 ` [PR PATCH] [Updated] " oreo639
@ 2022-03-26  3:40 ` oreo639
  2022-03-26  3:41 ` oreo639
                   ` (61 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  3:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079588303

Comment:
The poppler tests are in a separate gitlab repo with no versioning, should I just grab them using a git commit?

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
  2022-03-26  1:39 ` [PR PATCH] [Updated] " oreo639
  2022-03-26  3:40 ` oreo639
@ 2022-03-26  3:41 ` oreo639
  2022-03-26  3:42 ` [PR PATCH] [Updated] " oreo639
                   ` (60 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  3:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079588303

Comment:
The poppler tests are in a separate gitlab repo with no versioning, should I just grab them using a git commit hash?

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (2 preceding siblings ...)
  2022-03-26  3:41 ` oreo639
@ 2022-03-26  3:42 ` oreo639
  2022-03-26  3:42 ` oreo639
                   ` (59 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  3:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 11072 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From dc645b6cf4a4280b0ae47d3a26fca4628341ee4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a0e51c3c496b5bfa0a034beb25ea8b3cc3ba5ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 8e08f45f139cfe4d6cdc603412a32662a07b0ccd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7bc9490227dd749c44010df68fb09d2622294e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From c0f56ab601312e00e0e4f737292fb4ec5aa3914d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..791cdea712c5 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (3 preceding siblings ...)
  2022-03-26  3:42 ` [PR PATCH] [Updated] " oreo639
@ 2022-03-26  3:42 ` oreo639
  2022-03-26  4:03 ` [PR PATCH] [Updated] " oreo639
                   ` (58 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  3:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079588303

Comment:
The poppler tests are in a separate gitlab repo with no versioning, should I just grab them using a git commit hash?

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (4 preceding siblings ...)
  2022-03-26  3:42 ` oreo639
@ 2022-03-26  4:03 ` oreo639
  2022-03-26  5:21 ` oreo639
                   ` (57 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  4:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 11329 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From dc645b6cf4a4280b0ae47d3a26fca4628341ee4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a0e51c3c496b5bfa0a034beb25ea8b3cc3ba5ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 8e08f45f139cfe4d6cdc603412a32662a07b0ccd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7bc9490227dd749c44010df68fb09d2622294e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From f9677b3cca011f04e13deb4bc3f285db6fed1b68 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 srcpkgs/scribus/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (5 preceding siblings ...)
  2022-03-26  4:03 ` [PR PATCH] [Updated] " oreo639
@ 2022-03-26  5:21 ` oreo639
  2022-03-26  5:48 ` oreo639
                   ` (56 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  5:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 13942 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From dc645b6cf4a4280b0ae47d3a26fca4628341ee4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a0e51c3c496b5bfa0a034beb25ea8b3cc3ba5ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 8e08f45f139cfe4d6cdc603412a32662a07b0ccd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7bc9490227dd749c44010df68fb09d2622294e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From edac6d857d1b4abf99483e90a6781b88b61c6176 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch | 52 +++++++++++++++++++
 srcpkgs/scribus/template                      |  4 +-
 2 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..cbf3040d9cf7
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (6 preceding siblings ...)
  2022-03-26  5:21 ` oreo639
@ 2022-03-26  5:48 ` oreo639
  2022-03-26  6:21 ` oreo639
                   ` (55 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  5:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 13977 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From dc645b6cf4a4280b0ae47d3a26fca4628341ee4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a0e51c3c496b5bfa0a034beb25ea8b3cc3ba5ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 8e08f45f139cfe4d6cdc603412a32662a07b0ccd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7bc9490227dd749c44010df68fb09d2622294e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 8ca8ee893469ae7cf92a1e9c860a79fc4b35ff32 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch | 52 +++++++++++++++++++
 srcpkgs/scribus/template                      |  4 +-
 2 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (7 preceding siblings ...)
  2022-03-26  5:48 ` oreo639
@ 2022-03-26  6:21 ` oreo639
  2022-03-26 17:54 ` oreo639
                   ` (54 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26  6:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 18391 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From dc645b6cf4a4280b0ae47d3a26fca4628341ee4c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a0e51c3c496b5bfa0a034beb25ea8b3cc3ba5ab2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 8e08f45f139cfe4d6cdc603412a32662a07b0ccd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7bc9490227dd749c44010df68fb09d2622294e23 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From be2216bfb94911589be7c17bc10e0adedb8d0350 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch |  52 +++++++
 .../scribus/patches/poppler-22.2.0-fix.patch  | 129 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 3 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/poppler-22.2.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (8 preceding siblings ...)
  2022-03-26  6:21 ` oreo639
@ 2022-03-26 17:54 ` oreo639
  2022-03-26 17:59 ` oreo639
                   ` (53 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 46745 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 0e099c55d06326db279ea4ff456ae6e8b33caaa9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  22 +
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 508 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..eeb148d06b64
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,22 @@
+--- a/filters/karbon/pdf/Pdf2OdgImport.cpp.orig
++++ b/filters/karbon/pdf/Pdf2OdgImport.cpp
+@@ -87,7 +87,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
+--- a/filters/karbon/pdf/PdfImport.cpp.orig
++++ b/filters/karbon/pdf/PdfImport.cpp
+@@ -74,7 +74,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From bc81396e81b19fe2db11efea1089429f0c78c6dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 012ceb7940657148feff457ba0fc69109d48496d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 2e9fd9d9e5146ed49dea5c6b058a529d53ab1d3b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 5f612bc951bb86d1825cd78f19c0cf75ad1510b3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch |  52 +++++++
 .../scribus/patches/poppler-22.2.0-fix.patch  | 129 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 3 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/poppler-22.2.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (9 preceding siblings ...)
  2022-03-26 17:54 ` oreo639
@ 2022-03-26 17:59 ` oreo639
  2022-03-26 19:03 ` oreo639
                   ` (52 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26 17:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 48050 bytes --]

From c19e0faee2b254c457903e311f9997735ae63038 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.03.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 12 ++++++++----
 3 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 7d323593a120..5fd53def3e64 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.119 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..2b44ee8dfc66 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.03.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,10 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 6c60deccadbb890cb316a48d6026b6569c7b2bd3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.03.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..000e3387b5bc 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.03.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -18,7 +19,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=728c78ba94d75a55f6b6355d4fbdaa6f49934d9616be58e5e679a9cfd0980e1e
 # fails to find a bunch of files
 make_check=no
 

From 159ab174b864abc7862d770b9e474321543d898b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 0e099c55d06326db279ea4ff456ae6e8b33caaa9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.03.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  22 +
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 508 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..eeb148d06b64
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,22 @@
+--- a/filters/karbon/pdf/Pdf2OdgImport.cpp.orig
++++ b/filters/karbon/pdf/Pdf2OdgImport.cpp
+@@ -87,7 +87,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
+--- a/filters/karbon/pdf/PdfImport.cpp.orig
++++ b/filters/karbon/pdf/PdfImport.cpp
+@@ -74,7 +74,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From bc81396e81b19fe2db11efea1089429f0c78c6dd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.03.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From d8f3c44177ed16ba7e5cacfed1ea6ce111b4cac1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.03.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From ba7a21d88cec98a278bbbfcdc6616ceeb6be6977 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.03.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 7e849c49f8980ecbc9ede0342404a7fb4ffa68d4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.03.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch |  52 +++++++
 .../scribus/patches/poppler-22.2.0-fix.patch  | 129 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 3 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/poppler-22.2.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (10 preceding siblings ...)
  2022-03-26 17:59 ` oreo639
@ 2022-03-26 19:03 ` oreo639
  2022-03-26 19:30 ` oreo639
                   ` (51 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26 19:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079755659

Comment:
I notified upstream of the ipe-tools patch.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (11 preceding siblings ...)
  2022-03-26 19:03 ` oreo639
@ 2022-03-26 19:30 ` oreo639
  2022-03-26 19:30 ` oreo639
                   ` (50 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26 19:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079755659

Comment:
I notified upstream of the ipe-tools patch.
(From what I can tell the failing x86_64-musl test has been an issue for a while before this PR)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (12 preceding siblings ...)
  2022-03-26 19:30 ` oreo639
@ 2022-03-26 19:30 ` oreo639
  2022-04-17  8:12 ` oreo639
                   ` (49 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-03-26 19:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079755659

Comment:
I notified upstream of the ipe-tools patch.
(From what I can tell the failing x86_64-musl test with inkscape has been an issue for a while before this PR)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (13 preceding siblings ...)
  2022-03-26 19:30 ` oreo639
@ 2022-04-17  8:12 ` oreo639
  2022-04-17  8:14 ` oreo639
                   ` (48 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  8:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079755659

Comment:
I notified upstream of the ipe-tools patch. https://github.com/otfried/ipe-tools/pull/48
(From what I can tell the failing x86_64-musl test with inkscape has been an issue for a while before this PR)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (14 preceding siblings ...)
  2022-04-17  8:12 ` oreo639
@ 2022-04-17  8:14 ` oreo639
  2022-04-17  8:35 ` [PR PATCH] [Updated] " oreo639
                   ` (47 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  8:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1079755659

Comment:
I notified upstream of the ipe-tools patch. https://github.com/otfried/ipe-tools/pull/48
(The failing x86_64-musl test with inkscape isn't specific to this PR)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.03.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (15 preceding siblings ...)
  2022-04-17  8:14 ` oreo639
@ 2022-04-17  8:35 ` oreo639
  2022-04-17  8:52 ` [PR PATCH] [Updated] poppler: update to 22.04.0 oreo639
                   ` (46 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  8:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.03.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 48260 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 3eade28e79c33f444bc3e7d203fbd0d4ca929ff2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  22 +
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 508 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..eeb148d06b64
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,22 @@
+--- a/filters/karbon/pdf/Pdf2OdgImport.cpp.orig
++++ b/filters/karbon/pdf/Pdf2OdgImport.cpp
+@@ -87,7 +87,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
+--- a/filters/karbon/pdf/PdfImport.cpp.orig
++++ b/filters/karbon/pdf/PdfImport.cpp
+@@ -74,7 +74,7 @@
+         return KoFilter::NotImplemented;
+ 
+     GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
+-    PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
++    PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(fname));
+     if (! pdfDoc) {
+ #ifdef HAVE_POPPLER_PRE_0_83
+         delete globalParams;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From fe81811921961758bb7124ee50d06b624c79dbd4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From bf8935f296068a0c0eae680002cffbcd023a7410 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 590726d58264d77d9f5af663308bcce830b4ab57 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From db21338631831c6b0043ec600c2db5a82ea808e3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch |  52 +++++++
 .../scribus/patches/poppler-22.2.0-fix.patch  | 129 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 3 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/poppler-22.2.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (16 preceding siblings ...)
  2022-04-17  8:35 ` [PR PATCH] [Updated] " oreo639
@ 2022-04-17  8:52 ` oreo639
  2022-04-17  9:29 ` oreo639
                   ` (45 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  8:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 50452 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From e5033ef7c924c2c7a6bef42e8aa438815e89e1c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 556 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From fc6616b9843972801834ea13c18bbf98d4ba8114 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From bfd94b7d614044a4f16c7c3c6e9e2d8f86db8bf2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 232c6dd99d425a9c68e07c0c3df0f04390cfbc00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 44b11ea1d000079a5be2aef7219b6d49bc8c5921 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../scribus/patches/poppler-22.03.0-fix.patch |  52 +++++++
 .../scribus/patches/poppler-22.2.0-fix.patch  | 129 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 3 files changed, 183 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/poppler-22.2.0-fix.patch

diff --git a/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/poppler-22.2.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (17 preceding siblings ...)
  2022-04-17  8:52 ` [PR PATCH] [Updated] poppler: update to 22.04.0 oreo639
@ 2022-04-17  9:29 ` oreo639
  2022-04-17  9:31 ` oreo639
                   ` (44 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  9:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 62390 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From e5033ef7c924c2c7a6bef42e8aa438815e89e1c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 556 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From fc6616b9843972801834ea13c18bbf98d4ba8114 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From bfd94b7d614044a4f16c7c3c6e9e2d8f86db8bf2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 232c6dd99d425a9c68e07c0c3df0f04390cfbc00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 5ea0fe97be7fb0d4156782c54c8dbbda34e3e462 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/01_poppler-22.02.0-fix.patch      | 129 ++++++++
 .../patches/02_poppler-22.03.0-fix.patch      |  52 ++++
 .../patches/03_poppler-22.04.0-fix.patch      | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/01_poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/02_poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/03_poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/01_poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/01_poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/01_poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/02_poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/02_poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/02_poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/03_poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/03_poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/03_poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (18 preceding siblings ...)
  2022-04-17  9:29 ` oreo639
@ 2022-04-17  9:31 ` oreo639
  2022-04-17  9:35 ` oreo639
                   ` (43 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  9:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 62414 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From e5033ef7c924c2c7a6bef42e8aa438815e89e1c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 556 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From fc6616b9843972801834ea13c18bbf98d4ba8114 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch | 50 +++++++++++++++++++
 .../Fix-build-with-poppler-21.11.0.patch      | 29 +++++++++++
 srcpkgs/inkscape/template                     |  2 +-
 3 files changed, 80 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From bfd94b7d614044a4f16c7c3c6e9e2d8f86db8bf2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 232c6dd99d425a9c68e07c0c3df0f04390cfbc00 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 1d5b9e5751d829399845eabe07f39b5404ee0bad Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (19 preceding siblings ...)
  2022-04-17  9:31 ` oreo639
@ 2022-04-17  9:35 ` oreo639
  2022-04-17 10:22 ` oreo639
                   ` (42 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17  9:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 68254 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From e5033ef7c924c2c7a6bef42e8aa438815e89e1c1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 srcpkgs/calligra/template                     |   2 +-
 5 files changed, 556 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 275ed9c002a22862236ec494779187a348a8faba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 86835c59a2f241bcdbb8a9752816dd44611cb521 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From b058cfedd2d88f313e8ebd75821ce04e8a629b05 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From f9268ce9e11f05b0f3eebb828012ee45803ca13a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (20 preceding siblings ...)
  2022-04-17  9:35 ` oreo639
@ 2022-04-17 10:22 ` oreo639
  2022-04-17 10:45 ` oreo639
                   ` (41 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 10:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 767674536d66f259dfd2b889e3728e5777783dc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 00ce20bc60f7b89ff5f0c170159deb2781b59e2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 04dffa558765a43182b91c0d3c006d0d694ff9f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 29487a03652ce23d23977890d84aa1f8b87235ce Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 72083540da7728e38f2d8ea6781934d8ba22907d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (21 preceding siblings ...)
  2022-04-17 10:22 ` oreo639
@ 2022-04-17 10:45 ` oreo639
  2022-04-17 10:46 ` oreo639
                   ` (40 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 10:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72634 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 767674536d66f259dfd2b889e3728e5777783dc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 00ce20bc60f7b89ff5f0c170159deb2781b59e2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 04dffa558765a43182b91c0d3c006d0d694ff9f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From eaf4bc632b487d42030ef6e96bac427be9f41e70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..f42e35a2f4f1 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel
@@ -13,6 +13,7 @@ homepage="https://kontact.kde.org"
 changelog="https://kde.org/announcements/changelogs/gear/${version}/#kitinerary"
 distfiles="${KDE_SITE}/release-service/${version}/src/${pkgname}-${version}.tar.xz"
 checksum=b15f8aac50ac7eaf2fc23e40c7a165283e99844f88d96cb2a45face8a3cc8c4d
+make_check=no #31/34 Test #31: calendarhandlertest ..............***Failed
 
 kitinerary-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"

From 0e30acae33e9d2f243f976d69a5e8602e872fa4a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (22 preceding siblings ...)
  2022-04-17 10:45 ` oreo639
@ 2022-04-17 10:46 ` oreo639
  2022-04-17 10:47 ` oreo639
                   ` (39 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 10:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1100851111

Comment:
One of the kitinerary tests are failing, but that happens in the master branch as well.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (23 preceding siblings ...)
  2022-04-17 10:46 ` oreo639
@ 2022-04-17 10:47 ` oreo639
  2022-04-17 10:55 ` oreo639
                   ` (38 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 10:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1100851111

Comment:
One of the kitinerary tests are failing, but that happens without this PR as well.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (24 preceding siblings ...)
  2022-04-17 10:47 ` oreo639
@ 2022-04-17 10:55 ` oreo639
  2022-04-17 23:07 ` [PR PATCH] [Updated] " oreo639
                   ` (37 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 10:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1100851111

Comment:
One of the kitinerary tests are failing, but that happens outside this PR as well.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (25 preceding siblings ...)
  2022-04-17 10:55 ` oreo639
@ 2022-04-17 23:07 ` oreo639
  2022-04-18 23:47 ` oreo639
                   ` (36 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-17 23:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72639 bytes --]

From 8106cb9ff4a0a95df761b6a0c189fa637de5b8e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From a577fdf3d552ee11f180aecfc290779f1032e39e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 42b677114bc3ab941ecd3dc9686ad7a47be8d532 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 767674536d66f259dfd2b889e3728e5777783dc5 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 00ce20bc60f7b89ff5f0c170159deb2781b59e2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 04dffa558765a43182b91c0d3c006d0d694ff9f7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 91999ce8801d3a1651a720911fcda40d8296c947 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..bbfb567d9d95 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel
@@ -14,6 +14,11 @@ changelog="https://kde.org/announcements/changelogs/gear/${version}/#kitinerary"
 distfiles="${KDE_SITE}/release-service/${version}/src/${pkgname}-${version}.tar.xz"
 checksum=b15f8aac50ac7eaf2fc23e40c7a165283e99844f88d96cb2a45face8a3cc8c4d
 
+do_check() {
+	# can be removed after next release
+	make check || :
+}
+
 kitinerary-devel_package() {
 	depends="${sourcepkg}>=${version}_${revision}"
 	short_desc+=" - development files"

From dbd4c16733cdc9c867e8265a24a73c28348e719f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (26 preceding siblings ...)
  2022-04-17 23:07 ` [PR PATCH] [Updated] " oreo639
@ 2022-04-18 23:47 ` oreo639
  2022-05-01  2:03 ` oreo639
                   ` (35 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-04-18 23:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From eba88e33142cc563b0960153efaff082f9b48921 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..2140a5d5393b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.03.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 198360110d0be38528335073fae0321e88dc70a2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 1d276f8fb1c78f4514c579379ed016688185c8bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From f68c4bd24c30566eed414df9327998e6a2350e73 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 8017eb33fb0aa4a404cb972b7b94e1932662a750 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From f206efe8c83bf882b0546a4aed21452a78f9f0ae Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 96abaa8cc3874dcd5c5ee53ffc6837581c5d5e8b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 24c8d1a3b99ba761d541ff340d397f46449612e6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (27 preceding siblings ...)
  2022-04-18 23:47 ` oreo639
@ 2022-05-01  2:03 ` oreo639
  2022-05-01  2:05 ` oreo639
                   ` (34 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-05-01  2:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From 79791c480c969f9bade40fe78ea6ab76cae5af39 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index ae4bb44c57a3..918cdd51ed33 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.04.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 7a117e99bc82b2d68676df20a3649bbe2150431d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 6cd634b3cf50d4bc5878d9de62a338d8b2e0951f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From cd4608d555e00c3cba81b54ec17929939bb4712d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 1b5f89e6bc117cf63a4f73a9b9f1757e0e23e31c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From c8d4faa04ad6aab7264302eb14acd13810c0c092 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 7318b5df03724e49f5d214a23c5d84ffc1866e46 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From e1f3967683fded6b376493dc2441e53ba152c5bd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (28 preceding siblings ...)
  2022-05-01  2:03 ` oreo639
@ 2022-05-01  2:05 ` oreo639
  2022-05-12  4:19 ` oreo639
                   ` (33 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-05-01  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From 4f962c38d0e520208fcaa6484cd327eb538982a8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 4114151662fb..877903b4eae0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.04.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 01fb0802977252923df9d80a1723b18404db3bf6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 37fdc26d77190827bb2a2e23016885e2357256bc Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From ef122c614b4081bd2277fd92cda522870385b19a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 982693f56a5c34fc3d5bae71a5a3cdc0fdb38793 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From c7506dcb6b76cf7141cf882297331ccdc50663e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index fbd500a3dc94..62fcfe950504 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=5
+revision=6
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 808fb94b3d61eb7185516afff89960f0ca66347e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From df19e3d1fd9cdaad2fdf9f8f0c75ef6e134b1bba Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (29 preceding siblings ...)
  2022-05-01  2:05 ` oreo639
@ 2022-05-12  4:19 ` oreo639
  2022-05-16 21:43 ` oreo639
                   ` (32 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-05-12  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From df981caea874a1eb7030ecd0d6e3c9dcf694083f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index d75ecdda38dc..36fda283a6f5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.04.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 8dc2d09cd88c75ba3d840eb5d31d809ebe8f4494 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From 0da5a2ff4caf831f4fba36cc99ba59102e54e105 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 7ed9148bc92d0249d19c30e696629c320e07ec29 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 89d0b1648e9e..7c1411bf3da6 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=6
+revision=7
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 34fb7933ffc3c8a7b4004a73910f2a0ea39f84f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 77d44949fc7ec8e18528ac5b2a0d72dee083d3e1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 51b7c4f2c58c37a0e717ce4d2b38e1406fae448a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index aa5ad07fe219..5c36e829f7ae 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=21.12.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 638129dc18a9e1240ad75eb939baa46f20656f16 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (30 preceding siblings ...)
  2022-05-12  4:19 ` oreo639
@ 2022-05-16 21:43 ` oreo639
  2022-06-11 23:10 ` oreo639
                   ` (31 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-05-16 21:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 71725 bytes --]

From fe5e306685333fd105bf9913027f707b3732449e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.04.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 8f5670e21484..57889f32da58 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.120 libpoppler-22.04.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..54b03f04e8bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.04.0
 revision=1
+_testVersion=0762e0144143e680e24ec8d4c34c46c3716b8713
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
+ 21401040d5ccf05e9ed85c09a5de225d05b270f8ba75921af8ff67114f2313a6"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 3033032556f6a49a38580def22357093eb2feee7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.04.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..9707cd7beb12 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.04.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff
 # fails to find a bunch of files
 make_check=no
 

From e65235a0010c705bf43cafb140d02fafe40a7b2b Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 0abbbb37f685d2ebdff4daf931ccba81b9777d85 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.04.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 5 files changed, 646 insertions(+)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 

From a9b4c43c9bee17ad019cc9d105984aea9a7f2cb0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.04.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From cb1690fbcab7e3c7c97d20f1ced733635e0b8c6c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.04.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 0e2aad845184220f4d74a715927e16b09d0d9044 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.04.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 562cf7b0d8a9af80042cc80e80cfe577e284cc4d Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.04.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.04.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (31 preceding siblings ...)
  2022-05-16 21:43 ` oreo639
@ 2022-06-11 23:10 ` oreo639
  2022-06-17  0:05 ` [PR PATCH] [Updated] poppler: update to 22.06.0 oreo639
                   ` (30 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-11 23:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.04.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72180 bytes --]

From 3c9c6bc05dd8cba1487500fcdc27648fde053964 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/8] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 098f15bbf3e5..acdf4321251d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 1de815284d47a4e14a47a876188309f372e31212 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/8] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From d818440966e079a976b6461ba5e9a07c30254d60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/8] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From bf3404372c353a0db4ad14d30ce14596eea37bf8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/8] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From cee3fe6be9fbae4a66ad683e6f525a2fa5ec4b87 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/8] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From cadf72c3e3f45f48c47f2c8c15d7be6cde6d3d69 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/8] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 73da99e404233dce6c97f0bbbae33c4d0cb46a76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/8] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From ac1151ae5e9b10692863085e2b9d7c549e6150df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/8] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (32 preceding siblings ...)
  2022-06-11 23:10 ` oreo639
@ 2022-06-17  0:05 ` oreo639
  2022-06-17  0:51 ` oreo639
                   ` (29 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-17  0:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 72904 bytes --]

From 3c9c6bc05dd8cba1487500fcdc27648fde053964 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/9] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 098f15bbf3e5..acdf4321251d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 1de815284d47a4e14a47a876188309f372e31212 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/9] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From d818440966e079a976b6461ba5e9a07c30254d60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/9] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From bf3404372c353a0db4ad14d30ce14596eea37bf8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/9] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From cee3fe6be9fbae4a66ad683e6f525a2fa5ec4b87 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/9] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From cadf72c3e3f45f48c47f2c8c15d7be6cde6d3d69 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/9] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 73da99e404233dce6c97f0bbbae33c4d0cb46a76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/9] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From ac1151ae5e9b10692863085e2b9d7c549e6150df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/9] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 462b0b261394bc8b6ea3721b99c266b8fbcfacac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 9/9] libreoffice: rebuild against libpoppler 22.06.0

---
 srcpkgs/libreoffice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 7e41bc588f7b..6d35e14a3274 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.3.3.2
-revision=1
+revision=2
 build_style=meta
 make_build_target="build-nocheck"
 nocross="Several dependencies are nocross=yes"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (33 preceding siblings ...)
  2022-06-17  0:05 ` [PR PATCH] [Updated] poppler: update to 22.06.0 oreo639
@ 2022-06-17  0:51 ` oreo639
  2022-06-17  1:40 ` classabbyamp
                   ` (28 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-17  0:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 77143 bytes --]

From 3c9c6bc05dd8cba1487500fcdc27648fde053964 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/9] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 098f15bbf3e5..acdf4321251d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -347,7 +347,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 1de815284d47a4e14a47a876188309f372e31212 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/9] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From d818440966e079a976b6461ba5e9a07c30254d60 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/9] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From bf3404372c353a0db4ad14d30ce14596eea37bf8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/9] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From cee3fe6be9fbae4a66ad683e6f525a2fa5ec4b87 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/9] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From cadf72c3e3f45f48c47f2c8c15d7be6cde6d3d69 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/9] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 73da99e404233dce6c97f0bbbae33c4d0cb46a76 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/9] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From ac1151ae5e9b10692863085e2b9d7c549e6150df Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/9] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   4 +-
 4 files changed, 471 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 0ec908f7ef50..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,10 +1,10 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 235bfb409eb891a2d706496bef539d2859b650d9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 9/9] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 srcpkgs/libreoffice/template                  |  2 +-
 3 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 
diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 7e41bc588f7b..6d35e14a3274 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.3.3.2
-revision=1
+revision=2
 build_style=meta
 make_build_target="build-nocheck"
 nocross="Several dependencies are nocross=yes"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (34 preceding siblings ...)
  2022-06-17  0:51 ` oreo639
@ 2022-06-17  1:40 ` classabbyamp
  2022-06-17  4:53 ` oreo639
                   ` (27 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: classabbyamp @ 2022-06-17  1:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158381960

Comment:
This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (35 preceding siblings ...)
  2022-06-17  1:40 ` classabbyamp
@ 2022-06-17  4:53 ` oreo639
  2022-06-18 23:59 ` oreo639
                   ` (26 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-17  4:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (36 preceding siblings ...)
  2022-06-17  4:53 ` oreo639
@ 2022-06-18 23:59 ` oreo639
  2022-06-19  0:02 ` oreo639
                   ` (25 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-18 23:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something.)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (37 preceding siblings ...)
  2022-06-18 23:59 ` oreo639
@ 2022-06-19  0:02 ` oreo639
  2022-06-19  0:02 ` oreo639
                   ` (24 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel`, it still uses `libpoppler` directly)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (38 preceding siblings ...)
  2022-06-19  0:02 ` oreo639
@ 2022-06-19  0:02 ` oreo639
  2022-06-19  0:04 ` oreo639
                   ` (23 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` for version information, it still uses `libpoppler` directly)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (39 preceding siblings ...)
  2022-06-19  0:02 ` oreo639
@ 2022-06-19  0:04 ` oreo639
  2022-06-19  0:05 ` [PR PATCH] [Updated] " oreo639
                   ` (22 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (40 preceding siblings ...)
  2022-06-19  0:04 ` oreo639
@ 2022-06-19  0:05 ` oreo639
  2022-06-19  0:06 ` oreo639
                   ` (21 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 76611 bytes --]

From e330552a6d0fbd923d253f42137509c4bb2af54f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 1/9] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index 09430986c2df..3eb52b2adc9d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 49be348c6a5b5047f2aae66b933da9fba2a6ec94 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 2/9] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From 49e2748479c4620b8e8f94ec0211cda921043ebf Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 3/9] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 99d7f99b808626c69f85c3b503d0ffccbe8a7118 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 4/9] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From c4b74bca153f45f054c48a5fb4e8503a3b4620e9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 5/9] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From fff939c9c4b538bd8cb4751bfcdd2cafde94bcf6 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 6/9] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 192d8b0557e5cbde3204277169e18efabaa1d8e8 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 7/9] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From 58f30f39b3c90ad390a8930ca5308cd082aa025f Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 8/9] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 97b47b1bf907e7e7f7d6e1f5542a0ae6daeba3ac Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 9/9] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (41 preceding siblings ...)
  2022-06-19  0:05 ` [PR PATCH] [Updated] " oreo639
@ 2022-06-19  0:06 ` oreo639
  2022-06-19  0:06 ` oreo639
                   ` (20 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed it on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (42 preceding siblings ...)
  2022-06-19  0:06 ` oreo639
@ 2022-06-19  0:06 ` oreo639
  2022-06-19  0:10 ` oreo639
                   ` (19 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed it on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib`) and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (43 preceding siblings ...)
  2022-06-19  0:06 ` oreo639
@ 2022-06-19  0:10 ` oreo639
  2022-06-19  0:11 ` oreo639
                   ` (18 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed it on IRC, but xrevshlib also shows packages that pull in libpoppler.so though a different dependency (i.e. `poppler-glib`) and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (44 preceding siblings ...)
  2022-06-19  0:10 ` oreo639
@ 2022-06-19  0:11 ` oreo639
  2022-06-19  0:37 ` oreo639
                   ` (17 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed it on IRC, but xrevshlib also shows packages that depend on `libpoppler-glib.so`, `libpoppler-cpp.so`, and `libpoppler-qt5.so` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (45 preceding siblings ...)
  2022-06-19  0:11 ` oreo639
@ 2022-06-19  0:37 ` oreo639
  2022-07-05 10:47 ` paper42
                   ` (16 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-06-19  0:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1158488908

Comment:
> This is missing quite a few packages that need to be rebuilt against the new poppler. you can use `xrevshlib pkgname` to find a list of all packages that require the updated library (for example: `xrevshlib poppler | xargs -n1 xrevbump 'rebuild for poppler-22.06.0'` will make a commit for each one)

Thank you.

Edit: We discussed it on IRC, but xrevshlib also shows packages that depend on `libpoppler-glib.so`/`libpoppler-cpp.so` and those don't need to be bumped. I didn't see anything else that depends on libpoppler directly through that but please let me know if I missed something. libreoffice was a weird case since it doesn't show as depending on `libpoppler` through xbps, and while depending on `poppler-cpp-devel` headers for version information, it still uses `libpoppler` directly.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (46 preceding siblings ...)
  2022-06-19  0:37 ` oreo639
@ 2022-07-05 10:47 ` paper42
  2022-07-05 18:26 ` oreo639
                   ` (15 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: paper42 @ 2022-07-05 10:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1174915206

Comment:
with the last libpoppler update, texlive was also revbumped

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (47 preceding siblings ...)
  2022-07-05 10:47 ` paper42
@ 2022-07-05 18:26 ` oreo639
  2022-07-05 18:29 ` oreo639
                   ` (14 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 223 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped it's dependency on libpoppler in favor of including xpdf in tree.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (48 preceding siblings ...)
  2022-07-05 18:26 ` oreo639
@ 2022-07-05 18:29 ` oreo639
  2022-07-05 18:30 ` oreo639
                   ` (13 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped it's dependency on libpoppler in favor of an in-tree copy xpdf.

Also, previously I erroneously made a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler).

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (49 preceding siblings ...)
  2022-07-05 18:29 ` oreo639
@ 2022-07-05 18:30 ` oreo639
  2022-07-05 18:31 ` oreo639
                   ` (12 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped it's dependency on libpoppler in favor of an in-tree copy xpdf.

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler).

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (50 preceding siblings ...)
  2022-07-05 18:30 ` oreo639
@ 2022-07-05 18:31 ` oreo639
  2022-07-05 18:42 ` oreo639
                   ` (11 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped it's dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler).

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (51 preceding siblings ...)
  2022-07-05 18:31 ` oreo639
@ 2022-07-05 18:42 ` oreo639
  2022-07-05 18:47 ` oreo639
                   ` (10 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler).

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (52 preceding siblings ...)
  2022-07-05 18:42 ` oreo639
@ 2022-07-05 18:47 ` oreo639
  2022-07-05 19:38 ` oreo639
                   ` (9 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 18:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler) and I was surprised that the pdfto* binary from texlive did not depend on libpoppler.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (53 preceding siblings ...)
  2022-07-05 18:47 ` oreo639
@ 2022-07-05 19:38 ` oreo639
  2022-07-05 23:12 ` [PR PATCH] [Updated] " oreo639
                   ` (8 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 19:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler) and I was surprised that the pdfto* binary from texlive did not depend on libpoppler. (so I looked a different binary with a similar name)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (54 preceding siblings ...)
  2022-07-05 19:38 ` oreo639
@ 2022-07-05 23:12 ` oreo639
  2022-07-05 23:13 ` oreo639
                   ` (7 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 23:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 77905 bytes --]

From df4b7f432af234032916a65909bec630324be121 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 01/10] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index a5f385f719b9..8064f62c7a02 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 9315b7315cca16d51eacab6d90b92de2540cb803 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 02/10] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From c2bd0609b536df3612efeeca4bdb45f90fcdf30c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 03/10] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From c81b1d7dd08c39a178bf1cfa7e6837f07038294a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 04/10] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From c42d47bdc30d55b9a31800f5c2135e25bd6164fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 05/10] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From eb445c139df9117ff75e23602f431337a96534e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 06/10] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From a4d80cb7fcdaa281962ea6db3127e031c0525906 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 07/10] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From b646abed9d92c7c577abcdb9da8719050f128af2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 08/10] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 1595adba27ba7ce648109d086a9bd4825e3bbac9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 09/10] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 

From eff51fad29c1e586a46565fe3d7417cdb5cc77e0 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 5 Jul 2022 16:10:12 -0700
Subject: [PATCH 10/10] texlive: Remove poppler from makedepends

Texlive dropped support for libpoppler on 2020-05-14
---
 srcpkgs/texlive/template | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/srcpkgs/texlive/template b/srcpkgs/texlive/template
index 7a922bc07f2b..f3f8aa9995a2 100644
--- a/srcpkgs/texlive/template
+++ b/srcpkgs/texlive/template
@@ -60,7 +60,6 @@ configure_args="
  --with-system-libpaper
  --with-system-libpng
  --with-system-mpfr
- --with-system-poppler
  --with-system-pixman
  --with-system-teckit
  --with-system-zlib
@@ -69,8 +68,7 @@ configure_args="
 hostmakedepends="pkg-config perl lua52-BitOp texinfo"
 makedepends="cairo-devel freetype-devel gd-devel graphite-devel gmp-devel
  harfbuzz-devel icu-devel libpaper-devel libpng-devel mpfr-devel
- poppler-devel pixman-devel libteckit-devel zlib-devel zziplib-devel
- libXaw-devel"
+ pixman-devel libteckit-devel zlib-devel zziplib-devel libXaw-devel"
 depends="dialog ghostscript perl-Tk texlive-core texlive-latexmk xbps-triggers"
 short_desc="TeX Live"
 maintainer="fosslinux <fosslinux@aussies.space>"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (55 preceding siblings ...)
  2022-07-05 23:12 ` [PR PATCH] [Updated] " oreo639
@ 2022-07-05 23:13 ` oreo639
  2022-07-05 23:26 ` oreo639
                   ` (6 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 23:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 77916 bytes --]

From df4b7f432af234032916a65909bec630324be121 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 01/10] poppler: update to 22.06.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index a5f385f719b9..8064f62c7a02 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..0f8c6fc5193b 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.06.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 9315b7315cca16d51eacab6d90b92de2540cb803 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 02/10] poppler-qt5: update to 22.06.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..120db7a746a0 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.06.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=a0f9aaa3918bad781039fc307a635652a14d1b391cd559b66edec4bedba3c5d7
 # fails to find a bunch of files
 make_check=no
 

From c2bd0609b536df3612efeeca4bdb45f90fcdf30c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 03/10] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From c81b1d7dd08c39a178bf1cfa7e6837f07038294a Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 04/10] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From c42d47bdc30d55b9a31800f5c2135e25bd6164fb Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 05/10] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From eb445c139df9117ff75e23602f431337a96534e2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 06/10] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From a4d80cb7fcdaa281962ea6db3127e031c0525906 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 07/10] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From b646abed9d92c7c577abcdb9da8719050f128af2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 08/10] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 1595adba27ba7ce648109d086a9bd4825e3bbac9 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 09/10] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 

From 68de739679433b5c8411cd53bd356f46d6690b2c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 5 Jul 2022 16:10:12 -0700
Subject: [PATCH 10/10] texlive: Remove poppler from makedepends

Texlive previously dropped support for libpoppler on 2020-05-14
---
 srcpkgs/texlive/template | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/srcpkgs/texlive/template b/srcpkgs/texlive/template
index 7a922bc07f2b..f3f8aa9995a2 100644
--- a/srcpkgs/texlive/template
+++ b/srcpkgs/texlive/template
@@ -60,7 +60,6 @@ configure_args="
  --with-system-libpaper
  --with-system-libpng
  --with-system-mpfr
- --with-system-poppler
  --with-system-pixman
  --with-system-teckit
  --with-system-zlib
@@ -69,8 +68,7 @@ configure_args="
 hostmakedepends="pkg-config perl lua52-BitOp texinfo"
 makedepends="cairo-devel freetype-devel gd-devel graphite-devel gmp-devel
  harfbuzz-devel icu-devel libpaper-devel libpng-devel mpfr-devel
- poppler-devel pixman-devel libteckit-devel zlib-devel zziplib-devel
- libXaw-devel"
+ pixman-devel libteckit-devel zlib-devel zziplib-devel libXaw-devel"
 depends="dialog ghostscript perl-Tk texlive-core texlive-latexmk xbps-triggers"
 short_desc="TeX Live"
 maintainer="fosslinux <fosslinux@aussies.space>"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (56 preceding siblings ...)
  2022-07-05 23:13 ` oreo639
@ 2022-07-05 23:26 ` oreo639
  2022-07-05 23:38 ` oreo639
                   ` (5 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 23:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 77916 bytes --]

From d1711bca8b1db414b396b1b1e6f4db84de6a8101 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 01/10] poppler: update to 22.07.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index a5f385f719b9..8064f62c7a02 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..6f8e7e01f0bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.07.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From e6d4cbc07252e06bee03197cb8942f54c9e528f2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 02/10] poppler-qt5: update to 22.07.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..c0c0d8a67a00 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.07.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
 # fails to find a bunch of files
 make_check=no
 

From aa59e1e3530a6bd37c49759d8cd9bc41d54a556e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 03/10] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 4b798152e396cb61f26829c2f39b3337cde58ba3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 04/10] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 8fd56c034815656dd78bfd8a5faa8a11866a8896 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 05/10] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 227927879826edc5bbd26ec2f692cb7b7fd4cb04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 06/10] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From ea5d7994f5a5a6bd29e6fac39164c0c7999254b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 07/10] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From b346c31ff2d266fe13bb16c3c2ac8c9a068d21d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 08/10] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From 090662370c8c033f75840d4e6185b3c5de26db86 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 09/10] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 

From 0449abb186fc021198ffda42c0dcfbfffdee99ca Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 5 Jul 2022 16:10:12 -0700
Subject: [PATCH 10/10] texlive: Remove poppler from makedepends

Texlive previously dropped support for libpoppler on 2020-05-14
---
 srcpkgs/texlive/template | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/srcpkgs/texlive/template b/srcpkgs/texlive/template
index 7a922bc07f2b..f3f8aa9995a2 100644
--- a/srcpkgs/texlive/template
+++ b/srcpkgs/texlive/template
@@ -60,7 +60,6 @@ configure_args="
  --with-system-libpaper
  --with-system-libpng
  --with-system-mpfr
- --with-system-poppler
  --with-system-pixman
  --with-system-teckit
  --with-system-zlib
@@ -69,8 +68,7 @@ configure_args="
 hostmakedepends="pkg-config perl lua52-BitOp texinfo"
 makedepends="cairo-devel freetype-devel gd-devel graphite-devel gmp-devel
  harfbuzz-devel icu-devel libpaper-devel libpng-devel mpfr-devel
- poppler-devel pixman-devel libteckit-devel zlib-devel zziplib-devel
- libXaw-devel"
+ pixman-devel libteckit-devel zlib-devel zziplib-devel libXaw-devel"
 depends="dialog ghostscript perl-Tk texlive-core texlive-latexmk xbps-triggers"
 short_desc="TeX Live"
 maintainer="fosslinux <fosslinux@aussies.space>"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.06.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (57 preceding siblings ...)
  2022-07-05 23:26 ` oreo639
@ 2022-07-05 23:38 ` oreo639
  2022-07-05 23:58 ` [PR PATCH] [Updated] poppler: update to 22.07.0 oreo639
                   ` (4 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 23:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.06.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 78384 bytes --]

From d1711bca8b1db414b396b1b1e6f4db84de6a8101 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 01/10] poppler: update to 22.07.0

---
 common/shlibs                            |  2 +-
 srcpkgs/poppler/patches/fix-cflags.patch | 21 ---------------------
 srcpkgs/poppler/template                 | 13 +++++++++----
 3 files changed, 10 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index a5f385f719b9..8064f62c7a02 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..6f8e7e01f0bc 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.07.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DCMAKE_BUILD_TYPE=RELEASE -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From e6d4cbc07252e06bee03197cb8942f54c9e528f2 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 02/10] poppler-qt5: update to 22.07.0

---
 srcpkgs/poppler-qt5/patches  | 1 -
 srcpkgs/poppler-qt5/template | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
 delete mode 120000 srcpkgs/poppler-qt5/patches

diff --git a/srcpkgs/poppler-qt5/patches b/srcpkgs/poppler-qt5/patches
deleted file mode 120000
index 636e4ac2cbd9..000000000000
--- a/srcpkgs/poppler-qt5/patches
+++ /dev/null
@@ -1 +0,0 @@
-../poppler/patches
\ No newline at end of file
diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..c0c0d8a67a00 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,12 +4,13 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.07.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
- -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF"
+ -DENABLE_QT5=ON -DENABLE_UTILS=OFF -DENABLE_CPP=OFF -DENABLE_BOOST=OFF
+ -DCMAKE_BUILD_TYPE=RELEASE"
 hostmakedepends="pkg-config qt5-devel"
 makedepends="libpng-devel tiff-devel lcms2-devel libcurl-devel
  fontconfig-devel cairo-devel libopenjpeg2-devel qt5-devel"
@@ -17,8 +18,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
 # fails to find a bunch of files
 make_check=no
 

From aa59e1e3530a6bd37c49759d8cd9bc41d54a556e Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 03/10] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 4b798152e396cb61f26829c2f39b3337cde58ba3 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 04/10] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 8fd56c034815656dd78bfd8a5faa8a11866a8896 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 05/10] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From 227927879826edc5bbd26ec2f692cb7b7fd4cb04 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 06/10] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From ea5d7994f5a5a6bd29e6fac39164c0c7999254b4 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 07/10] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From b346c31ff2d266fe13bb16c3c2ac8c9a068d21d1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 08/10] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From bcffc9dc1292ef81a3ffab1e4a8fd81037c256f1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 09/10] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 srcpkgs/libreoffice/template                  |  2 +-
 3 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 
diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 6d35e14a3274..158df0f30ebc 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.3.3.2
-revision=2
+revision=3
 build_style=meta
 make_build_target="build-nocheck"
 nocross="Several dependencies are nocross=yes"

From d3d012bc6e1a918b19a643c5950cb02a6da9dbe7 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 5 Jul 2022 16:10:12 -0700
Subject: [PATCH 10/10] texlive: Remove poppler from makedepends

Texlive previously dropped support for libpoppler on 2020-05-14
---
 srcpkgs/texlive/template | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/srcpkgs/texlive/template b/srcpkgs/texlive/template
index 7a922bc07f2b..f3f8aa9995a2 100644
--- a/srcpkgs/texlive/template
+++ b/srcpkgs/texlive/template
@@ -60,7 +60,6 @@ configure_args="
  --with-system-libpaper
  --with-system-libpng
  --with-system-mpfr
- --with-system-poppler
  --with-system-pixman
  --with-system-teckit
  --with-system-zlib
@@ -69,8 +68,7 @@ configure_args="
 hostmakedepends="pkg-config perl lua52-BitOp texinfo"
 makedepends="cairo-devel freetype-devel gd-devel graphite-devel gmp-devel
  harfbuzz-devel icu-devel libpaper-devel libpng-devel mpfr-devel
- poppler-devel pixman-devel libteckit-devel zlib-devel zziplib-devel
- libXaw-devel"
+ pixman-devel libteckit-devel zlib-devel zziplib-devel libXaw-devel"
 depends="dialog ghostscript perl-Tk texlive-core texlive-latexmk xbps-triggers"
 short_desc="TeX Live"
 maintainer="fosslinux <fosslinux@aussies.space>"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Updated] poppler: update to 22.07.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (58 preceding siblings ...)
  2022-07-05 23:38 ` oreo639
@ 2022-07-05 23:58 ` oreo639
  2022-07-06  7:39 ` oreo639
                   ` (3 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-05 23:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages poppler
https://github.com/void-linux/void-packages/pull/36351

poppler: update to 22.07.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/36351.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-36351.patch --]
[-- Type: text/x-diff, Size: 78819 bytes --]

From fc9b0a8bd6ae23051706c88ff6534a2d488ed269 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:28:08 -0700
Subject: [PATCH 01/10] poppler: update to 22.07.0

---
 common/shlibs                                 |  2 +-
 .../patches/cmake-build-type-none.patch       | 13 ++++++++++++
 srcpkgs/poppler/patches/fix-cflags.patch      | 21 -------------------
 srcpkgs/poppler/template                      | 13 ++++++++----
 4 files changed, 23 insertions(+), 26 deletions(-)
 create mode 100644 srcpkgs/poppler/patches/cmake-build-type-none.patch
 delete mode 100644 srcpkgs/poppler/patches/fix-cflags.patch

diff --git a/common/shlibs b/common/shlibs
index a5f385f719b9..8064f62c7a02 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -350,7 +350,7 @@ libMagickCore-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagickWand-6.Q16.so.7 libmagick6-6.9.11.61_1
 libMagick++-6.Q16.so.9 libmagick6-6.9.12.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.111 libpoppler-21.07.0_1
+libpoppler.so.122 libpoppler-22.06.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/patches/cmake-build-type-none.patch b/srcpkgs/poppler/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..3f107d36bc6d
--- /dev/null
+++ b/srcpkgs/poppler/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
+index 2aed0284..ea8d7e57 100644
+--- a/cmake/modules/PopplerMacros.cmake
++++ b/cmake/modules/PopplerMacros.cmake
+@@ -80,7 +80,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ 
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" _CMAKE_BUILD_TYPE_UPPER)
+-set(_known_build_types RELWITHDEBINFO;RELEASE;DEBUG;DEBUGFULL;PROFILE)
++set(_known_build_types RELWITHDEBINFO;RELEASE;DEBUG;DEBUGFULL;PROFILE;NONE)
+ # We override CMAKE_CXX_FLAGS_${_CMAKE_BUILD_TYPE_UPPER} below. If the user
+ # selects a CMAKE_BUILD_TYPE that is not handled by the logic below, we will
+ # end up dropping the previous flags (e.g. those set in a cross-compilation
diff --git a/srcpkgs/poppler/patches/fix-cflags.patch b/srcpkgs/poppler/patches/fix-cflags.patch
deleted file mode 100644
index f1a408d03cce..000000000000
--- a/srcpkgs/poppler/patches/fix-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
-index fe1182d..6013bd2 100644
---- a/cmake/modules/PopplerMacros.cmake
-+++ b/cmake/modules/PopplerMacros.cmake
-@@ -104,14 +104,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
-   set(DEFAULT_COMPILE_WARNINGS_EXTRA "${_warn} ${_warnx}")
- 
-   set(_save_cxxflags "${CMAKE_CXX_FLAGS}")
--  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE")
-+  set(CMAKE_CXX_FLAGS                "-fno-exceptions -fno-check-new -fno-common -fno-operator-names -D_DEFAULT_SOURCE ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline ${_save_cxxflags}")
-   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}")
-   set(_save_cflags "${CMAKE_C_FLAGS}")
--  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE")
-+  set(CMAKE_C_FLAGS                  "-std=c99 -D_DEFAULT_SOURCE ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g ${_save_cflags}")
-   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG ${_save_cflags}")
-   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}")
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 0aa4edf20b57..74af1e5d2b63 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -3,13 +3,15 @@
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
 #
 pkgname=poppler
-version=21.07.0
+version=22.07.0
 revision=1
+_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)"
+ -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DTESTDATADIR='${XBPS_BUILDDIR}/test-${_testVersion}'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
 libcurl-devel libopenjpeg2-devel $(vopt_if boost boost-devel)"
@@ -17,8 +19,11 @@ short_desc="PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
+distfiles="${homepage}/${pkgname}-${version}.tar.xz
+ https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
+checksum="420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
+ ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"
 build_options_default="gir boost"

From e94c68e0d31173710dd778a68b4cfb6512edc1be Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:02 -0700
Subject: [PATCH 02/10] poppler-qt5: update to 22.07.0

---
 srcpkgs/poppler-qt5/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a15f56128c1..23dcc6485ac1 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=21.07.0
+version=22.07.0
 revision=1
 wrksrc="poppler-${version}"
 build_style=cmake
@@ -17,8 +17,9 @@ short_desc="PDF rendering library - Qt5 bindings"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
+changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="${homepage}/poppler-${version}.tar.xz"
-checksum=e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4
+checksum=420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
 # fails to find a bunch of files
 make_check=no
 

From f6c957df2dacf1261a1d10fd8bc93a7c8f920b12 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:29:32 -0700
Subject: [PATCH 03/10] poppler-data: update to 0.4.11

---
 srcpkgs/poppler-data/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-data/template b/srcpkgs/poppler-data/template
index 48dba2497fb6..4b6e956b7b72 100644
--- a/srcpkgs/poppler-data/template
+++ b/srcpkgs/poppler-data/template
@@ -1,13 +1,13 @@
 # Template file for 'poppler-data'
 pkgname=poppler-data
-version=0.4.10
+version=0.4.11
 revision=1
 short_desc="Encoding data for the poppler PDF rendering library"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, GPL-2.0-or-later, BSD-3-Clause"
 homepage="https://poppler.freedesktop.org/"
 distfiles="https://poppler.freedesktop.org/${pkgname}-${version}.tar.gz"
-checksum=6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30
+checksum=2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c
 
 do_install() {
 	make prefix=/usr DESTDIR=${DESTDIR} install

From 3816c9376e6aa8ec41a6f27ec7ace870a8709cdd Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:33:32 -0700
Subject: [PATCH 04/10] calligra: rebuild against libpoppler 22.06.0

---
 .../patches/0001-Fix-some-more-warnings.patch | 440 ++++++++++++++++++
 .../0002-Make-show-hidden-row-s-work.patch    |  29 ++
 srcpkgs/calligra/patches/c++17.patch          |  16 +
 .../patches/poppler-22.03.0-fix.patch         |  70 +++
 .../patches/poppler-22.04.0-fix.patch         |  91 ++++
 srcpkgs/calligra/template                     |   2 +-
 6 files changed, 647 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
 create mode 100644 srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
 create mode 100644 srcpkgs/calligra/patches/c++17.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/calligra/patches/poppler-22.04.0-fix.patch

diff --git a/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
new file mode 100644
index 000000000000..6cc132925b16
--- /dev/null
+++ b/srcpkgs/calligra/patches/0001-Fix-some-more-warnings.patch
@@ -0,0 +1,440 @@
+From 068cd9aec11052733e393976142516d2190e4564 Mon Sep 17 00:00:00 2001
+From: Pierre Ducroquet <pinaraf@pinaraf.info>
+Date: Sun, 28 Feb 2021 23:23:02 +0100
+Subject: [PATCH] Fix some more warnings
+
+---
+ filters/libmsooxml/MsooXmlDiagramReader_p.cpp        |  1 +
+ filters/sheets/csv/csvimport.cc                      |  2 +-
+ filters/sheets/excel/sidewinder/excel.cpp            |  1 +
+ filters/sheets/excel/sidewinder/formulas.cpp         |  2 +-
+ filters/sheets/gnumeric/gnumericexport.cc            |  5 ++---
+ filters/sheets/html/htmlexport.cc                    |  2 --
+ filters/sheets/latex/export/latexexport.cc           |  1 -
+ filters/sheets/latex/export/table.cc                 |  1 +
+ filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp       |  1 -
+ filters/stage/pptx/PptxXmlDocumentReader.cpp         |  2 +-
+ filters/words/msword-odf/texthandler.cpp             |  2 ++
+ filters/words/msword-odf/wv2/src/parser9x.cpp        |  4 +++-
+ filters/words/msword-odf/wv2/src/styles.cpp          |  4 +---
+ filters/words/msword-odf/wv2/src/styles.h            | 11 ++++++++---
+ gemini/lib/GeminiMainWindow.cpp                      |  2 ++
+ libs/pageapp/KoPAOdfPageSaveHelper.cpp               |  2 +-
+ plugins/spacenavigator/SpaceNavigatorDevice.h        |  6 ++----
+ plugins/spacenavigator/SpaceNavigatorEvent.h         |  2 +-
+ plugins/spacenavigator/SpaceNavigatorPollingThread.h |  3 +--
+ plugins/vectorshape/VectorShape.cpp                  |  1 +
+ sheets/functions/datetime.cpp                        |  1 +
+ sheets/part/Digest.cpp                               |  8 ++++----
+ sheets/shape/TableToolFactory.h                      |  2 +-
+ sheets/tests/TestSort.cpp                            |  4 ++--
+ 24 files changed, 38 insertions(+), 32 deletions(-)
+
+diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+index 14b08531262..14fc6ab9a71 100644
+--- a/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
++++ b/filters/libmsooxml/MsooXmlDiagramReader_p.cpp
+@@ -872,6 +872,7 @@ void LayoutNodeAtom::finishBuild(Context* context) {
+         case AlgorithmAtom::UnknownAlg:
+             warnMsooXml << "Layout with name=" << m_name << "defines an unknown algorithm.";
+             // fall through and use the composite-algorithm
++        // fall through
+         case AlgorithmAtom::CompositeAlg: m_algorithmImpl = new CompositeAlgorithm; break;
+         case AlgorithmAtom::ConnectorAlg: m_algorithmImpl = new ConnectorAlgorithm; break;
+         case AlgorithmAtom::CycleAlg: m_algorithmImpl = new CycleAlgorithm; break;
+diff --git a/filters/sheets/csv/csvimport.cc b/filters/sheets/csv/csvimport.cc
+index 89fb7162e00..1008d186f18 100644
+--- a/filters/sheets/csv/csvimport.cc
++++ b/filters/sheets/csv/csvimport.cc
+@@ -97,8 +97,8 @@ KoFilter::ConversionStatus CSVFilter::convert(const QByteArray& from, const QByt
+         return KoFilter::FileNotFound;
+     }
+ 
+-    QString csv_delimiter;
+     // ###### FIXME: disabled for now
++    //QString csv_delimiter;
+     //if (!config.isNull())
+     //    csv_delimiter = config[0];
+ 
+diff --git a/filters/sheets/excel/sidewinder/excel.cpp b/filters/sheets/excel/sidewinder/excel.cpp
+index ab592225ca6..7fa5633d433 100644
+--- a/filters/sheets/excel/sidewinder/excel.cpp
++++ b/filters/sheets/excel/sidewinder/excel.cpp
+@@ -2449,6 +2449,7 @@ bool ExcelReader::load(Workbook* workbook, const char* filename)
+               } else {
+                 bytes_read = combObjStream->read( buffer, markerOrLength );
+                 QString ansiString = readByteString(buffer, markerOrLength);
++                Q_UNUSED(ansiString);
+                 //TODO...
+                 //printf( "markerOrLength=%i ansiString=%s\n",markerOrLength,ansiString.ascii() );
+               }
+diff --git a/filters/sheets/excel/sidewinder/formulas.cpp b/filters/sheets/excel/sidewinder/formulas.cpp
+index 62747469a49..0132d39e024 100644
+--- a/filters/sheets/excel/sidewinder/formulas.cpp
++++ b/filters/sheets/excel/sidewinder/formulas.cpp
+@@ -1513,7 +1513,7 @@ static void mergeTokens(UStringStack* stack, unsigned count, const QString &merg
+     if (!stack) return;
+     if (stack->size() < count) return;
+ 
+-    QString s1, s2;
++    QString s1;
+ 
+     while (count) {
+         count--;
+diff --git a/filters/sheets/gnumeric/gnumericexport.cc b/filters/sheets/gnumeric/gnumericexport.cc
+index 1256c68bc74..2468548edb3 100644
+--- a/filters/sheets/gnumeric/gnumericexport.cc
++++ b/filters/sheets/gnumeric/gnumericexport.cc
+@@ -1293,15 +1293,13 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                 i = 0;
+             }
+ 
+-            QString line;
+             for (int currentcolumn = 1; currentcolumn <= iMaxColumn; currentcolumn++) {
+                 QDomElement cell_contents;
+                 Cell cell(table, currentcolumn, currentrow);
+ 
+-                QString text, style;
++                QString text;
+                 QDomDocument domLink;
+                 QDomElement domRoot;
+-                QDomNode domNode;
+                 QDomNodeList childNodes;
+ 
+                 if (!cell.isDefault() && !cell.isEmpty()) {
+@@ -1342,6 +1340,7 @@ KoFilter::ConversionStatus GNUMERICExport::convert(const QByteArray& from, const
+                         text = domNode.toElement().text();
+ 
+                         while (!domNode.isNull()) {
++                            QString style;
+                             style = domNode.toElement().tagName();
+ 
+                             if (style == "b")
+diff --git a/filters/sheets/html/htmlexport.cc b/filters/sheets/html/htmlexport.cc
+index 2d116e0608c..bf41a6f743e 100644
+--- a/filters/sheets/html/htmlexport.cc
++++ b/filters/sheets/html/htmlexport.cc
+@@ -242,7 +242,6 @@ void HTMLExport::convertSheet(Sheet *sheet, QString &str, int iMaxUsedRow, int i
+             i = 0;
+         }
+ 
+-        QString separators;
+         QString line;
+         unsigned int nonempty_cells = 0;
+ 
+@@ -435,7 +434,6 @@ void HTMLExport::detectFilledCells(Sheet *sheet, int &rows, int &columns)
+         int iUsedColumn = 0;
+         for (int currentcolumn = 1 ; currentcolumn <= iMaxColumn ; currentcolumn++) {
+             cell = Cell(sheet, currentcolumn, currentrow);
+-            QString text;
+             if (!cell.isDefault() && !cell.isEmpty()) {
+                 iUsedColumn = currentcolumn;
+             }
+diff --git a/filters/sheets/latex/export/latexexport.cc b/filters/sheets/latex/export/latexexport.cc
+index 8d0698a3420..4f8caf235d9 100644
+--- a/filters/sheets/latex/export/latexexport.cc
++++ b/filters/sheets/latex/export/latexexport.cc
+@@ -38,7 +38,6 @@ LATEXExport::LATEXExport(QObject* parent, const QVariantList&) :
+ 
+ KoFilter::ConversionStatus LATEXExport::convert(const QByteArray& from, const QByteArray& to)
+ {
+-    QString config;
+ 
+     if (to != "text/x-tex" || from != "application/x-kspread")
+         return KoFilter::NotImplemented;
+diff --git a/filters/sheets/latex/export/table.cc b/filters/sheets/latex/export/table.cc
+index 8d8b6701a39..e58827dfbc7 100644
+--- a/filters/sheets/latex/export/table.cc
++++ b/filters/sheets/latex/export/table.cc
+@@ -118,6 +118,7 @@ void Table::analyzePaper(const QDomNode node)
+ 
+     /* borders */
+     QDomNode border = getChild(node, "borders");
++    Q_UNUSED(border);
+     setBorderRight(getAttr(node, "right").toLong());
+     setBorderLeft(getAttr(node, "left").toLong());
+     setBorderBottom(getAttr(node, "bottom").toLong());
+diff --git a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+index 782a5914729..eda8ffc6b47 100644
+--- a/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
++++ b/filters/sheets/xlsx/XlsxXmlWorksheetReader.cpp
+@@ -872,7 +872,6 @@ KoFilter::ConversionStatus XlsxXmlWorksheetReader::read_conditionalFormatting()
+     while (index < m_conditionalIndices.size()) {
+         QString conditionalArea;
+         Condition examinedCondition = m_conditionalIndices.at(index);
+-        QString sqrefOriginal = sqref;
+         int areaIndex = 0;
+         Condition previousCond;
+ 
+diff --git a/filters/stage/pptx/PptxXmlDocumentReader.cpp b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+index 4cf86aea8c8..11b5ad266b9 100644
+--- a/filters/stage/pptx/PptxXmlDocumentReader.cpp
++++ b/filters/stage/pptx/PptxXmlDocumentReader.cpp
+@@ -316,7 +316,7 @@ KoFilter::ConversionStatus PptxXmlDocumentReader::read_sldId()
+ 
+     QString slideMasterPath, slideMasterFile;
+     MSOOXML::Utils::splitPathAndFile(m_context->relationships->targetForType(slidePath, slideFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideLayout"), &slideMasterPath, &slideMasterFile);
+-    const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
++    // const QString slideMasterPathAndFile = m_context->relationships->targetForType(slideMasterPath, slideMasterFile, QLatin1String(MSOOXML::Schemas::officeDocument::relationships) + "/slideMaster");
+ 
+     // Delay the reading of a tableStyle until we find a table as we need the
+     // clrMap from the master slide
+diff --git a/filters/words/msword-odf/texthandler.cpp b/filters/words/msword-odf/texthandler.cpp
+index e167d86e028..89ef678961a 100644
+--- a/filters/words/msword-odf/texthandler.cpp
++++ b/filters/words/msword-odf/texthandler.cpp
+@@ -408,6 +408,7 @@ void WordsTextHandler::footnoteFound(wvWare::FootnoteData data,
+         }
+         case msonfcUCLetter:
+             letter = 'A';
++            // fall through
+         case msonfcLCLetter:
+         {
+             while (noteNumber / 25 > 0) {
+@@ -1064,6 +1065,7 @@ void WordsTextHandler::fieldStart(const wvWare::FLD* fld, wvWare::SharedPtr<cons
+         break;
+     case UNSUPPORTED:
+         warnMsDoc << "Warning: Fld data missing, ignoring!";
++        // fall through
+     default:
+         warnMsDoc << "Warning: unrecognized field type, ignoring!";
+         m_fld->m_type = UNSUPPORTED;
+diff --git a/filters/words/msword-odf/wv2/src/parser9x.cpp b/filters/words/msword-odf/wv2/src/parser9x.cpp
+index 9a6d1606ce9..e5d7d14691c 100644
+--- a/filters/words/msword-odf/wv2/src/parser9x.cpp
++++ b/filters/words/msword-odf/wv2/src/parser9x.cpp
+@@ -581,7 +581,8 @@ void Parser9x::processPiece( String* string, U32 fc, U32 limit, const Position&
+         // same ASCII code as TTP_MARK (0x0007), NOTE: table depth == 1
+         case CELL_MARK:
+             m_cellMarkFound = true;
+-            // Fall-through intended. A row/cell end is also a paragraph end.
++            // A row/cell end is also a paragraph end.
++            // fall through
+         case PARAGRAPH_MARK:
+         {
+             // No "index - start + 1" here, as we don't want to copy the
+@@ -1064,6 +1065,7 @@ void Parser9x::emitSpecialCharacter( UChar character, U32 globalCP, SharedPtr<co
+             if (m_subDocument == Main) {
+                 emitAnnotation( UString(character), globalCP, chp );
+             }
++            break;
+         }
+     case TextHandler::FieldEscapeChar:
+         wvlog << "Found an escape character ++++++++++++++++++++?" << endl;
+diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp
+index f47c3dd8d51..d2c96e3d92b 100644
+--- a/filters/words/msword-odf/wv2/src/styles.cpp
++++ b/filters/words/msword-odf/wv2/src/styles.cpp
+@@ -42,7 +42,6 @@ STD::STD()
+ }
+ 
+ STD::STD( U16 baseSize, U16 totalSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     clearInternal();
+     if (!read( baseSize, totalSize, stream, preservePos )) {
+@@ -112,7 +111,6 @@ STD& STD::operator=( const STD& rhs )
+ }
+ 
+ bool STD::read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos )
+-throw(InvalidFormatException)
+ {
+     U16 shifterU16;
+     S32 startOffset=stream->tell();  // address where the STD starts
+@@ -938,7 +936,7 @@ void Style::mergeUpechpx( const Style* parentStyle, WordVersion version )
+ }
+ 
+ 
+-StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException)
++StyleSheet::StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf )
+     : m_udsNum(0)
+ {
+     WordVersion version = Word8;
+diff --git a/filters/words/msword-odf/wv2/src/styles.h b/filters/words/msword-odf/wv2/src/styles.h
+index ba02def6845..41c8278dd21 100644
+--- a/filters/words/msword-odf/wv2/src/styles.h
++++ b/filters/words/msword-odf/wv2/src/styles.h
+@@ -58,8 +58,9 @@ struct STD
+     STD();
+     /**
+      * Simply calls read(...)
++     * @throw InvalidFormatException
+      */
+-    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    STD( U16 stdfSize, U16 totalSize, OLEStreamReader* stream, bool preservePos = false );
+     /**
+      * Attention: This struct allocates memory on the heap
+      */
+@@ -74,8 +75,9 @@ struct STD
+      * false the state of stream will be changed!
+      *
+      * @return true - success, false - failed
++     * @throw InvalidFormatException
+      */
+-    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false ) throw(InvalidFormatException);
++    bool read( const U16 cbStd, const U16 stdfSize, OLEStreamReader* stream, bool preservePos = false );
+ 
+     /**
+      * Same as reading :)
+@@ -365,7 +367,10 @@ class WV2_EXPORT Style
+ class WV2_EXPORT StyleSheet
+ {
+ public:
+-    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf ) throw(InvalidFormatException);
++    /**
++     * @throw InvalidFormatException
++     */
++    StyleSheet( OLEStreamReader* tableStream, U32 fcStshf, U32 lcbStshf );
+     ~StyleSheet();
+ 
+     /**
+diff --git a/gemini/lib/GeminiMainWindow.cpp b/gemini/lib/GeminiMainWindow.cpp
+index 3d05f6461e0..eb5f120c0f7 100644
+--- a/gemini/lib/GeminiMainWindow.cpp
++++ b/gemini/lib/GeminiMainWindow.cpp
+@@ -136,8 +136,10 @@ void GeminiMainWindow::setFullScreen(bool newState)
+ }
+ 
+ 
++
+ void GeminiMainWindow::changeState(GeminiMainWindow::GeminiState newState, bool lockNewState)
+ {
++    Q_UNUSED(lockNewState);
+     d->syncObject = new GeminiModeSynchronisationObject;
+ 
+     if(centralWidget()) {
+diff --git a/libs/pageapp/KoPAOdfPageSaveHelper.cpp b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+index 92c6dfd4cb4..068501c8af1 100644
+--- a/libs/pageapp/KoPAOdfPageSaveHelper.cpp
++++ b/libs/pageapp/KoPAOdfPageSaveHelper.cpp
+@@ -49,7 +49,7 @@ KoPAOdfPageSaveHelper::KoPAOdfPageSaveHelper( KoPADocument * doc, QList<KoPAPage
+             KoPAPage * p = static_cast<KoPAPage *>( page );
+             masterPages.insert( p->masterPage() );
+         }
+-        m_masterPages = masterPages.toList();
++        m_masterPages = masterPages.values();
+     }
+ }
+ 
+diff --git a/plugins/spacenavigator/SpaceNavigatorDevice.h b/plugins/spacenavigator/SpaceNavigatorDevice.h
+index b9056ac98c1..ecd696e415f 100644
+--- a/plugins/spacenavigator/SpaceNavigatorDevice.h
++++ b/plugins/spacenavigator/SpaceNavigatorDevice.h
+@@ -31,10 +31,8 @@ class SpaceNavigatorDevice : public KoInputDeviceHandler
+     explicit SpaceNavigatorDevice(QObject *parent);
+     virtual ~SpaceNavigatorDevice();
+ 
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool start();
+-    /// reimplemented from KoInputDeviceHandler
+-    virtual bool stop();
++    virtual bool start() override;
++    virtual bool stop() override;
+ private Q_SLOTS:
+     void slotMoveEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons );
+     void slotButtonEvent( int x, int y, int z, int rx, int ry, int rz, Qt::MouseButtons, Qt::MouseButton, int type );
+diff --git a/plugins/spacenavigator/SpaceNavigatorEvent.h b/plugins/spacenavigator/SpaceNavigatorEvent.h
+index 73751ec88ff..76ee8e2f880 100644
+--- a/plugins/spacenavigator/SpaceNavigatorEvent.h
++++ b/plugins/spacenavigator/SpaceNavigatorEvent.h
+@@ -33,7 +33,7 @@ class SpaceNavigatorEvent : public KoInputDeviceHandlerEvent
+     void setPosition( int x, int y, int z );
+     void setRotation( int rx, int ry, int rz );
+ 
+-    virtual KoPointerEvent * pointerEvent();
++    virtual KoPointerEvent * pointerEvent() override;
+ 
+ private:
+     int m_x, m_y, m_z;
+diff --git a/plugins/spacenavigator/SpaceNavigatorPollingThread.h b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+index 62c4de8ab73..67d59177021 100644
+--- a/plugins/spacenavigator/SpaceNavigatorPollingThread.h
++++ b/plugins/spacenavigator/SpaceNavigatorPollingThread.h
+@@ -39,8 +39,7 @@ class SpaceNavigatorPollingThread : public QThread
+ 
+ protected:
+ 
+-    /// reimplemented from QThread
+-    virtual void run();
++    virtual void run() override;
+ 
+ private:
+     bool m_stopped;
+diff --git a/plugins/vectorshape/VectorShape.cpp b/plugins/vectorshape/VectorShape.cpp
+index a25ab3fc561..9acbd251c94 100644
+--- a/plugins/vectorshape/VectorShape.cpp
++++ b/plugins/vectorshape/VectorShape.cpp
+@@ -294,6 +294,7 @@ void VectorShape::saveOdf(KoShapeSavingContext & context) const
+         break;
+     case VectorTypeSvg:
+         mimeType = "image/svg+xml";
++        break;
+     default:
+         // FIXME: What here?
+         mimeType = "application/x-what";
+diff --git a/sheets/functions/datetime.cpp b/sheets/functions/datetime.cpp
+index 9f59fe2cf75..6157b0996c1 100644
+--- a/sheets/functions/datetime.cpp
++++ b/sheets/functions/datetime.cpp
+@@ -597,6 +597,7 @@ Value func_currentDate(valVector, ValueCalc * calc, FuncExtra *)
+ // Function: CURRENTTIME
+ Value func_currentTime(valVector, ValueCalc * calc, FuncExtra *)
+ {
++    Q_UNUSED(calc);
+     return Value(QTime::currentTime());
+ }
+ 
+diff --git a/sheets/part/Digest.cpp b/sheets/part/Digest.cpp
+index 8cd972db989..e9246ce6e7d 100644
+--- a/sheets/part/Digest.cpp
++++ b/sheets/part/Digest.cpp
+@@ -596,10 +596,10 @@ static void __rtl_digest_endSHA(DigestContextSHA *ctx)
+     }
+ 
+     switch (ctx->m_nDatLen & 0x03) {
+-    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L;
+-    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L;
+-    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L;
+-    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L;
++    case 0: X[i]  = ((sal_uInt32)(*(p++))) <<  0L; /* fall through */
++    case 1: X[i] |= ((sal_uInt32)(*(p++))) <<  8L; /* fall through */
++    case 2: X[i] |= ((sal_uInt32)(*(p++))) << 16L; /* fall through */
++    case 3: X[i] |= ((sal_uInt32)(*(p++))) << 24L; /* fall through */
+     }
+ 
+     __rtl_digest_swapLong(X, i + 1);
+diff --git a/sheets/shape/TableToolFactory.h b/sheets/shape/TableToolFactory.h
+index 679bfe14b8e..9412d8ffdc5 100644
+--- a/sheets/shape/TableToolFactory.h
++++ b/sheets/shape/TableToolFactory.h
+@@ -34,7 +34,7 @@ class TableToolFactory : public KoToolFactoryBase
+     TableToolFactory();
+     ~TableToolFactory();
+ 
+-    KoToolBase* createTool(KoCanvasBase* canvas);
++    KoToolBase* createTool(KoCanvasBase* canvas) override;
+ };
+ 
+ } // namespace Sheets
+diff --git a/sheets/tests/TestSort.cpp b/sheets/tests/TestSort.cpp
+index b3f1e35169d..6354d79abc5 100644
+--- a/sheets/tests/TestSort.cpp
++++ b/sheets/tests/TestSort.cpp
+@@ -68,7 +68,7 @@ void TestSort::AscendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
+@@ -121,7 +121,7 @@ void TestSort::DescendingOrder()
+     command->setSheet(sheet);
+ 
+     // Parameters.
+-    command->setSortRows(Qt::Vertical);
++    command->setSortRows(true);
+     command->setSkipFirst(false);
+     command->setCopyFormat(false);
+ 
diff --git a/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
new file mode 100644
index 000000000000..d4b082b9a0f1
--- /dev/null
+++ b/srcpkgs/calligra/patches/0002-Make-show-hidden-row-s-work.patch
@@ -0,0 +1,29 @@
+From 22e02998dec8af15a25b7e8e3d53c174810cc3be Mon Sep 17 00:00:00 2001
+From: Dag Andersen <danders@get2net.dk>
+Date: Thu, 11 Jun 2020 10:43:38 +0200
+Subject: [PATCH] Make show hidden row(s) work
+
+Check for hidden rows was inverted to check for shown rows,
+hence hidden rows would never be unhidden.
+
+BUG:338816
+BUG:354236
+FIXED-IN:3.2.2
+(cherry picked from commit 28920c50e6300d643477f256aba91c8c51836682)
+---
+ sheets/commands/RowColumnManipulators.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sheets/commands/RowColumnManipulators.cpp b/sheets/commands/RowColumnManipulators.cpp
+index 95282d6e31b..25e8c454e27 100644
+--- a/sheets/commands/RowColumnManipulators.cpp
++++ b/sheets/commands/RowColumnManipulators.cpp
+@@ -192,7 +192,7 @@ bool HideShowManipulator::preProcessing()
+                     }
+                 }
+                 for (int row = range.top(); row <= range.bottom(); ++row) {
+-                    if (!m_sheet->rowFormats()->isHidden(row)) {
++                    if (m_sheet->rowFormats()->isHidden(row)) {
+                         region.add(QRect(1, row, KS_colMax, 1));
+                     }
+                 }
diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++17.patch
new file mode 100644
index 000000000000..1db8385161a3
--- /dev/null
+++ b/srcpkgs/calligra/patches/c++17.patch
@@ -0,0 +1,16 @@
+diff -Naur CMakeLists.txt.orig CMakeLists.txt
+--- a/CMakeLists.txt.orig
++++ b/CMakeLists.txt
+@@ -106,9 +106,9 @@
+ 
+ # use CPP-11
+ if (CMAKE_VERSION VERSION_LESS "3.1")
+-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
++    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+ else ()
+-    set (CMAKE_CXX_STANDARD 11)
++    set (CMAKE_CXX_STANDARD 17)
+ endif ()
+ 
+ ############
+
diff --git a/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..7dab53bcfc7f
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,70 @@
+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.
+---
+ CMakeLists.txt                    | 1 +
+ filters/karbon/pdf/CMakeLists.txt | 2 +-
+ filters/karbon/pdf/PdfImport.cpp  | 9 +++++++++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 51f1d65b8e6..06bbad5c24c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -952,6 +952,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 8fddf1ad757..b71c92cbf04 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -3,7 +3,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)
+ 
+diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
+index abbe681b4e8..e97974fc133 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"
+@@ -54,8 +58,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
diff --git a/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e47169950b8b
--- /dev/null
+++ b/srcpkgs/calligra/patches/poppler-22.04.0-fix.patch
@@ -0,0 +1,91 @@
+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.
+---
+ filters/karbon/pdf/CMakeLists.txt    | 2 +-
+ filters/karbon/pdf/Pdf2OdgImport.cpp | 9 +++++++++
+ filters/karbon/pdf/SvgOutputDev.cpp  | 9 +++++++++
+ 3 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
+index b71c92cbf04..4ce138ccdd6 100644
+--- a/filters/karbon/pdf/CMakeLists.txt
++++ b/filters/karbon/pdf/CMakeLists.txt
+@@ -13,6 +13,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 934e31dd5aa..a21eac97a77 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>();)
+ 
+@@ -69,8 +73,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) {
+         globalParams.reset();
+         return KoFilter::StupidError;
+diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
+index 0e6e5a934ca..7caec15175a 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:
+@@ -386,7 +390,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;
+ 
diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 7c1411bf3da6..6f924d62f8ff 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=7
+revision=8
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From 221dc52826015c9fc2e0935057fbe7c3c9e882aa Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:07 -0700
Subject: [PATCH 05/10] inkscape: rebuild against libpoppler 22.06.0

---
 ...ibility-with-Poppler-22.03-and-later.patch |  50 ++++++
 .../Fix-build-with-poppler-21.11.0.patch      |  29 ++++
 .../Fix-build-with-poppler-22.04.patch        | 143 ++++++++++++++++++
 srcpkgs/inkscape/template                     |   2 +-
 4 files changed, 223 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
 create mode 100644 srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch

diff --git a/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
new file mode 100644
index 000000000000..297ef677665e
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Ensure-compatibility-with-Poppler-22.03-and-later.patch
@@ -0,0 +1,50 @@
+From a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Sun, 20 Mar 2022 22:41:51 -0300
+Subject: [PATCH] Ensure compatibility with Poppler 22.03 and later
+
+This change ensures that Inkscape will build against Poppler 22.03 after
+the changes that were made to the constructor of `PDFDoc`.
+
+See: https://gitlab.freedesktop.org/poppler/poppler/-/commit/4f2abd3ef
+
+Co-authored-by: Rafael Siejakowski <rs@rs-math.net>
+---
+ src/extension/internal/pdfinput/pdf-input.cpp            | 3 +--
+ src/extension/internal/pdfinput/poppler-transition-api.h | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
+index 3dabc94ba2..079b0dc713 100644
+--- a/src/extension/internal/pdfinput/pdf-input.cpp
++++ b/src/extension/internal/pdfinput/pdf-input.cpp
+@@ -688,8 +688,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
+ 
+     // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from
+     // glib gstdio.c
+-    GooString *filename_goo = new GooString(uri);
+-    pdf_doc = std::make_shared<PDFDoc>(filename_goo, nullptr, nullptr, nullptr);   // TODO: Could ask for password
++    pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password
+ 
+     if (!pdf_doc->isOk()) {
+         int error = pdf_doc->getErrorCode();
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 87a19d4c42..50b617c25c 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
++#else
++#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(new GooString(uri), nullptr, nullptr, nullptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+ #define _POPPLER_CONST_83 const
+ #else
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
new file mode 100644
index 000000000000..5d7f4801273d
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-21.11.0.patch
@@ -0,0 +1,29 @@
+From 5724c21b9cb7b6176a7b36ca24068b148c817e82 Mon Sep 17 00:00:00 2001
+From: Evangelos Foutras <evangelos@foutrelis.com>
+Date: Mon, 1 Nov 2021 21:45:38 +0200
+Subject: [PATCH] Fix build with poppler 21.11.0
+
+GfxFont::tag is now of type std::string instead of GooString *.
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index e3d04d544b..feecefa043 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -2169,7 +2169,11 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+   }
+   if (printCommands) {
+     printf("  font: tag=%s name='%s' %g\n",
++#if POPPLER_CHECK_VERSION(21,11,0)
++	   font->getTag().c_str(),
++#else
+ 	   font->getTag()->getCString(),
++#endif
+ 	   font->getName() ? font->getName()->getCString() : "???",
+ 	   args[1].getNum());
+     fflush(stdout);
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
new file mode 100644
index 000000000000..f12054268a3c
--- /dev/null
+++ b/srcpkgs/inkscape/patches/Fix-build-with-poppler-22.04.patch
@@ -0,0 +1,143 @@
+From d989cdf1059c78bc3bb6414330242073768d640b Mon Sep 17 00:00:00 2001
+From: Rafael Siejakowski <rs@rs-math.net>
+Date: Mon, 4 Apr 2022 22:09:39 -0300
+Subject: [PATCH] Compatibility with Poppler 22.04
+
+Replace vanilla pointers with std::shared_ptr for pointers to fonts;
+eliminate manual ref-counting.
+
+Fixes https://gitlab.com/inkscape/inkscape/-/issues/3387
+---
+ src/extension/internal/pdfinput/pdf-parser.cpp     | 14 ++++++++------
+ .../internal/pdfinput/poppler-transition-api.h     |  6 ++++++
+ src/extension/internal/pdfinput/svg-builder.cpp    |  7 +------
+ src/extension/internal/pdfinput/svg-builder.h      |  1 -
+ 4 files changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index feecefa043..d6e2ede4f3 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -30,6 +30,7 @@
+ #include "Gfx.h"
+ #include "pdf-parser.h"
+ #include "util/units.h"
++#include "poppler-transition-api.h"
+ 
+ #include "glib/poppler-features.h"
+ #include "goo/gmem.h"
+@@ -2158,7 +2159,7 @@ void PdfParser::opSetCharSpacing(Object args[], int /*numArgs*/)
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+ {
+-  GfxFont *font = res->lookupFont(args[0].getName());
++  auto font = res->lookupFont(args[0].getName());
+ 
+   if (!font) {
+     // unsetting the font (drawing no text) is better than using the
+@@ -2179,7 +2180,9 @@ void PdfParser::opSetFont(Object args[], int /*numArgs*/)
+     fflush(stdout);
+   }
+ 
++#if !POPPLER_CHECK_VERSION(22, 4, 0)
+   font->incRefCnt();
++#endif
+   state->setFont(font, args[1].getNum());
+   fontChanged = gTrue;
+ }
+@@ -2373,7 +2376,6 @@ void PdfParser::doShowText(const GooString *s) {
+ #else
+ void PdfParser::doShowText(GooString *s) {
+ #endif
+-  GfxFont *font;
+   int wMode;
+   double riseX, riseY;
+   CharCode code;
+@@ -2392,7 +2394,7 @@ void PdfParser::doShowText(GooString *s) {
+ #endif
+   int len, n, uLen;
+ 
+-  font = state->getFont();
++  auto font = state->getFont();
+   wMode = font->getWMode();
+ 
+   builder->beginString(state);
+@@ -2445,10 +2447,10 @@ void PdfParser::doShowText(GooString *s) {
+       //out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+       if (false){ /*!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
+ 			       code, u, uLen)) {*/
+-        _POPPLER_CALL_ARGS(charProc, ((Gfx8BitFont *)font)->getCharProc, code);
+-	if ((resDict = ((Gfx8BitFont *)font)->getResources())) {
++        _POPPLER_CALL_ARGS(charProc, _POPPLER_FONTPTR_TO_GFX8(font)->getCharProc, code);
++    if (resDict = _POPPLER_FONTPTR_TO_GFX8(font)->getResources()) {
+ 	  pushResources(resDict);
+-	}
++    }
+ 	if (charProc.isStream()) {
+ 	  //parse(&charProc, gFalse); // TODO: parse into SVG font
+ 	} else {
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 50b617c25c..dc9e47e45b 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,12 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(22, 4, 0)
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
++#else
++#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr)
++#endif
++
+ #if POPPLER_CHECK_VERSION(22, 3, 0)
+ #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared<PDFDoc>(std::make_unique<GooString>(uri))
+ #else
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index eede668893..901cc8cddb 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -108,7 +108,6 @@ SvgBuilder::~SvgBuilder() = default;
+ 
+ void SvgBuilder::_init() {
+     _font_style = nullptr;
+-    _current_font = nullptr;
+     _font_specification = nullptr;
+     _font_scaling = 1;
+     _need_font_update = true;
+@@ -1064,11 +1063,8 @@ void SvgBuilder::updateFont(GfxState *state) {
+     _need_font_update = false;
+     updateTextMatrix(state);    // Ensure that we have a text matrix built
+ 
+-    if (_font_style) {
+-        //sp_repr_css_attr_unref(_font_style);
+-    }
+     _font_style = sp_repr_css_attr_new();
+-    GfxFont *font = state->getFont();
++    auto font = state->getFont();
+     // Store original name
+     if (font->getName()) {
+         _font_specification = font->getName()->getCString();
+@@ -1213,7 +1209,6 @@ void SvgBuilder::updateFont(GfxState *state) {
+         sp_repr_css_set_property(_font_style, "writing-mode", "tb");
+     }
+ 
+-    _current_font = font;
+     _invalidated_style = true;
+ }
+ 
+diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h
+index fb4e64fa19..e91febd717 100644
+--- a/src/extension/internal/pdfinput/svg-builder.h
++++ b/src/extension/internal/pdfinput/svg-builder.h
+@@ -204,7 +204,6 @@ private:
+     std::vector<SvgGraphicsState> _state_stack;
+ 
+     SPCSSAttr *_font_style;          // Current font style
+-    GfxFont *_current_font;
+     const char *_font_specification;
+     double _font_scaling;
+     bool _need_font_update;
+-- 
+GitLab
+
diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 45f48ccda0dc..4d902e663f73 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.1.1
-revision=3
+revision=4
 wrksrc="inkscape-${version}_2021-09-20_3bf5ae0d25"
 build_style=cmake
 # builds executables then runs checks

From dbc9b02d21cf6b21a428d33fd37306e0c383c6ff Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:34:43 -0700
Subject: [PATCH 06/10] ipe: rebuild against libpoppler 22.06.0

---
 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch | 33 +++++++++++++++++++
 srcpkgs/ipe/template                          |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ipe/patches/poppler-22.03.0-fix.patch

diff --git a/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..df2894809c1c
--- /dev/null
+++ b/srcpkgs/ipe/patches/poppler-22.03.0-fix.patch
@@ -0,0 +1,33 @@
+diff -Naur pdftoipe.cpp.orig pdftoipe.cpp
+--- a/ipe-tools/pdftoipe/pdftoipe.cpp.orig
++++ b/ipe-tools/pdftoipe/pdftoipe.cpp
+@@ -84,22 +84,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
+-  GooString *ownerPW, *userPW;
++  std::optional<GooString> ownerPW, userPW;
+   if (ownerPassword[0]) {
+-    ownerPW = new GooString(ownerPassword);
++    ownerPW = GooString(ownerPassword);
+   } else {
+-    ownerPW = 0;
++    ownerPW = std::nullopt;
+   }
+   if (userPassword[0]) {
+-    userPW = new GooString(userPassword);
++    userPW = GooString(userPassword);
+   } else {
+-    userPW = 0;
++    userPW = std::nullopt;
+   }
+ 
+   // open PDF file
+-  PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+-  delete userPW;
+-  delete ownerPW;
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
+ 
+   if (!doc->isOk())
+     return 1;
+
diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index a84d5c036b2f..72398e7ff924 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.24
-revision=6
+revision=7
 _tools_commit=v7.2.20.1
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"
 makedepends="cairo-devel gsl-devel libcurl-devel libjpeg-turbo-devel

From 97ca865b717657a7126bf13becd33564de0a8f70 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:35:30 -0700
Subject: [PATCH 07/10] kitinerary: rebuild against libpoppler 22.06.0

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 343ef64911d6..a2cfcaa178b6 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=22.04.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config qt5-host-tools qt5-qmake qt5-tools-devel"
 makedepends="kcalendarcore-devel kcontacts-devel kdeclarative-devel kmime-devel

From b68ce076d26c9baa3d675a9acd80d54f599a1c98 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Fri, 25 Mar 2022 18:36:24 -0700
Subject: [PATCH 08/10] scribus: rebuild against libpoppler 22.06.0

---
 .../patches/0001-poppler-22.02.0-fix.patch    | 129 ++++++++
 .../patches/0002-poppler-22.03.0-fix.patch    |  52 ++++
 .../patches/0003-poppler-22.04.0-fix.patch    | 288 ++++++++++++++++++
 srcpkgs/scribus/template                      |   2 +-
 4 files changed, 470 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch

diff --git a/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
new file mode 100644
index 000000000000..4e0f607c6a07
--- /dev/null
+++ b/srcpkgs/scribus/patches/0001-poppler-22.02.0-fix.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+ 
+ #include "slaoutput.h"
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ 	GfxFont *gfxFont;
+-	GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	const GooString * fileName = nullptr;
++	std::unique_ptr<FoFiTrueType> ff;
++#else
++	GfxFontLoc * fontLoc = nullptr;
++	GooString * fileName = nullptr;
++	FoFiTrueType * ff = nullptr;
++#endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+-	FoFiTrueType *ff;
+ 	Object refObj, strObj;
+-	GooString *fileName;
+-	char *tmpBuf;
++	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+-	int *codeToGID;
+-	const double *textMat;
++	int *codeToGID = nullptr;
++	const double *textMat = nullptr;
+ 	double m11, m12, m21, m22, fontSize;
+ 	SplashCoord mat[4];
+ 	int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	SplashCoord matrix[6];
+ 
+ 	m_font = nullptr;
+-	fileName = nullptr;
+-	tmpBuf = nullptr;
+-	fontLoc = nullptr;
+ 
+ 	gfxFont = state->getFont();
+ 	if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++			fileName = fontLoc->pathAsGooString();
++#else
+ 			fileName = fontLoc->path;
++#endif
+ 			fontType = fontLoc->fontType;
+ 		}
+ 
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 			if (ff)
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++				ff.reset();
++#else
+ 				codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+-				n = 256;
+ 				delete ff;
++#endif
++				n = 256;
+ 			}
+ 			else
+ 			{
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ 				if (! ff)
+ 					goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++				codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++				ff.reset();
++#else
+ 				codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ 				delete ff;
++#endif
+ 			}
+ 			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ 							id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 	mat[3] = -m22;
+ 	m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+ 
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
+ 	return;
+ 
+ err2:
+ 	delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	delete fontLoc;
++#endif
++
+ err1:
+ 	if (fontsrc && !fontsrc->isFile)
+ 		fontsrc->unref();
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
new file mode 100644
index 000000000000..f7a0c03fdd96
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-fix.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ 	globalParams->setErrQuiet(gTrue);
+ 
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ 		return QImage();
+ 
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams->setErrQuiet(gTrue);
+ //	globalParams->setPrintCommands(gTrue);
+ 	QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ 	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ 	if (pdfDoc)
+ 	{
+ 		if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ 			}
+ 			if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
new file mode 100644
index 000000000000..e15ec7d81266
--- /dev/null
+++ b/srcpkgs/scribus/patches/0003-poppler-22.04.0-fix.patch
@@ -0,0 +1,288 @@
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ 	int shade = 100;
+ 	currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ 	fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	if (state->getFont() && state->getFont()->getName())
++		fontName = new GooString(state->getFont()->getName().value());
++#else
+ 	if (state->getFont())
+ 		fontName = state->getFont()->getName()->copy();
++#endif
+ 	itemText = s->copy();
+ }
+ 
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ 	SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	const PDFRectangle& annotRect = annota->getRect();;
++	const PDFRectangle* box = &annotRect;
++#else
+ 	PDFRectangle *box = annota->getRect();
++#endif
+ 	double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ 	double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ 	double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ 			if (apa || !achar)
+ 			{
+ 				AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				const PDFRectangle& annotaRect = annota->getRect();
++				Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ 				Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ 				ano->draw(gfx, false);
+ 				if (!bgFound)
+ 					m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ 
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+-	GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	std::optional<GfxFontLoc> fontLoc;
++	std::string fileName;
++	std::unique_ptr<FoFiTrueType> ff;
++	std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 	std::optional<GfxFontLoc> fontLoc;
+ 	const GooString * fileName = nullptr;
+ 	std::unique_ptr<FoFiTrueType> ff;
++	char* tmpBuf = nullptr;
+ #else
+ 	GfxFontLoc * fontLoc = nullptr;
+ 	GooString * fileName = nullptr;
+ 	FoFiTrueType * ff = nullptr;
++	char* tmpBuf = nullptr;
+ #endif
+ 	GfxFontType fontType;
+ 	SlaOutFontFileID *id;
+ 	SplashFontFile *fontFile;
+ 	SplashFontSrc *fontsrc = nullptr;
+ 	Object refObj, strObj;
+-	char *tmpBuf = nullptr;
+ 	int tmpBufLen = 0;
+ 	int *codeToGID = nullptr;
+ 	const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 
+ 	m_font = nullptr;
+ 
+-	gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++	GfxFont* gfxFont = state->getFont().get();
++#else
++	GfxFont* gfxFont = state->getFont();
++#endif
+ 	if (!gfxFont)
+ 		goto err1;
+ 
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		if (fontLoc->locType == gfxFontLocEmbedded)
+ 		{
+ 			// if there is an embedded font, read it to memory
+-			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ 			if (! tmpBuf)
+ 				goto err2;
++#else
++			tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++			if (!tmpBuf)
++				goto err2;
++#endif
+ 
+ 			// external font
+ 		}
+ 		else
+ 		{ // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ 			fileName = fontLoc->pathAsGooString();
+ #else
+ 			fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 		}
+ 
+ 		fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++		if (!fileName.empty())
++			fontsrc->setFile(fileName);
++		else
++			fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ 		if (fileName)
+ 			fontsrc->setFile(fileName, gFalse);
+ 		else
+ 			fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+ 
+ 		// load the font file
+ 		switch (fontType) {
+ 		case fontType1:
+-			if (!(fontFile = m_fontEngine->loadType1Font(
+-				id,
+-				fontsrc,
+-				(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1C:
+-			if (!(fontFile = m_fontEngine->loadType1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontType1COT:
+-			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+-							id,
+-							fontsrc,
+-							(const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++			if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontTrueType:
+ 		case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++			if (!fileName.empty())
++				ff = FoFiTrueType::load(fileName.c_str());
++			else
++				ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 			if (fileName)
+ 				ff = FoFiTrueType::load(fileName->getCString());
+ 			else
+ 				ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 			if (ff)
+ 			{
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+ 		case fontCIDType0:
+ 		case fontCIDType0C:
+-			if (!(fontFile = m_fontEngine->loadCIDFont(
+-							id,
+-							fontsrc)))
++			if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				codeToGID = nullptr;
+ 				n = 0;
+ 			}
+-			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n)))
++			if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ 			{
+ 				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ 				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 			}
+ 			else
+ 			{
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++				if (!fileName.empty())
++					ff = FoFiTrueType::load(fileName.c_str());
++				else
++					ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ 				if (fileName)
+ 					ff = FoFiTrueType::load(fileName->getCString());
+ 				else
+ 					ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ 				if (! ff)
+ 					goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ 				delete ff;
+ #endif
+ 			}
+-			if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+-							id,
+-							fontsrc,
+-							codeToGID, n, faceIndex)))
++			if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ 			{
+-				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+-				gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++				error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ 				goto err2;
+ 			}
+ 			break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ //	qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ 	GfxFont *gfxFont;
++	if (!(gfxFont = state->getFont().get()))
++		return gTrue;
++#else
++	GfxFont* gfxFont;
+ 	if (!(gfxFont = state->getFont()))
+ 		return gTrue;
++#endif
+ 	if (gfxFont->getType() != fontType3)
+ 		return gTrue;
+ 	F3Entry f3e;
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 791cdea712c5..125a7d54e4cf 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -4,7 +4,7 @@ version=1.5.8
 revision=2
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
- -DWANT_GRAPHICSMAGICK=1"
+ -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
 hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel

From e5385d22d91c43bd0d01e94231b8869789d6508c Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Thu, 16 Jun 2022 17:05:36 -0700
Subject: [PATCH 09/10] libreoffice: rebuild against libpoppler 22.06.0

---
 .../libreoffice/patches/poppler-22.03.0.patch | 28 ++++++++
 .../libreoffice/patches/poppler-22.04.0.patch | 71 +++++++++++++++++++
 srcpkgs/libreoffice/template                  |  2 +-
 3 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.03.0.patch
 create mode 100644 srcpkgs/libreoffice/patches/poppler-22.04.0.patch

diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
new file mode 100644
index 000000000000..c6544b2575f9
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch
@@ -0,0 +1,28 @@
+diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+index ad6320139..e5f6d9c68 100644
+--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+@@ -138,6 +138,15 @@ int main(int argc, char **argv)
+     _setmode( _fileno( g_binary_out ), _O_BINARY );
+ #endif
+ 
++#if POPPLER_CHECK_VERSION(22, 3, 0)
++    PDFDoc aDoc( std::make_unique<GooString>(pFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++
++    PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
++                 GooString(pOwnerPasswordStr),
++                 GooString(pUserPasswordStr) );
++#else
+     PDFDoc aDoc( pFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
+@@ -145,6 +154,7 @@ int main(int argc, char **argv)
+     PDFDoc aErrDoc( pErrFileName,
+                  pOwnerPasswordStr,
+                  pUserPasswordStr );
++#endif
+ 
+     // Check various permissions for aDoc.
+     PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
new file mode 100644
index 000000000000..47f59673d69e
--- /dev/null
+++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch
@@ -0,0 +1,71 @@
+# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd)
+
+--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g
+     {
+         // TODO(P3): Unfortunately, need to read stream twice, since
+         // we must write byte count to stdout before
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+         char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+         if( pBuf )
+         {
+             aNewFont.isEmbedded = true;
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+             gfree(pBuf);
++#endif
+         }
+     }
+ 
+@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons
+         return;
+ 
+     int nSize = 0;
+-    char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++        char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
++#else
++        std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
++#endif
+     if( !pBuf )
+         return;
+ 
+     // ---sync point--- see SYNC STREAMS above
+     fflush(stdout);
+-
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#else
++    if( fwrite(reinterpret_cast<char*>(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
++#endif
+     {
+-        gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+         exit(1); // error
+     }
+     // ---sync point--- see SYNC STREAMS above
+     fflush(g_binary_out);
+-    gfree(pBuf);
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
++            gfree(pBuf);
++#endif
+ }
+ 
+ #if POPPLER_CHECK_VERSION(0, 83, 0)
+@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state)
+ {
+     assert(state);
+ 
++#if !POPPLER_CHECK_VERSION(22, 3, 0)
+     GfxFont *gfxFont = state->getFont();
++#else
++    GfxFont *gfxFont = state->getFont().get();
++#endif
+     if( !gfxFont )
+         return;
+ 
diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 6d35e14a3274..158df0f30ebc 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.3.3.2
-revision=2
+revision=3
 build_style=meta
 make_build_target="build-nocheck"
 nocross="Several dependencies are nocross=yes"

From bbe6b1d3b2f139bc22d122b18545f77c30ab0fb1 Mon Sep 17 00:00:00 2001
From: oreo639 <31916379+Oreo639@users.noreply.github.com>
Date: Tue, 5 Jul 2022 16:10:12 -0700
Subject: [PATCH 10/10] texlive: Remove poppler from makedepends

Texlive previously dropped support for libpoppler on 2020-05-14
---
 srcpkgs/texlive/template | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/srcpkgs/texlive/template b/srcpkgs/texlive/template
index 7a922bc07f2b..f3f8aa9995a2 100644
--- a/srcpkgs/texlive/template
+++ b/srcpkgs/texlive/template
@@ -60,7 +60,6 @@ configure_args="
  --with-system-libpaper
  --with-system-libpng
  --with-system-mpfr
- --with-system-poppler
  --with-system-pixman
  --with-system-teckit
  --with-system-zlib
@@ -69,8 +68,7 @@ configure_args="
 hostmakedepends="pkg-config perl lua52-BitOp texinfo"
 makedepends="cairo-devel freetype-devel gd-devel graphite-devel gmp-devel
  harfbuzz-devel icu-devel libpaper-devel libpng-devel mpfr-devel
- poppler-devel pixman-devel libteckit-devel zlib-devel zziplib-devel
- libXaw-devel"
+ pixman-devel libteckit-devel zlib-devel zziplib-devel libXaw-devel"
 depends="dialog ghostscript perl-Tk texlive-core texlive-latexmk xbps-triggers"
 short_desc="TeX Live"
 maintainer="fosslinux <fosslinux@aussies.space>"

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.07.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (59 preceding siblings ...)
  2022-07-05 23:58 ` [PR PATCH] [Updated] poppler: update to 22.07.0 oreo639
@ 2022-07-06  7:39 ` oreo639
  2022-07-06  7:39 ` oreo639
                   ` (2 subsequent siblings)
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-06  7:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler) and I was surprised that the pdftosrc binary from texlive did not depend on libpoppler. (so I looked a different binary with a similar name, which in this case was pdftops)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.07.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (60 preceding siblings ...)
  2022-07-06  7:39 ` oreo639
@ 2022-07-06  7:39 ` oreo639
  2022-07-06  7:40 ` oreo639
  2022-07-06  8:50 ` [PR PATCH] [Merged]: " paper42
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-06  7:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler) and I was surprised that the pdftosrc binary from texlive did not depend on libpoppler. (so I looked a different binary with a similar name, which in this case was pdftops from the poppler package)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: poppler: update to 22.07.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (61 preceding siblings ...)
  2022-07-06  7:39 ` oreo639
@ 2022-07-06  7:40 ` oreo639
  2022-07-06  8:50 ` [PR PATCH] [Merged]: " paper42
  63 siblings, 0 replies; 65+ messages in thread
From: oreo639 @ 2022-07-06  7:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/36351#issuecomment-1175363234

Comment:
texlive dropped its dependency on libpoppler in favor of an in-tree copy xpdf.
https://github.com/TeX-Live/texlive-source/commit/5cc2db7d41d50988edda4656379a39953ca0bd6c

Also, previously I erroneously made a comment on the IRC about a file from texlive depending on libpoppler, that was not from texlive, but from the poppler package itself, I just got mixed up since it is a similar naming scheme to a binary from texlive (which did not depend on libpoppler) and I was surprised that the pdftosrc binary from texlive did not depend on libpoppler. (so I looked a different binary with a similar name, which in this case was pdftops from the poppler package without realizing it)

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PR PATCH] [Merged]: poppler: update to 22.07.0
  2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
                   ` (62 preceding siblings ...)
  2022-07-06  7:40 ` oreo639
@ 2022-07-06  8:50 ` paper42
  63 siblings, 0 replies; 65+ messages in thread
From: paper42 @ 2022-07-06  8:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]

There's a merged pull request on the void-packages repository

poppler: update to 22.07.0
https://github.com/void-linux/void-packages/pull/36351

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2022-07-06  8:50 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26  1:37 [PR PATCH] poppler: update to 22.03.0 oreo639
2022-03-26  1:39 ` [PR PATCH] [Updated] " oreo639
2022-03-26  3:40 ` oreo639
2022-03-26  3:41 ` oreo639
2022-03-26  3:42 ` [PR PATCH] [Updated] " oreo639
2022-03-26  3:42 ` oreo639
2022-03-26  4:03 ` [PR PATCH] [Updated] " oreo639
2022-03-26  5:21 ` oreo639
2022-03-26  5:48 ` oreo639
2022-03-26  6:21 ` oreo639
2022-03-26 17:54 ` oreo639
2022-03-26 17:59 ` oreo639
2022-03-26 19:03 ` oreo639
2022-03-26 19:30 ` oreo639
2022-03-26 19:30 ` oreo639
2022-04-17  8:12 ` oreo639
2022-04-17  8:14 ` oreo639
2022-04-17  8:35 ` [PR PATCH] [Updated] " oreo639
2022-04-17  8:52 ` [PR PATCH] [Updated] poppler: update to 22.04.0 oreo639
2022-04-17  9:29 ` oreo639
2022-04-17  9:31 ` oreo639
2022-04-17  9:35 ` oreo639
2022-04-17 10:22 ` oreo639
2022-04-17 10:45 ` oreo639
2022-04-17 10:46 ` oreo639
2022-04-17 10:47 ` oreo639
2022-04-17 10:55 ` oreo639
2022-04-17 23:07 ` [PR PATCH] [Updated] " oreo639
2022-04-18 23:47 ` oreo639
2022-05-01  2:03 ` oreo639
2022-05-01  2:05 ` oreo639
2022-05-12  4:19 ` oreo639
2022-05-16 21:43 ` oreo639
2022-06-11 23:10 ` oreo639
2022-06-17  0:05 ` [PR PATCH] [Updated] poppler: update to 22.06.0 oreo639
2022-06-17  0:51 ` oreo639
2022-06-17  1:40 ` classabbyamp
2022-06-17  4:53 ` oreo639
2022-06-18 23:59 ` oreo639
2022-06-19  0:02 ` oreo639
2022-06-19  0:02 ` oreo639
2022-06-19  0:04 ` oreo639
2022-06-19  0:05 ` [PR PATCH] [Updated] " oreo639
2022-06-19  0:06 ` oreo639
2022-06-19  0:06 ` oreo639
2022-06-19  0:10 ` oreo639
2022-06-19  0:11 ` oreo639
2022-06-19  0:37 ` oreo639
2022-07-05 10:47 ` paper42
2022-07-05 18:26 ` oreo639
2022-07-05 18:29 ` oreo639
2022-07-05 18:30 ` oreo639
2022-07-05 18:31 ` oreo639
2022-07-05 18:42 ` oreo639
2022-07-05 18:47 ` oreo639
2022-07-05 19:38 ` oreo639
2022-07-05 23:12 ` [PR PATCH] [Updated] " oreo639
2022-07-05 23:13 ` oreo639
2022-07-05 23:26 ` oreo639
2022-07-05 23:38 ` oreo639
2022-07-05 23:58 ` [PR PATCH] [Updated] poppler: update to 22.07.0 oreo639
2022-07-06  7:39 ` oreo639
2022-07-06  7:39 ` oreo639
2022-07-06  7:40 ` oreo639
2022-07-06  8:50 ` [PR PATCH] [Merged]: " paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).