commit:     f3aaf4d2f4c94b98cc10697104d38c158b53e0d8
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  4 20:39:52 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Mar 11 09:47:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3aaf4d2

media-gfx/okularpart: new package, split from okular, add 23.08.5

This package represents the okularpart + data that is non-conflicting
with okular:6 as an alternative, compatible dependency for anything that
has been using kde-apps/okular:5 so far.

Fix crash when in embedded dummy mode
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=476207

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-gfx/okularpart/Manifest                      |  1 +
 .../files/okularpart-23.08.5-crashfix.patch        | 86 ++++++++++++++++++++
 .../okularpart/files/okularpart-23.08.5-only.patch | 35 ++++++++
 .../files/okularpart-23.08.5-tests.patch           | 48 +++++++++++
 media-gfx/okularpart/metadata.xml                  | 17 ++++
 media-gfx/okularpart/okularpart-23.08.5.ebuild     | 94 ++++++++++++++++++++++
 6 files changed, 281 insertions(+)

diff --git a/media-gfx/okularpart/Manifest b/media-gfx/okularpart/Manifest
new file mode 100644
index 000000000000..9874fc9a6fde
--- /dev/null
+++ b/media-gfx/okularpart/Manifest
@@ -0,0 +1 @@
+DIST okular-23.08.5.tar.xz 8515760 BLAKE2B 
ec8ddf33917cc092e23934cc184280bf69fd92e184f05a14a3b0ec3636f00a90e35ab7c5b05e6b4083a4a94fb3d8725aa7b71686d5fe1d8962c4678690670f29
 SHA512 
c9e8b430fa4a5486cee0587f9beb077b4e8b5476f00ed42c9369fbb195ad9733ed310e01ebefc3c08cf78a53a3e72eab44c42a236b3dcad7e02421a864331dd6

diff --git a/media-gfx/okularpart/files/okularpart-23.08.5-crashfix.patch 
b/media-gfx/okularpart/files/okularpart-23.08.5-crashfix.patch
new file mode 100644
index 000000000000..f05906668cae
--- /dev/null
+++ b/media-gfx/okularpart/files/okularpart-23.08.5-crashfix.patch
@@ -0,0 +1,86 @@
+From 7f639c28262455226da4db9d9630a48fea99e0f4 Mon Sep 17 00:00:00 2001
+From: Carl Schwan <c...@carlschwan.eu>
+Date: Tue, 5 Mar 2024 16:08:58 +0100
+Subject: [PATCH] Fix crash when in embedded dummy mode
+
+This is an issue for Kile as they use Okular in the "dummy mode" which
+doesn't include the annotation tool.
+
+BUG: 476207
+---
+ part/pageview.cpp | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/part/pageview.cpp b/part/pageview.cpp
+index c5c1d3e55c..c01c5488c6 100644
+--- a/part/pageview.cpp
++++ b/part/pageview.cpp
+@@ -5084,7 +5084,9 @@ void PageView::slotSetMouseNormal()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::slotSetMouseZoom()
+@@ -5096,7 +5098,9 @@ void PageView::slotSetMouseZoom()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::slotSetMouseMagnifier()
+@@ -5108,7 +5112,9 @@ void PageView::slotSetMouseMagnifier()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::slotSetMouseSelect()
+@@ -5120,7 +5126,9 @@ void PageView::slotSetMouseSelect()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::slotSetMouseTextSelect()
+@@ -5132,7 +5140,9 @@ void PageView::slotSetMouseTextSelect()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::slotSetMouseTableSelect()
+@@ -5144,7 +5154,9 @@ void PageView::slotSetMouseTableSelect()
+     // force an update of the cursor
+     updateCursor();
+     Okular::Settings::self()->save();
+-    d->annotator->detachAnnotation();
++    if (d->annotator) {
++        d->annotator->detachAnnotation();
++    }
+ }
+ 
+ void PageView::showNoSigningCertificatesDialog(bool nonDateValidCerts)
+-- 
+GitLab
+

diff --git a/media-gfx/okularpart/files/okularpart-23.08.5-only.patch 
b/media-gfx/okularpart/files/okularpart-23.08.5-only.patch
new file mode 100644
index 000000000000..7b62867610bf
--- /dev/null
+++ b/media-gfx/okularpart/files/okularpart-23.08.5-only.patch
@@ -0,0 +1,35 @@
+From e3baad173b95ad75afe9d339c4a86d030b67f4be Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Sun, 10 Mar 2024 21:37:44 +0100
+Subject: [PATCH] Disable bits we don't need for okularpart only
+
+Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c47d6ab0f..91f25c62e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -184,7 +184,7 @@ if (BUILD_MOBILE)
+     )
+ endif()
+ 
+-if(NOT WIN32 AND NOT ANDROID AND NOT APPLE)
++if(0)
+     find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
+         Activities
+     )
+@@ -303,7 +303,7 @@ endif()
+ add_subdirectory( icons ) # an own directory for multi-size icons retrieved 
by KIconThemeLoader
+ add_subdirectory( part )
+ if(BUILD_DESKTOP)
+-    add_subdirectory( shell )
++#    add_subdirectory( shell )
+ endif()
+ add_subdirectory( generators )
+ 
+-- 
+2.44.0
+

