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 CompositeA