From b676978e175f698efe2ece4844d1abed80da8d21 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Thu, 22 Aug 2024 17:06:25 +0200 Subject: [PATCH] calligra: revbump for libpoppler, use c++20 --- .../patches/{c++17.patch => c++20.patch} | 4 +- ...-compile-with-poppler-2405-or-higher.patch | 59 +++++++++++++++++++ srcpkgs/calligra/template | 2 +- 3 files changed, 62 insertions(+), 3 deletions(-) rename srcpkgs/calligra/patches/{c++17.patch => c++20.patch} (76%) create mode 100644 srcpkgs/calligra/patches/upstream_Fix-compile-with-poppler-2405-or-higher.patch diff --git a/srcpkgs/calligra/patches/c++17.patch b/srcpkgs/calligra/patches/c++20.patch similarity index 76% rename from srcpkgs/calligra/patches/c++17.patch rename to srcpkgs/calligra/patches/c++20.patch index 1db8385161a..3e36ce8c222 100644 --- a/srcpkgs/calligra/patches/c++17.patch +++ b/srcpkgs/calligra/patches/c++20.patch @@ -6,10 +6,10 @@ diff -Naur CMakeLists.txt.orig CMakeLists.txt # 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") ++ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20") else () - set (CMAKE_CXX_STANDARD 11) -+ set (CMAKE_CXX_STANDARD 17) ++ set (CMAKE_CXX_STANDARD 20) endif () ############ diff --git a/srcpkgs/calligra/patches/upstream_Fix-compile-with-poppler-2405-or-higher.patch b/srcpkgs/calligra/patches/upstream_Fix-compile-with-poppler-2405-or-higher.patch new file mode 100644 index 00000000000..66efc1a9b0f --- /dev/null +++ b/srcpkgs/calligra/patches/upstream_Fix-compile-with-poppler-2405-or-higher.patch @@ -0,0 +1,59 @@ +From 7ef44c6864cc77abb529e11f83e01ae7dc7d5061 Mon Sep 17 00:00:00 2001 +From: Heiko Becker +Date: Thu, 23 May 2024 22:11:28 +0200 +Subject: [PATCH] Require C++20 to fix the build with poppler>=24.05 + +poppler >= 24.05.0 started to use std::string's starts_with and +ends_with [1] in a public header, but these are only available with +C++20. + +[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/fbb64544e5ea25ac9b1bd25b48043d074efe9cd9 +--- + CMakeLists.txt | 2 +- + libs/pigment/lut.h | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +Origin: backport, https://github.com/KDE/calligra/commit/7ef44c6864cc77abb529e11f83e01ae7dc7d5061 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/calligra/+bug/2070399 +Last-Update: 2024-06-25 + +#--- a/CMakeLists.txt +#+++ b/CMakeLists.txt +#@@ -149,7 +149,7 @@ +# set(REQUIRED_KF5_VERSION "5.7.0") +# set(REQUIRED_QT_VERSION "5.3.0") +# +#-set(CMAKE_CXX_STANDARD 17) +#+set(CMAKE_CXX_STANDARD 20) +# set(CMAKE_CXX_STANDARD_REQUIRED ON) +# set(CMAKE_CXX_EXTENSIONS OFF) + +--- a/libs/pigment/lut.h ++++ b/libs/pigment/lut.h +@@ -143,7 +143,7 @@ + template<> \ + class LutKey<_INT_TYPE_> { \ + public: \ +- LutKey<_INT_TYPE_>(_INT_TYPE_ min, _INT_TYPE_ max) : m_min(min), m_max(max) \ ++ LutKey(_INT_TYPE_ min, _INT_TYPE_ max) : m_min(min), m_max(max) \ + { \ + } \ + public: \ +@@ -183,7 +183,7 @@ + template<> \ + class FullLutKey<_INT_TYPE_> { \ + public: \ +- FullLutKey<_INT_TYPE_>() \ ++ FullLutKey() \ + { \ + } \ + public: \ +@@ -233,7 +233,7 @@ + float f; + }; + public: +- LutKey(float min, float max, float precision) : m_min(min), m_max(max), m_precision(precision) ++ LutKey(float min, float max, float precision) : m_min(min), m_max(max), m_precision(precision) + { + // Those values where computed using the test_linear and setting the shift and then using + // the standard deviation. diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template index 43905e0bd6c..fadcbacfcd7 100644 --- a/srcpkgs/calligra/template +++ b/srcpkgs/calligra/template @@ -1,7 +1,7 @@ # Template file for 'calligra' pkgname=calligra version=3.2.1 -revision=23 +revision=24 build_style=cmake configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON -DMEINPROC5_EXECUTABLE=/usr/bin/meinproc5 -DBUILD_TESTING=OFF"