summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-08-03 16:32:46 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2021-08-03 16:37:19 +0200
commit13809b3b69e4124527001c959612bf5de18a56c3 (patch)
tree7e8c8738f71af392526ec8f332645deca9f2124e /app-text/kchmviewer
parentapp-misc/uptimed: remove USE=static-libs (diff)
downloadgentoo-13809b3b69e4124527001c959612bf5de18a56c3.tar.gz
gentoo-13809b3b69e4124527001c959612bf5de18a56c3.tar.bz2
gentoo-13809b3b69e4124527001c959612bf5de18a56c3.zip
app-text/kchmviewer: Re-introduce package at version 8.0
Reported-by: Michael <voron1@gmail.com> Closes: https://bugs.gentoo.org/806214 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-text/kchmviewer')
-rw-r--r--app-text/kchmviewer/Manifest1
-rw-r--r--app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch59
-rw-r--r--app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch30
-rw-r--r--app-text/kchmviewer/kchmviewer-8.0.ebuild46
-rw-r--r--app-text/kchmviewer/metadata.xml11
5 files changed, 147 insertions, 0 deletions
diff --git a/app-text/kchmviewer/Manifest b/app-text/kchmviewer/Manifest
new file mode 100644
index 000000000000..c3c46af89a36
--- /dev/null
+++ b/app-text/kchmviewer/Manifest
@@ -0,0 +1 @@
+DIST kchmviewer-8.0.tar.gz 311899 BLAKE2B f317dcc17fa88f30a4a1867b59b16bdc78457b46f4f3d3b78bd5d9d50745bf2d2329df170568c7814a02814a77b319bbd1d9f8edc3c1da0071a6ce64965b26bf SHA512 28ae8ee8a6f4a9be2e8a9666f6326906e04f34ad80a363697fc7e5bfbc745e6671884add3f57b6a1264f2056428cb0a31504da9c69a0bede0c3b485a08e75048
diff --git a/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch b/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch
new file mode 100644
index 000000000000..144d673b2b17
--- /dev/null
+++ b/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch
@@ -0,0 +1,59 @@
+From 9ac73e7ad15de08aab6b1198115be2eb44da7afe Mon Sep 17 00:00:00 2001
+From: George Yunaev <gyunaev@ulduzsoft.com>
+Date: Fri, 21 May 2021 15:57:21 -0700
+Subject: [PATCH] Custom URL scheme registration needs to be applied once per
+ https://doc.qt.io/qt-5/qwebengineurlschemehandler.html
+
+---
+ src/viewwindow_webengine.cpp | 20 +++++++++++++-------
+ src/viewwindow_webengine.h | 3 ---
+ 2 files changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/src/viewwindow_webengine.cpp b/src/viewwindow_webengine.cpp
+index 631d84d..34f3396 100644
+--- a/src/viewwindow_webengine.cpp
++++ b/src/viewwindow_webengine.cpp
+@@ -63,16 +63,22 @@ ViewWindow::ViewWindow( QWidget * parent )
+ m_contextMenuLink = 0;
+ m_storedScrollbarPosition = -1; // see header
+
+- // Use our network emulation layer. I don't know if we transfer the ownership when we install it,
+- // so we create one per page. May be unnecessary.
+- m_provider = new DataProvider_QWebEngine( this );
+-
+- page()->profile()->installUrlSchemeHandler( EBook_CHM::urlScheme(), m_provider );
+- page()->profile()->installUrlSchemeHandler( EBook_EPUB::urlScheme(), m_provider );
+-
+ // All links are going through us
+ //page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
+
++ // This needs to be done only once
++ static bool providerInstalled = false;
++
++ if ( !providerInstalled )
++ {
++ // Use our network emulation layer. We do not transfer the ownership when we install it. See https://doc.qt.io/qt-5/qwebengineurlschemehandler.html
++ DataProvider_QWebEngine * provider = new DataProvider_QWebEngine( 0 );
++
++ QWebEngineProfile::defaultProfile()->installUrlSchemeHandler( EBook_CHM::urlScheme(), provider );
++ QWebEngineProfile::defaultProfile()->installUrlSchemeHandler( EBook_EPUB::urlScheme(), provider );
++ providerInstalled = true;
++ }
++
+ connect( this, SIGNAL( loadFinished(bool)), this, SLOT( onLoadFinished(bool)) );
+
+ // Search results highlighter
+diff --git a/src/viewwindow_webengine.h b/src/viewwindow_webengine.h
+index 0adea31..3e96690 100644
+--- a/src/viewwindow_webengine.h
++++ b/src/viewwindow_webengine.h
+@@ -128,9 +128,6 @@ class ViewWindow : public QWebEngineView
+ // It is set to -1 if no scrollbar position has been set and the page is not loaded yet
+ // It is set to 0 if no scrollbar position has been set and the page is loaded already
+ int m_storedScrollbarPosition;
+-
+- // Data provider
+- DataProvider_QWebEngine * m_provider;
+ };
+
+ #endif // VIEWWINDOW_WEBENGINE_H
diff --git a/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch b/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch
new file mode 100644
index 000000000000..b4ed3b500c8d
--- /dev/null
+++ b/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch
@@ -0,0 +1,30 @@
+From e3b09edbbae17ad19661a7514afe5a9d84ca0ffa Mon Sep 17 00:00:00 2001
+From: George Yunaev <gyunaev@ulduzsoft.com>
+Date: Sun, 23 May 2021 15:03:06 -0700
+Subject: [PATCH] Adding support for old single-pass gcc linker which requires
+ a specific order of libraries. Thanks to @u-235 for reporting and patch.
+
+---
+ src/src.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/src.pro b/src/src.pro
+index e75d6a9..14c31a1 100644
+--- a/src/src.pro
++++ b/src/src.pro
+@@ -40,7 +40,6 @@ SOURCES += config.cpp \
+ textencodings.cpp \
+ treeitem_toc.cpp \
+ treeitem_index.cpp
+-LIBS += -lchm -lzip
+ TARGET = ../bin/kchmviewer
+ CONFIG += threads \
+ warn_on \
+@@ -106,6 +105,7 @@ unix:!macx: {
+ LIBS += ../lib/libebook/libebook.a
+ POST_TARGETDEPS += ../lib/libebook/libebook.a
+ }
++LIBS += -lchm -lzip
+
+ greaterThan(QT_MAJOR_VERSION, 4) {
+ # Qt 5
diff --git a/app-text/kchmviewer/kchmviewer-8.0.ebuild b/app-text/kchmviewer/kchmviewer-8.0.ebuild
new file mode 100644
index 000000000000..f4e5199ee3cf
--- /dev/null
+++ b/app-text/kchmviewer/kchmviewer-8.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop qmake-utils xdg
+
+DESCRIPTION="Feature rich chm file viewer, based on Qt"
+HOMEPAGE="https://www.ulduzsoft.com/kchmviewer/"
+SRC_URI="https://github.com/gyunaev/${PN}/archive/refs/tags/RELEASE_${PV/./_}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/kchmviewer-RELEASE_8_0"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ dev-libs/chmlib
+ dev-libs/libzip:=
+ dev-qt/qtcore:5
+ dev-qt/qtdbus:5
+ dev-qt/qtgui:5
+ dev-qt/qtnetwork:5
+ dev-qt/qtprintsupport:5
+ dev-qt/qtwebengine:5[widgets]
+ dev-qt/qtwidgets:5
+ dev-qt/qtxml:5
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-underlinking.patch"
+ "${FILESDIR}/${P}-custom-url-scheme-registration.patch"
+)
+
+src_configure() {
+ eqmake5
+}
+
+src_install() {
+ dodoc ChangeLog DBUS-bindings FAQ README
+ doicon packages/kchmviewer.png
+ dobin bin/kchmviewer
+ domenu packages/kchmviewer.desktop
+}
diff --git a/app-text/kchmviewer/metadata.xml b/app-text/kchmviewer/metadata.xml
new file mode 100644
index 000000000000..18d8646795dd
--- /dev/null
+++ b/app-text/kchmviewer/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>kde@gentoo.org</email>
+ <name>Gentoo KDE Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">gyunaev/kchmviewer</remote-id>
+ </upstream>
+</pkgmetadata>