Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/
Date: Tue, 29 Mar 2022 10:51:17
Message-Id: 1648550312.a8ba387f91de80429faf70dbf3c29b908503e45f.asturm@gentoo
1 commit: a8ba387f91de80429faf70dbf3c29b908503e45f
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 29 10:37:07 2022 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 29 10:38:32 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=a8ba387f
7
8 kde-apps/okular: Rebase optional-options patch on top of 22.07.70
9
10 Reported-by: Duncan <1i5t5.duncan <AT> cox.net>
11 Closes: https://bugs.gentoo.org/836354
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 .../files/okular-22.07.70-optional-options.patch | 113 +++++++++++++++++++++
16 kde-apps/okular/okular-9999.ebuild | 2 +-
17 2 files changed, 114 insertions(+), 1 deletion(-)
18
19 diff --git a/kde-apps/okular/files/okular-22.07.70-optional-options.patch b/kde-apps/okular/files/okular-22.07.70-optional-options.patch
20 new file mode 100644
21 index 0000000000..6c83b03e06
22 --- /dev/null
23 +++ b/kde-apps/okular/files/okular-22.07.70-optional-options.patch
24 @@ -0,0 +1,113 @@
25 +From 86729e7698250dcb11ccbec0a6cc9690501ad691 Mon Sep 17 00:00:00 2001
26 +From: Andreas Sturmlechner <asturm@g.o>
27 +Date: Tue, 31 Aug 2021 16:48:42 +0200
28 +Subject: [PATCH] Make WITH_KWALLET and WITH_KJS proper cmake options
29 +
30 +Since I was asked to implement this, might as well make it real options,
31 +not just limited to ANDROID. Even though optional find_package() call is
32 +already being used for KF5Purpose as well.
33 +
34 +KF5DocTools is not made required more often than not.
35 +
36 +See also: https://invent.kde.org/graphics/okular/-/issues/61
37 +Downstream report: https://bugs.gentoo.org/810958
38 +
39 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
40 +---
41 + CMakeLists.txt | 21 ++++++++-------------
42 + config-okular.h.cmake | 6 ++++++
43 + core/generator.cpp | 1 +
44 + core/scripter.cpp | 1 +
45 + 4 files changed, 16 insertions(+), 13 deletions(-)
46 +
47 +diff --git a/CMakeLists.txt b/CMakeLists.txt
48 +index 43a45c7b9..57d0f6f74 100644
49 +--- a/CMakeLists.txt
50 ++++ b/CMakeLists.txt
51 +@@ -91,12 +91,9 @@ ecm_setup_qtplugin_macro_names(
52 + PACKAGE_SETUP_AUTOMOC_VARIABLES
53 + )
54 +
55 +-set(optionalComponents)
56 +-if (ANDROID)
57 +-# we want to make sure that generally all components are found
58 +-
59 +- set(optionalComponents "OPTIONAL_COMPONENTS")
60 +-endif()
61 ++# we want to make sure that generally all components are found
62 ++option(WITH_KWALLET "Build with desktop-wide storage for password support" ON)
63 ++option(WITH_KJS "Build with scripting support" ON)
64 +
65 + find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
66 + Archive
67 +@@ -111,21 +108,19 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
68 + TextWidgets
69 + ThreadWeaver
70 + WindowSystem
71 +- ${optionalComponents}
72 ++ OPTIONAL_COMPONENTS
73 + DocTools
74 +- JS
75 +- Wallet
76 + )
77 +
78 + if (BUILD_DESKTOP)
79 + find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash)
80 + endif()
81 +
82 +-if(KF5Wallet_FOUND)
83 +- add_definitions(-DWITH_KWALLET=1)
84 ++if(WITH_KWALLET)
85 ++ find_package(KF5Wallet ${KF5_REQUIRED_VERSION} REQUIRED)
86 + endif()
87 +-if(KF5JS_FOUND)
88 +- add_definitions(-DWITH_KJS=1)
89 ++if(WITH_KJS)
90 ++ find_package(KF5JS ${KF5_REQUIRED_VERSION} REQUIRED)
91 + endif()
92 +
93 + if(NOT WIN32 AND NOT ANDROID)
94 +diff --git a/config-okular.h.cmake b/config-okular.h.cmake
95 +index 905aac9cb..00e45f77c 100644
96 +--- a/config-okular.h.cmake
97 ++++ b/config-okular.h.cmake
98 +@@ -1,6 +1,12 @@
99 + /* Defines if force the use DRM in okular */
100 + #define OKULAR_FORCE_DRM ${_OKULAR_FORCE_DRM}
101 +
102 ++/* Defines if the KJS framework is available */
103 ++#cmakedefine WITH_KJS
104 ++
105 ++/* Defines if the kwallet framework is available */
106 ++#cmakedefine WITH_KWALLET
107 ++
108 + /* Defines if the purpose framework is available */
109 + #define PURPOSE_FOUND ${PURPOSE_FOUND}
110 +
111 +diff --git a/core/generator.cpp b/core/generator.cpp
112 +index 8360bb32b..0871c17ee 100644
113 +--- a/core/generator.cpp
114 ++++ b/core/generator.cpp
115 +@@ -9,6 +9,7 @@
116 + */
117 +
118 + #include "generator.h"
119 ++#include "config-okular.h"
120 + #include "generator_p.h"
121 + #include "observer.h"
122 +
123 +diff --git a/core/scripter.cpp b/core/scripter.cpp
124 +index c60645895..2e6eacc72 100644
125 +--- a/core/scripter.cpp
126 ++++ b/core/scripter.cpp
127 +@@ -5,6 +5,7 @@
128 + */
129 +
130 + #include "scripter.h"
131 ++#include "config-okular.h"
132 +
133 + #include <QDebug>
134 + #include <QFile>
135 +--
136 +2.35.1
137 +
138
139 diff --git a/kde-apps/okular/okular-9999.ebuild b/kde-apps/okular/okular-9999.ebuild
140 index 3f35e47237..d60b536522 100644
141 --- a/kde-apps/okular/okular-9999.ebuild
142 +++ b/kde-apps/okular/okular-9999.ebuild
143 @@ -70,7 +70,7 @@ RDEPEND="${DEPEND}
144 PATCHES=(
145 "${FILESDIR}/${PN}-21.11.80-tests.patch" # bug 734138
146 "${FILESDIR}/${PN}-20.08.2-hide-mobile-app.patch" # avoid same-name entry
147 - "${FILESDIR}/${PN}-22.03.70-optional-options.patch" # bug 810958
148 + "${FILESDIR}/${PN}-22.07.70-optional-options.patch" # bug 810958
149 )
150
151 src_configure() {