commit:     a8ba387f91de80429faf70dbf3c29b908503e45f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 29 10:37:07 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Mar 29 10:38:32 2022 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=a8ba387f

kde-apps/okular: Rebase optional-options patch on top of 22.07.70

Reported-by: Duncan <1i5t5.duncan <AT> cox.net>
Closes: https://bugs.gentoo.org/836354
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/okular-22.07.70-optional-options.patch   | 113 +++++++++++++++++++++
 kde-apps/okular/okular-9999.ebuild                 |   2 +-
 2 files changed, 114 insertions(+), 1 deletion(-)

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
new file mode 100644
index 0000000000..6c83b03e06
--- /dev/null
+++ b/kde-apps/okular/files/okular-22.07.70-optional-options.patch
@@ -0,0 +1,113 @@
+From 86729e7698250dcb11ccbec0a6cc9690501ad691 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Tue, 31 Aug 2021 16:48:42 +0200
+Subject: [PATCH] Make WITH_KWALLET and WITH_KJS proper cmake options
+
+Since I was asked to implement this, might as well make it real options,
+not just limited to ANDROID. Even though optional find_package() call is
+already being used for KF5Purpose as well.
+
+KF5DocTools is not made required more often than not.
+
+See also: https://invent.kde.org/graphics/okular/-/issues/61
+Downstream report: https://bugs.gentoo.org/810958
+
+Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org>
+---
+ CMakeLists.txt        | 21 ++++++++-------------
+ config-okular.h.cmake |  6 ++++++
+ core/generator.cpp    |  1 +
+ core/scripter.cpp     |  1 +
+ 4 files changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 43a45c7b9..57d0f6f74 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,12 +91,9 @@ ecm_setup_qtplugin_macro_names(
+         PACKAGE_SETUP_AUTOMOC_VARIABLES
+ )
+ 
+-set(optionalComponents)
+-if (ANDROID)
+-#   we want to make sure that generally all components are found
+-
+-    set(optionalComponents "OPTIONAL_COMPONENTS")
+-endif()
++# we want to make sure that generally all components are found
++option(WITH_KWALLET "Build with desktop-wide storage for password support" ON)
++option(WITH_KJS "Build with scripting support" ON)
+ 
+ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
+     Archive
+@@ -111,21 +108,19 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED 
COMPONENTS
+     TextWidgets
+     ThreadWeaver
+     WindowSystem
+-    ${optionalComponents}
++    OPTIONAL_COMPONENTS
+     DocTools
+-    JS
+-    Wallet
+ )
+ 
+ if (BUILD_DESKTOP)
+     find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash)
+ endif()
+ 
+-if(KF5Wallet_FOUND)
+-    add_definitions(-DWITH_KWALLET=1)
++if(WITH_KWALLET)
++    find_package(KF5Wallet ${KF5_REQUIRED_VERSION} REQUIRED)
+ endif()
+-if(KF5JS_FOUND)
+-    add_definitions(-DWITH_KJS=1)
++if(WITH_KJS)
++    find_package(KF5JS ${KF5_REQUIRED_VERSION} REQUIRED)
+ endif()
+ 
+ if(NOT WIN32 AND NOT ANDROID)
+diff --git a/config-okular.h.cmake b/config-okular.h.cmake
+index 905aac9cb..00e45f77c 100644
+--- a/config-okular.h.cmake
++++ b/config-okular.h.cmake
+@@ -1,6 +1,12 @@
+ /* Defines if force the use DRM in okular */
+ #define OKULAR_FORCE_DRM ${_OKULAR_FORCE_DRM}
+ 
++/* Defines if the KJS framework is available */
++#cmakedefine WITH_KJS
++
++/* Defines if the kwallet framework is available */
++#cmakedefine WITH_KWALLET
++
+ /* Defines if the purpose framework is available */
+ #define PURPOSE_FOUND ${PURPOSE_FOUND}
+ 
+diff --git a/core/generator.cpp b/core/generator.cpp
+index 8360bb32b..0871c17ee 100644
+--- a/core/generator.cpp
++++ b/core/generator.cpp
+@@ -9,6 +9,7 @@
+ */
+ 
+ #include "generator.h"
++#include "config-okular.h"
+ #include "generator_p.h"
+ #include "observer.h"
+ 
+diff --git a/core/scripter.cpp b/core/scripter.cpp
+index c60645895..2e6eacc72 100644
+--- a/core/scripter.cpp
++++ b/core/scripter.cpp
+@@ -5,6 +5,7 @@
+ */
+ 
+ #include "scripter.h"
++#include "config-okular.h"
+ 
+ #include <QDebug>
+ #include <QFile>
+-- 
+2.35.1
+

diff --git a/kde-apps/okular/okular-9999.ebuild 
b/kde-apps/okular/okular-9999.ebuild
index 3f35e47237..d60b536522 100644
--- a/kde-apps/okular/okular-9999.ebuild
+++ b/kde-apps/okular/okular-9999.ebuild
@@ -70,7 +70,7 @@ RDEPEND="${DEPEND}
 PATCHES=(
        "${FILESDIR}/${PN}-21.11.80-tests.patch" # bug 734138
        "${FILESDIR}/${PN}-20.08.2-hide-mobile-app.patch" # avoid same-name 
entry
-       "${FILESDIR}/${PN}-22.03.70-optional-options.patch" # bug 810958
+       "${FILESDIR}/${PN}-22.07.70-optional-options.patch" # bug 810958
 )
 
 src_configure() {

Reply via email to