[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2024-04-28 Thread Andreas Sturmlechner
commit: 1c9fe9b96f7e510523bf915a45567ec2a80320f8
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Sun Apr 28 12:04:46 2024 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sun Apr 28 12:07:36 2024 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=1c9fe9b9

kde-apps/okular: Rebase tests.patch on top of (24.05) HEAD

Signed-off-by: Andreas Sturmlechner  gentoo.org>

 kde-apps/okular/files/okular-21.11.80-tests.patch | 101 --
 kde-apps/okular/files/okular-24.01.80-tests.patch |  98 -
 kde-apps/okular/files/okular-24.04.80-tests.patch |  46 ++
 kde-apps/okular/okular-24.05.49..ebuild   |   2 +-
 kde-apps/okular/okular-.ebuild|   2 +-
 5 files changed, 48 insertions(+), 201 deletions(-)

diff --git a/kde-apps/okular/files/okular-21.11.80-tests.patch 
b/kde-apps/okular/files/okular-21.11.80-tests.patch
deleted file mode 100644
index a0babcad1c..00
--- a/kde-apps/okular/files/okular-21.11.80-tests.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 323fed918995fe2e01036c74c1498446b4d2f122 Mon Sep 17 00:00:00 2001
-From: Andreas Sturmlechner 
-Date: Thu, 12 Oct 2017 14:09:09 +0200
-Subject: [PATCH] Move tests into existing (auto)tests subdirectories
-

- generators/chm/CMakeLists.txt | 12 +++-
- generators/chm/autotests/CMakeLists.txt   |  8 
- generators/chm/autotests/chmgeneratortest.cpp |  2 +-
- generators/comicbook/CMakeLists.txt   | 10 +++---
- generators/comicbook/autotests/CMakeLists.txt |  6 ++
- 8 files changed, 27 insertions(+), 18 deletions(-)
- create mode 100644 generators/chm/autotests/CMakeLists.txt
- create mode 100644 generators/comicbook/autotests/CMakeLists.txt
-
-diff --git a/generators/chm/CMakeLists.txt b/generators/chm/CMakeLists.txt
-index 0d7452cba..3adb3fd54 100644
 a/generators/chm/CMakeLists.txt
-+++ b/generators/chm/CMakeLists.txt
-@@ -23,15 +23,9 @@ okular_add_generator(okularGenerator_chmlib 
${okularGenerator_chmlib_SRCS})
- target_include_directories(okularGenerator_chmlib PRIVATE ${CHM_INCLUDE_DIR} 
${LIBZIP_INCLUDE_DIR})
- target_link_libraries(okularGenerator_chmlib  okularcore ${CHM_LIBRARY} 
${LIBZIP_LIBRARY} KF5::KHtml)
- 
--### autotests ###
--
--add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
--ecm_add_test(autotests/chmgeneratortest.cpp
--TEST_NAME "chmgeneratortest"
--LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
--)
--
--target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
-+if(BUILD_TESTING)
-+   add_subdirectory(autotests)
-+endif()
- 
- ### install files ###
- install( FILES okularChm.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
-diff --git a/generators/chm/autotests/CMakeLists.txt 
b/generators/chm/autotests/CMakeLists.txt
-new file mode 100644
-index 0..59753ca45
 /dev/null
-+++ b/generators/chm/autotests/CMakeLists.txt
-@@ -0,0 +1,8 @@
-+add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/../" )
-+
-+ecm_add_test(chmgeneratortest.cpp
-+TEST_NAME "chmgeneratortest"
-+LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
-+)
-+
-+target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
-diff --git a/generators/chm/autotests/chmgeneratortest.cpp 
b/generators/chm/autotests/chmgeneratortest.cpp
-index c428fa1b3..68f7a5821 100644
 a/generators/chm/autotests/chmgeneratortest.cpp
-+++ b/generators/chm/autotests/chmgeneratortest.cpp
-@@ -30,7 +30,7 @@ void ChmGeneratorTest::initTestCase()
- {
- Okular::SettingsCore::instance(QStringLiteral("ChmGeneratorTest"));
- m_document = new Okular::Document(nullptr);
--const QString testFile = QStringLiteral(KDESRCDIR 
"autotests/data/test.chm");
-+const QString testFile = QStringLiteral(KDESRCDIR "data/test.chm");
- QMimeDatabase db;
- const QMimeType mime = db.mimeTypeForFile(testFile);
- QCOMPARE(m_document->openDocument(testFile, QUrl(), mime), 
Okular::Document::OpenSuccess);
-diff --git a/generators/comicbook/CMakeLists.txt 
b/generators/comicbook/CMakeLists.txt
-index a0e7569a2..91bcc6ec7 100644
 a/generators/comicbook/CMakeLists.txt
-+++ b/generators/comicbook/CMakeLists.txt
-@@ -25,13 +25,9 @@ if (KArchive_HAVE_LZMA)
- target_compile_definitions(okular_comicbook PRIVATE -DWITH_K7ZIP=1)
- endif()
- 
--### autotests ###
--
--add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
--ecm_add_test(autotests/comicbooktest.cpp
--TEST_NAME "comicbooktest"
--LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore okular_comicbook
--)
-+if(BUILD_TESTING)
-+add_subdirectory(autotests)
-+endif()
- 
- ### install files ###
- install( FILES okularComicbook.desktop  DESTINATION  
${KDE_INSTALL_KSERVICES5DIR} )
-diff --git a/generators/comicbook/autotests/CMakeLists.txt 
b/generators/comicbook/autotests/CMakeLists.txt
-new file 

[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2024-01-15 Thread Andreas Sturmlechner
commit: 65a0068393f38c2c474e3a2ba040601c6bb56d86
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Mon Jan 15 20:38:56 2024 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Mon Jan 15 20:38:56 2024 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=65a00683

kde-apps/okular: Backport fixes by upstream request

See also: https://mail.kde.org/pipermail/distributions/2024-January/001476.html

Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../files/okular-24.01.90-fix-compile-path.patch   | 25 +++
 .../okular-24.01.90-fix-loading-okularpart.patch   | 28 ++
 kde-apps/okular/okular-24.01.90.ebuild |  2 ++
 3 files changed, 55 insertions(+)

diff --git a/kde-apps/okular/files/okular-24.01.90-fix-compile-path.patch 
b/kde-apps/okular/files/okular-24.01.90-fix-compile-path.patch
new file mode 100644
index 00..ef5b7e9c13
--- /dev/null
+++ b/kde-apps/okular/files/okular-24.01.90-fix-compile-path.patch
@@ -0,0 +1,25 @@
+From 7aac8a4f9aa8f1c296f6f5c3e68d0404e3925913 Mon Sep 17 00:00:00 2001
+From: Sune Vuorela 
+Date: Fri, 12 Jan 2024 09:43:16 +0100
+Subject: [PATCH] Also fix compile path
+
+(cherry picked from commit 478f6f24fbde4657b7bd13dbc4a58512cbd6eb2a)
+---
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9cb9851731..0a56d74b5d 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -615,6 +615,7 @@ if (KF6Purpose_FOUND)
+ endif()
+ 
+ set_target_properties(okularpart PROPERTIES PREFIX "")
++set_target_properties(okularpart PROPERTIES LIBRARY_OUTPUT_DIRECTORY 
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/kf6/parts)
+ 
+ if (Qt6TextToSpeech_FOUND)
+target_link_libraries(okularpart Qt6::TextToSpeech)
+-- 
+GitLab
+

diff --git a/kde-apps/okular/files/okular-24.01.90-fix-loading-okularpart.patch 
b/kde-apps/okular/files/okular-24.01.90-fix-loading-okularpart.patch
new file mode 100644
index 00..41c1ad3225
--- /dev/null
+++ b/kde-apps/okular/files/okular-24.01.90-fix-loading-okularpart.patch
@@ -0,0 +1,28 @@
+From f23a2448b00e1aa83158bfdb66a1f981afe61938 Mon Sep 17 00:00:00 2001
+From: Nicolas Fella 
+Date: Fri, 12 Jan 2024 01:02:46 +0100
+Subject: [PATCH] Fix loading okularpart
+
+Adapt to the new location
+
+(cherry picked from commit 53fb06d6b4a931b87364a87fcced459b5824b678)
+---
+ shell/shell.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/shell/shell.cpp b/shell/shell.cpp
+index 0a006d5cad..9074a16037 100644
+--- a/shell/shell.cpp
 b/shell/shell.cpp
+@@ -201,7 +201,7 @@ Shell::Shell(const QString )
+ // name which is a bad idea usually.. but it's alright in this
+ // case since our Part is made for this Shell
+ 
+-const auto result = 
KPluginFactory::loadFactory(KPluginMetaData(QStringLiteral("okularpart")));
++const auto result = 
KPluginFactory::loadFactory(KPluginMetaData(QStringLiteral("kf6/parts/okularpart")));
+ 
+ if (!result) {
+ // if we couldn't find our Part, we exit since the Shell by
+-- 
+GitLab
+

diff --git a/kde-apps/okular/okular-24.01.90.ebuild 
b/kde-apps/okular/okular-24.01.90.ebuild
index 80a7303bfa..dfc297c282 100644
--- a/kde-apps/okular/okular-24.01.90.ebuild
+++ b/kde-apps/okular/okular-24.01.90.ebuild
@@ -61,6 +61,8 @@ RDEPEND="${DEPEND}
 PATCHES=(
"${FILESDIR}/${PN}-24.01.80-tests.patch" # bug 734138
"${FILESDIR}/${PN}-20.08.2-hide-mobile-app.patch" # avoid same-name 
entry
+   "${FILESDIR}/${P}-fix-compile-path.patch"
+   "${FILESDIR}/${P}-fix-loading-okularpart.patch"
 )
 
 src_configure() {



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2023-02-18 Thread Andreas Sturmlechner
commit: 17779f193a38b948016c25d3987e6cb66406a0f7
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Sat Feb 18 10:44:02 2023 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sat Feb 18 10:45:02 2023 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=17779f19

kde-apps/okular: Fix build with >=app-text/discount-3

Bug: https://bugs.gentoo.org/892633
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../okular/files/okular-22.12.2-discount-3.patch   | 47 ++
 kde-apps/okular/okular-22.12.49..ebuild|  1 +
 2 files changed, 48 insertions(+)

diff --git a/kde-apps/okular/files/okular-22.12.2-discount-3.patch 
b/kde-apps/okular/files/okular-22.12.2-discount-3.patch
new file mode 100644
index 00..e9fef2679a
--- /dev/null
+++ b/kde-apps/okular/files/okular-22.12.2-discount-3.patch
@@ -0,0 +1,47 @@
+From f1f638c2c51a6ef699dee22f6e90aff67beff8ec Mon Sep 17 00:00:00 2001
+From: Albert Astals Cid 
+Date: Wed, 1 Feb 2023 22:01:52 +0100
+Subject: [PATCH] Compile with discount 3
+
+---
+ generators/markdown/converter.cpp | 17 +
+ 1 file changed, 17 insertions(+)
+
+diff --git a/generators/markdown/converter.cpp 
b/generators/markdown/converter.cpp
+index 20d3c725f..3c8546b32 100644
+--- a/generators/markdown/converter.cpp
 b/generators/markdown/converter.cpp
+@@ -93,6 +93,8 @@ QTextDocument *Converter::convertOpenFile()
+ {
+ rewind(m_markdownFile);
+ 
++#if defined(MKD_NOLINKS)
++// on discount 2 MKD_NOLINKS is a define
+ MMIOT *markdownHandle = mkd_in(m_markdownFile, 0);
+ 
+ int flags = MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK | MKD_TOC | 
MKD_IDANCHOR;
+@@ -103,6 +105,21 @@ QTextDocument *Converter::convertOpenFile()
+ Q_EMIT error(i18n("Failed to compile the Markdown document."), -1);
+ return nullptr;
+ }
++#else
++// on discount 3 MKD_NOLINKS is an enum value
++MMIOT *markdownHandle = mkd_in(m_markdownFile, nullptr);
++
++mkd_flag_t *flags = mkd_flags();
++mkd_set_flag_bitmap(flags, MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK 
| MKD_TOC | MKD_IDANCHOR);
++if (!m_isFancyPantsEnabled) {
++mkd_set_flag_num(flags, MKD_NOPANTS);
++}
++if (!mkd_compile(markdownHandle, flags)) {
++Q_EMIT error(i18n("Failed to compile the Markdown document."), -1);
++return nullptr;
++}
++mkd_free_flags(flags);
++#endif
+ 
+ char *htmlDocument;
+ const int size = mkd_document(markdownHandle, );
+-- 
+GitLab
+

diff --git a/kde-apps/okular/okular-22.12.49..ebuild 
b/kde-apps/okular/okular-22.12.49..ebuild
index b6cf9d81ad..0b3822df4d 100644
--- a/kde-apps/okular/okular-22.12.49..ebuild
+++ b/kde-apps/okular/okular-22.12.49..ebuild
@@ -72,6 +72,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.12.2-discount-3.patch" # bug 892633
 )
 
 src_configure() {



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2022-03-29 Thread Andreas Sturmlechner
commit: a8ba387f91de80429faf70dbf3c29b908503e45f
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Tue Mar 29 10:37:07 2022 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Tue Mar 29 10:38:32 2022 +
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  cox.net>
Closes: https://bugs.gentoo.org/836354
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../files/okular-22.07.70-optional-options.patch   | 113 +
 kde-apps/okular/okular-.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 00..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 
+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 
+---
+ 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 
+ #include 
+-- 
+2.35.1
+

diff --git a/kde-apps/okular/okular-.ebuild 
b/kde-apps/okular/okular-.ebuild
index 3f35e47237..d60b536522 100644
--- a/kde-apps/okular/okular-.ebuild
+++ b/kde-apps/okular/okular-.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() {



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2021-12-20 Thread Andreas Sturmlechner
commit: 704b823c4258625299e78feba50b48112f9532a2
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Mon Dec 20 15:40:21 2021 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Mon Dec 20 15:40:21 2021 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=704b823c

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

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

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

diff --git a/kde-apps/okular/files/okular-22.03.70-optional-options.patch 
b/kde-apps/okular/files/okular-22.03.70-optional-options.patch
new file mode 100644
index 00..d2a0217fba
--- /dev/null
+++ b/kde-apps/okular/files/okular-22.03.70-optional-options.patch
@@ -0,0 +1,113 @@
+From 8abc1c2090fc5474ef2f21c9ef9bbea2e76578b5 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner 
+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 
+---
+ 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 990be62fd..21cdbd9b8 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -84,12 +84,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
+@@ -105,21 +102,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)
+ 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 051c2c922..0b60516b8 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 
+ #include 
+-- 
+2.34.1
+

diff --git a/kde-apps/okular/okular-.ebuild 
b/kde-apps/okular/okular-.ebuild
index 3d1fd5166c..445e7a806f 100644
--- a/kde-apps/okular/okular-.ebuild
+++ b/kde-apps/okular/okular-.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}-21.08.1-optional-options.patch" # bug 810958
+   "${FILESDIR}/${PN}-22.03.70-optional-options.patch" # bug 810958
 )
 
 src_configure() {



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2021-08-22 Thread Andreas Sturmlechner
commit: 6bf3ae87c13a3c61097fa1c4c4be36e8fa764d7a
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Sun Aug 22 23:02:21 2021 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sun Aug 22 23:02:21 2021 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=6bf3ae87

kde-apps/okular: Rebase okular-20.11.90-tests.patch on top of HEAD

Reported-by: jospezial  gmx.de>
Closes: https://bugs.gentoo.org/809674
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 kde-apps/okular/files/okular-21.11.80-tests.patch | 145 ++
 kde-apps/okular/okular-.ebuild|   2 +-
 2 files changed, 146 insertions(+), 1 deletion(-)

diff --git a/kde-apps/okular/files/okular-21.11.80-tests.patch 
b/kde-apps/okular/files/okular-21.11.80-tests.patch
new file mode 100644
index 00..683a07bc1a
--- /dev/null
+++ b/kde-apps/okular/files/okular-21.11.80-tests.patch
@@ -0,0 +1,145 @@
+From 323fed918995fe2e01036c74c1498446b4d2f122 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner 
+Date: Thu, 12 Oct 2017 14:09:09 +0200
+Subject: [PATCH] Move tests into existing (auto)tests subdirectories
+
+---
+ generators/chm/CMakeLists.txt | 12 +++-
+ generators/chm/autotests/CMakeLists.txt   |  8 
+ generators/chm/autotests/chmgeneratortest.cpp |  2 +-
+ generators/comicbook/CMakeLists.txt   | 10 +++---
+ generators/comicbook/autotests/CMakeLists.txt |  6 ++
+ generators/kimgio/CMakeLists.txt  |  5 +
+ generators/kimgio/tests/CMakeLists.txt|  5 +
+ generators/kimgio/tests/kimgiotest.cpp|  2 +-
+ 8 files changed, 28 insertions(+), 22 deletions(-)
+ create mode 100644 generators/chm/autotests/CMakeLists.txt
+ create mode 100644 generators/comicbook/autotests/CMakeLists.txt
+ create mode 100644 generators/kimgio/tests/CMakeLists.txt
+
+diff --git a/generators/chm/CMakeLists.txt b/generators/chm/CMakeLists.txt
+index 0d7452cba..3adb3fd54 100644
+--- a/generators/chm/CMakeLists.txt
 b/generators/chm/CMakeLists.txt
+@@ -23,15 +23,9 @@ okular_add_generator(okularGenerator_chmlib 
${okularGenerator_chmlib_SRCS})
+ target_include_directories(okularGenerator_chmlib PRIVATE ${CHM_INCLUDE_DIR} 
${LIBZIP_INCLUDE_DIR})
+ target_link_libraries(okularGenerator_chmlib  okularcore ${CHM_LIBRARY} 
${LIBZIP_LIBRARY} KF5::KHtml)
+ 
+-### autotests ###
+-
+-add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
+-ecm_add_test(autotests/chmgeneratortest.cpp
+-TEST_NAME "chmgeneratortest"
+-LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
+-)
+-
+-target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
++if(BUILD_TESTING)
++   add_subdirectory(autotests)
++endif()
+ 
+ ### install files ###
+ install( FILES okularChm.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
+diff --git a/generators/chm/autotests/CMakeLists.txt 
b/generators/chm/autotests/CMakeLists.txt
+new file mode 100644
+index 0..59753ca45
+--- /dev/null
 b/generators/chm/autotests/CMakeLists.txt
+@@ -0,0 +1,8 @@
++add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/../" )
++
++ecm_add_test(chmgeneratortest.cpp
++TEST_NAME "chmgeneratortest"
++LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
++)
++
++target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
+diff --git a/generators/chm/autotests/chmgeneratortest.cpp 
b/generators/chm/autotests/chmgeneratortest.cpp
+index c428fa1b3..68f7a5821 100644
+--- a/generators/chm/autotests/chmgeneratortest.cpp
 b/generators/chm/autotests/chmgeneratortest.cpp
+@@ -30,7 +30,7 @@ void ChmGeneratorTest::initTestCase()
+ {
+ Okular::SettingsCore::instance(QStringLiteral("ChmGeneratorTest"));
+ m_document = new Okular::Document(nullptr);
+-const QString testFile = QStringLiteral(KDESRCDIR 
"autotests/data/test.chm");
++const QString testFile = QStringLiteral(KDESRCDIR "data/test.chm");
+ QMimeDatabase db;
+ const QMimeType mime = db.mimeTypeForFile(testFile);
+ QCOMPARE(m_document->openDocument(testFile, QUrl(), mime), 
Okular::Document::OpenSuccess);
+diff --git a/generators/comicbook/CMakeLists.txt 
b/generators/comicbook/CMakeLists.txt
+index a0e7569a2..91bcc6ec7 100644
+--- a/generators/comicbook/CMakeLists.txt
 b/generators/comicbook/CMakeLists.txt
+@@ -25,13 +25,9 @@ if (KArchive_HAVE_LZMA)
+ target_compile_definitions(okular_comicbook PRIVATE -DWITH_K7ZIP=1)
+ endif()
+ 
+-### autotests ###
+-
+-add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
+-ecm_add_test(autotests/comicbooktest.cpp
+-TEST_NAME "comicbooktest"
+-LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore okular_comicbook
+-)
++if(BUILD_TESTING)
++add_subdirectory(autotests)
++endif()
+ 
+ ### install files ###
+ install( FILES okularComicbook.desktop  DESTINATION  

[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2020-02-22 Thread Andreas Sturmlechner
commit: fdc82bc0a9bbfdea673c0f05b3aa2f49971e0b32
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Sat Feb 22 19:42:28 2020 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sat Feb 22 19:42:28 2020 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=fdc82bc0

kde-apps/okular: Rebase okular-18.08.0-tests.patch on top of HEAD

Closes: https://bugs.gentoo.org/710504
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../files/{okular-18.08.0-tests.patch => okular-20.03.70-tests.patch}   | 2 +-
 kde-apps/okular/okular-.ebuild  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kde-apps/okular/files/okular-18.08.0-tests.patch 
b/kde-apps/okular/files/okular-20.03.70-tests.patch
similarity index 99%
rename from kde-apps/okular/files/okular-18.08.0-tests.patch
rename to kde-apps/okular/files/okular-20.03.70-tests.patch
index 0e2cdaecd4..db7ec3993d 100644
--- a/kde-apps/okular/files/okular-18.08.0-tests.patch
+++ b/kde-apps/okular/files/okular-20.03.70-tests.patch
@@ -58,7 +58,7 @@ index 6b0b8efc7..25fd6631a 100644
 @@ -34,7 +34,7 @@ void ChmGeneratorTest::initTestCase()
  {
  Okular::SettingsCore::instance( QStringLiteral("ChmGeneratorTest") );
- m_document = new Okular::Document( 0 );
+ m_document = new Okular::Document( nullptr );
 -const QString testFile = QStringLiteral(KDESRCDIR 
"autotests/data/test.chm");
 +const QString testFile = QStringLiteral(KDESRCDIR "data/test.chm");
  QMimeDatabase db;

diff --git a/kde-apps/okular/okular-.ebuild 
b/kde-apps/okular/okular-.ebuild
index 46ea6f8a8e..101fb3c1aa 100644
--- a/kde-apps/okular/okular-.ebuild
+++ b/kde-apps/okular/okular-.ebuild
@@ -71,8 +71,8 @@ RDEPEND="${DEPEND}
 "
 
 PATCHES=(
-   "${FILESDIR}/${PN}-18.08.0-tests.patch"
"${FILESDIR}/${PN}-18.12.0-tests.patch"
+   "${FILESDIR}/${PN}-20.03.70-tests.patch"
 )
 
 src_prepare() {



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2017-10-12 Thread Andreas Sturmlechner
commit: bc86010e82d00b9edf763f43c1b043feb0aa88ca
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Thu Oct 12 13:40:59 2017 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Thu Oct 12 13:44:32 2017 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=bc86010e

kde-apps/okular: Fix build with USE=chm

Reported-by: Eugene Shalygin  gmail.com>
Gentoo-bug: 627448
Package-Manager: Portage-2.3.11, Repoman-2.3.3

 kde-apps/okular/files/okular-tests.patch | 112 +++
 kde-apps/okular/okular-.ebuild   |  12 +++-
 2 files changed, 122 insertions(+), 2 deletions(-)

diff --git a/kde-apps/okular/files/okular-tests.patch 
b/kde-apps/okular/files/okular-tests.patch
new file mode 100644
index 00..0e2cdaecd4
--- /dev/null
+++ b/kde-apps/okular/files/okular-tests.patch
@@ -0,0 +1,112 @@
+From 5f093fa9798ad30cda115cea573d18296696a0a9 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner 
+Date: Thu, 12 Oct 2017 14:09:09 +0200
+Subject: [PATCH] Move tests into existing (auto)tests subdirectories
+
+---
+ generators/chm/CMakeLists.txt | 12 +++-
+ generators/chm/autotests/CMakeLists.txt   |  8 
+ generators/chm/autotests/chmgeneratortest.cpp |  2 +-
+ generators/kimgio/CMakeLists.txt  |  6 +-
+ generators/kimgio/tests/CMakeLists.txt|  5 +
+ generators/kimgio/tests/kimgiotest.cpp|  2 +-
+ 6 files changed, 19 insertions(+), 16 deletions(-)
+ create mode 100644 generators/chm/autotests/CMakeLists.txt
+ create mode 100644 generators/kimgio/tests/CMakeLists.txt
+
+diff --git a/generators/chm/CMakeLists.txt b/generators/chm/CMakeLists.txt
+index 9d82b9394..b3a33afe4 100644
+--- a/generators/chm/CMakeLists.txt
 b/generators/chm/CMakeLists.txt
+@@ -30,15 +30,9 @@ set(okularGenerator_chmlib_SRCS
+ okular_add_generator(okularGenerator_chmlib ${okularGenerator_chmlib_SRCS})
+ target_link_libraries(okularGenerator_chmlib  okularcore ${CHM_LIBRARY} 
${LIBZIP_LIBRARY} KF5::KHtml)
+ 
+-### autotests ###
+-
+-add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
+-ecm_add_test(autotests/chmgeneratortest.cpp
+-TEST_NAME "chmgeneratortest"
+-LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
+-)
+-
+-target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
++if(BUILD_TESTING)
++   add_subdirectory(autotests)
++endif()
+ 
+ ### install files ###
+ install( FILES okularChm.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
+diff --git a/generators/chm/autotests/CMakeLists.txt 
b/generators/chm/autotests/CMakeLists.txt
+new file mode 100644
+index 0..59753ca45
+--- /dev/null
 b/generators/chm/autotests/CMakeLists.txt
+@@ -0,0 +1,8 @@
++add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/../" )
++
++ecm_add_test(chmgeneratortest.cpp
++TEST_NAME "chmgeneratortest"
++LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore
++)
++
++target_compile_definitions(chmgeneratortest PRIVATE 
-DGENERATOR_PATH="$")
+diff --git a/generators/chm/autotests/chmgeneratortest.cpp 
b/generators/chm/autotests/chmgeneratortest.cpp
+index 6b0b8efc7..25fd6631a 100644
+--- a/generators/chm/autotests/chmgeneratortest.cpp
 b/generators/chm/autotests/chmgeneratortest.cpp
+@@ -34,7 +34,7 @@ void ChmGeneratorTest::initTestCase()
+ {
+ Okular::SettingsCore::instance( QStringLiteral("ChmGeneratorTest") );
+ m_document = new Okular::Document( 0 );
+-const QString testFile = QStringLiteral(KDESRCDIR 
"autotests/data/test.chm");
++const QString testFile = QStringLiteral(KDESRCDIR "data/test.chm");
+ QMimeDatabase db;
+ const QMimeType mime = db.mimeTypeForFile( testFile );
+ QCOMPARE( m_document->openDocument(testFile, QUrl(), mime), 
Okular::Document::OpenSuccess );
+diff --git a/generators/kimgio/CMakeLists.txt 
b/generators/kimgio/CMakeLists.txt
+index b8cac76df..49f893bc1 100644
+--- a/generators/kimgio/CMakeLists.txt
 b/generators/kimgio/CMakeLists.txt
+@@ -13,13 +13,9 @@ okular_add_generator(okularGenerator_kimgio 
generator_kimgio.cpp)
+ target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::I18n)
+ 
+ if(BUILD_TESTING)
+-add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
+-set( kimgiotest_SRCS tests/kimgiotest.cpp 
${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp 
${CMAKE_SOURCE_DIR}/ui/debug_ui.cpp )
+-ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES 
okularcore okularpart Qt5::Svg Qt5::Test)
+-target_compile_definitions(kimgiotest PRIVATE 
-DGENERATOR_PATH="$")
++   add_subdirectory(tests)
+ endif()
+ 
+-
+ ### install files ###
+ install( FILES okularKimgio.desktop  DESTINATION  
${KDE_INSTALL_KSERVICES5DIR} )
+ install( PROGRAMS okularApplication_kimgio.desktop 
org.kde.mobile.okular_kimgio.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )

[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2015-04-16 Thread Michael Palimaka
commit: e94bc0a13ca9dde47fa0d4348e7a9de174fded27
Author: Michael Palimaka kensington AT gentoo DOT org
AuthorDate: Thu Apr 16 17:48:07 2015 +
Commit: Michael Palimaka kensington AT gentoo DOT org
CommitDate: Thu Apr 16 17:48:07 2015 +
URL:https://gitweb.gentoo.org/proj/kde.git/commit/?id=e94bc0a1

[kde-apps/okular] Punt bogus deps wrt bug #546118.

Package-Manager: portage-2.2.18

 .../okular/files/okular-5.-tests-optional.patch | 21 -
 kde-apps/okular/okular-5..ebuild|  8 +---
 2 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/kde-apps/okular/files/okular-5.-tests-optional.patch 
b/kde-apps/okular/files/okular-5.-tests-optional.patch
deleted file mode 100644
index 309c092..000
--- a/kde-apps/okular/files/okular-5.-tests-optional.patch
+++ /dev/null
@@ -1,21 +0,0 @@
 a/CMakeLists.txt   2015-02-23 23:12:24.420881583 +0100
-+++ b/CMakeLists.txt   2015-02-23 23:17:07.173858317 +0100
-@@ -18,7 +18,17 @@
- include(ECMAddTests)
- 
- 
--find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Test Widgets 
PrintSupport Svg Qml Quick)
-+find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Widgets PrintSupport 
Svg Qml Quick)
-+
-+find_package(Qt5Test CONFIG QUIET)
-+set_package_properties(Qt5Test PROPERTIES
-+PURPOSE Required for tests
-+TYPE OPTIONAL)
-+add_feature_info(Qt5Test Qt5Test_FOUND Required for building tests)
-+if (NOT Qt5Test_FOUND)
-+set(BUILD_TESTING OFF CACHE BOOL Build the testing tree.)
-+endif()
-+
- find_package(Qt5 OPTIONAL_COMPONENTS TextToSpeech)
- if (NOT Qt5TextToSpeech_FOUND)
- message(STATUS Qt5TextToSpeech not found, speech features will be 
disabled)

diff --git a/kde-apps/okular/okular-5..ebuild 
b/kde-apps/okular/okular-5..ebuild
index e898d1c..24767e2 100644
--- a/kde-apps/okular/okular-5..ebuild
+++ b/kde-apps/okular/okular-5..ebuild
@@ -5,6 +5,7 @@
 EAPI=5
 
 KDE_HANDBOOK=true
+KDE_PUNT_BOGUS_DEPS=true
 EGIT_BRANCH=frameworks
 inherit kde5
 
@@ -59,13 +60,6 @@ RDEPEND=${DEPEND}
 RESTRICT=test
 # test 2: parttest hangs
 
-src_prepare() {
-   # whole patch should be upstreamed, doesn't work in PATCHES
-   epatch ${FILESDIR}/${PN}-5.-tests-optional.patch
-
-   kde5_src_prepare
-}
-
 src_configure() {
local mycmakeargs=(
$(cmake-utils_use_find_package chm CHM)



[gentoo-commits] proj/kde:master commit in: kde-apps/okular/files/, kde-apps/okular/

2015-01-25 Thread Johannes Huber
commit: 4b1760efed8701b8029c6ca973087a131c410d7a
Author: Andreas Sturmlechner andreas.sturmlechner AT gmail DOT com
AuthorDate: Fri Jan 23 19:32:59 2015 +
Commit: Johannes Huber johu AT gentoo DOT org
CommitDate: Sun Jan 25 19:24:43 2015 +
URL:http://sources.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=4b1760ef

[kde-apps/okular] Make tests optional

---
 .../files/okular-5.-tests-optional.patch   | 24 ++
 kde-apps/okular/okular-5..ebuild   |  7 +++
 2 files changed, 31 insertions(+)

diff --git a/kde-apps/okular/files/okular-5.-tests-optional.patch 
b/kde-apps/okular/files/okular-5.-tests-optional.patch
new file mode 100644
index 000..9494cbc
--- /dev/null
+++ b/kde-apps/okular/files/okular-5.-tests-optional.patch
@@ -0,0 +1,24 @@
+--- a/CMakeLists.txt   2015-01-25 14:40:33.935040773 +0100
 b/CMakeLists.txt   2015-01-25 14:42:53.287043165 +0100
+@@ -20,7 +20,7 @@
+ include(ECMAddTests)
+ 
+ 
+-find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Test Widgets 
PrintSupport Svg Qml Quick)
++find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Widgets PrintSupport 
Svg Qml Quick)
+ find_package(KF5 REQUIRED COMPONENTS
+ Activities
+ Archive
+@@ -68,7 +68,11 @@
+ add_subdirectory( ui )
+ add_subdirectory( shell )
+ add_subdirectory( generators )
+-add_subdirectory( autotests )
++
++if(BUILD_TESTING)
++find_package(Qt5Test CONFIG REQUIRED)
++add_subdirectory( autotests )
++endif()
+ 
+ add_subdirectory(doc)
+ 

diff --git a/kde-apps/okular/okular-5..ebuild 
b/kde-apps/okular/okular-5..ebuild
index ec6c217..54e3c2e 100644
--- a/kde-apps/okular/okular-5..ebuild
+++ b/kde-apps/okular/okular-5..ebuild
@@ -58,6 +58,13 @@ RDEPEND=${DEPEND}
 RESTRICT=test
 # test 2: parttest hangs
 
+src_prepare() {
+   # whole patch should be upstreamed, doesn't work in PATCHES
+   epatch ${FILESDIR}/${PN}-5.-tests-optional.patch
+
+   kde5_src_prepare
+}
+
 src_configure() {
local mycmakeargs=(
$(cmake-utils_use_with chm)