diff --git a/media-gfx/okularpart/files/okularpart-23.08.5-tests.patch 
b/media-gfx/okularpart/files/okularpart-23.08.5-tests.patch
new file mode 100644
index 000000000000..8fc477be875a
--- /dev/null
+++ b/media-gfx/okularpart/files/okularpart-23.08.5-tests.patch
@@ -0,0 +1,48 @@
+From 323fed918995fe2e01036c74c1498446b4d2f122 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <andreas.sturmlech...@gmail.com>
+Date: Thu, 12 Oct 2017 14:09:09 +0200
+Subject: [PATCH] Move tests into existing (auto)tests subdirectories
+
+---
+ 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/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 mode 100644
+index 000000000..aaacb341a
+--- /dev/null
++++ b/generators/comicbook/autotests/CMakeLists.txt
+@@ -0,0 +1,6 @@
++add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/../" )
++
++ecm_add_test(comicbooktest.cpp
++    TEST_NAME "comicbooktest"
++    LINK_LIBRARIES Qt5::Test KF5::CoreAddons okularcore okular_comicbook
++)
+-- 
+2.33.0
+

diff --git a/media-gfx/okularpart/metadata.xml 
b/media-gfx/okularpart/metadata.xml
new file mode 100644
index 000000000000..4035d9145745
--- /dev/null
+++ b/media-gfx/okularpart/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>k...@gentoo.org</email>
+               <name>Gentoo KDE Project</name>
+       </maintainer>
+       <upstream>
+               <bugs-to>https://bugs.kde.org/</bugs-to>
+               <remote-id type="cpe">cpe:/a:kde:okular</remote-id>
+               <remote-id type="kde-invent">graphics/okular</remote-id>
+       </upstream>
+       <use>
+               <flag name="epub">Enable E-Book support via 
<pkg>app-text/ebook-tools</pkg></flag>
+               <flag name="mobi">Enable mobipocket support via 
<pkg>kde-apps/kdegraphics-mobipocket</pkg></flag>
+       </use>
+</pkgmetadata>

diff --git a/media-gfx/okularpart/okularpart-23.08.5.ebuild 
b/media-gfx/okularpart/okularpart-23.08.5.ebuild
new file mode 100644
index 000000000000..67b16aac3538
--- /dev/null
+++ b/media-gfx/okularpart/okularpart-23.08.5.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="false"
+ECM_TEST="forceoptional"
+KDE_ORG_NAME="okular"
+PVCUT=$(ver_cut 1-3)
+KFMIN=5.106.0
+QTMIN=5.15.9
+inherit ecm gear.kde.org
+
+DESCRIPTION="Universal document viewer kpart based on KDE Frameworks"
+HOMEPAGE="https://okular.kde.org https://apps.kde.org/okular/";
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="djvu epub mobi +pdf +postscript +tiff"
+
+# slot op: Uses Qt5::CorePrivate
+DEPEND="
+       >=dev-qt/qtcore-${QTMIN}:5=
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtdeclarative-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5[gif(+),jpeg,png]
+       >=dev-qt/qtprintsupport-${QTMIN}:5
+       >=dev-qt/qtsvg-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=dev-qt/qtxml-${QTMIN}:5
+       >=kde-apps/libkexiv2-${PVCUT}:5
+       >=kde-frameworks/karchive-${KFMIN}:5
+       >=kde-frameworks/kbookmarks-${KFMIN}:5
+       >=kde-frameworks/kcompletion-${KFMIN}:5
+       >=kde-frameworks/kconfig-${KFMIN}:5
+       >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+       >=kde-frameworks/kcoreaddons-${KFMIN}:5
+       >=kde-frameworks/kcrash-${KFMIN}:5
+       >=kde-frameworks/ki18n-${KFMIN}:5
+       >=kde-frameworks/kio-${KFMIN}:5
+       >=kde-frameworks/kparts-${KFMIN}:5
+       >=kde-frameworks/kpty-${KFMIN}:5
+       >=kde-frameworks/ktextwidgets-${KFMIN}:5
+       >=kde-frameworks/threadweaver-${KFMIN}:5
+       media-libs/freetype
+       sys-libs/zlib
+       djvu? ( app-text/djvu )
+       epub? ( app-text/ebook-tools )
+       mobi? ( >=kde-apps/kdegraphics-mobipocket-${PVCUT}:5 )
+       pdf? ( >=app-text/poppler-21.10.0[nss,qt5] )
+       postscript? ( app-text/libspectre )
+       tiff? ( media-libs/tiff:= )
+"
+RDEPEND="${DEPEND}
+       !kde-apps/okular:5
+       >=kde-frameworks/kimageformats-${KFMIN}:5
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}-tests.patch" # bug 734138
+       "${FILESDIR}/${P}-only.patch"
+       "${FILESDIR}/${P}-crashfix.patch" # KDE-bug 476207
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_TESTING=OFF # tests are executed for okular:5
+               -DCMAKE_DISABLE_FIND_PACKAGE_CHM=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_Discount=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_JPEG=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_KF5KHtml=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_KF5Purpose=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_KF5Wallet=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_Phonon4Qt5=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_Qt5TextToSpeech=ON
+               -DCMAKE_DISABLE_FIND_PACKAGE_LibZip=ON
+               
-DFORCE_NOT_REQUIRED_DEPENDENCIES="KF5DocTools;CHM;KF5KHtml;LibZip;KF5Wallet;DjVuLibre;EPub;KF5KExiv2;Discount;QMobipocket;Poppler;JPEG;LibSpectre;KF5Purpose;Qt5TextToSpeech;TIFF;"
+               -DOKULAR_UI="desktop"
+               $(cmake_use_find_package djvu DjVuLibre)
+               $(cmake_use_find_package epub EPub)
+               $(cmake_use_find_package mobi QMobipocket)
+               $(cmake_use_find_package pdf Poppler)
+               $(cmake_use_find_package postscript LibSpectre)
+               $(cmake_use_find_package tiff TIFF)
+       )
+       ecm_src_configure
+}
+
+src_install() {
+       ecm_src_install
+
+       rm -r "${ED}"/usr/{include,share} || die
+}

Reply via email to