From 0f37c047c80a1d18c0ddbaf3a946bc5c0f26ffb3 Mon Sep 17 00:00:00 2001 From: augiedoggie Date: Tue, 14 May 2024 18:17:59 -0600 Subject: [PATCH] zeal: enable singleton code and 32 bit (#10442) This allows query/url commands to be sent to a running instance. Fixes #10441 --- app-doc/zeal/additional-files/zeal.rdef.in | 2 +- app-doc/zeal/patches/zeal-0.6.1.patchset | 100 --------------------- app-doc/zeal/patches/zeal-0.7.0.patchset | 36 -------- app-doc/zeal/zeal-0.6.1.recipe | 92 ------------------- app-doc/zeal/zeal-0.7.0.recipe | 13 ++- 5 files changed, 6 insertions(+), 237 deletions(-) delete mode 100644 app-doc/zeal/patches/zeal-0.6.1.patchset delete mode 100644 app-doc/zeal/zeal-0.6.1.recipe diff --git a/app-doc/zeal/additional-files/zeal.rdef.in b/app-doc/zeal/additional-files/zeal.rdef.in index 2e1ff03b4..06e1a17e1 100644 --- a/app-doc/zeal/additional-files/zeal.rdef.in +++ b/app-doc/zeal/additional-files/zeal.rdef.in @@ -1,5 +1,5 @@ -resource app_flags B_SINGLE_LAUNCH; +resource app_flags B_MULTIPLE_LAUNCH; resource app_version { major = @MAJOR@, diff --git a/app-doc/zeal/patches/zeal-0.6.1.patchset b/app-doc/zeal/patches/zeal-0.6.1.patchset deleted file mode 100644 index c4451f4ec..000000000 --- a/app-doc/zeal/patches/zeal-0.6.1.patchset +++ /dev/null @@ -1,100 +0,0 @@ -From 70fbd5c99aa2027804533c238ed6d4a8a8229a12 Mon Sep 17 00:00:00 2001 -From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Mon, 3 Sep 2018 20:03:29 +1000 -Subject: Fix build for Haiku - - -diff --git a/src/app/main.cpp b/src/app/main.cpp -index 611ee1f..02a3d44 100644 ---- a/src/app/main.cpp -+++ b/src/app/main.cpp -@@ -203,6 +203,7 @@ int main(int argc, char *argv[]) - } - #endif - -+#ifndef Q_OS_HAIKU - QScopedPointer appSingleton(new Core::ApplicationSingleton()); - if (appSingleton->isSecondary()) { - #ifdef Q_OS_WIN32 -@@ -215,7 +216,7 @@ int main(int argc, char *argv[]) - appSingleton->sendMessage(ba); - return EXIT_SUCCESS; - } -- -+#endif - // Set application-wide window icon. All message boxes and other windows will use it by default. - qapp->setWindowIcon(QIcon::fromTheme(QStringLiteral("zeal"), - QIcon(QStringLiteral(":/zeal.ico")))); -@@ -223,7 +224,7 @@ int main(int argc, char *argv[]) - QDir::setSearchPaths(QStringLiteral("typeIcon"), {QStringLiteral(":/icons/type")}); - - QScopedPointer app(new Core::Application()); -- -+#ifndef Q_OS_HAIKU - QObject::connect(appSingleton.data(), &Core::ApplicationSingleton::messageReceived, - [&app](const QByteArray &data) { - Registry::SearchQuery query; -@@ -234,7 +235,7 @@ int main(int argc, char *argv[]) - - app->executeQuery(query, preventActivation); - }); -- -+#endif - if (!clParams.query.isEmpty()) { - QTimer::singleShot(0, [&app, clParams] { - app->executeQuery(clParams.query, clParams.preventActivation); -diff --git a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt -index 8b1b0ef..ce2c28a 100644 ---- a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt -+++ b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt -@@ -6,6 +6,10 @@ if(APPLE) - list(APPEND QxtGlobalShortcut_SOURCES - qxtglobalshortcut_mac.cpp - ) -+elseif(HAIKU) -+ list(APPEND QxtGlobalShortcut_SOURCES -+ qxtglobalshortcut_haiku.cpp -+ ) - elseif(UNIX) - find_package(X11) - if(X11_FOUND) -diff --git a/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp -new file mode 100644 -index 0000000..1bb9cde ---- /dev/null -+++ b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp -@@ -0,0 +1,31 @@ -+#include "qxtglobalshortcut_p.h" -+ -+#include -+#include -+#include -+ -+bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray &eventType, -+ void *message, long *result) -+{ -+ return false; -+} -+ -+quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers) -+{ -+ return 0; -+} -+ -+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key) -+{ -+ return 0; -+} -+ -+bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods) -+{ -+ return false; -+} -+ -+bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods) -+{ -+ return false; -+} --- -2.16.4 - diff --git a/app-doc/zeal/patches/zeal-0.7.0.patchset b/app-doc/zeal/patches/zeal-0.7.0.patchset index 3c0af82d4..d9e6eef95 100644 --- a/app-doc/zeal/patches/zeal-0.7.0.patchset +++ b/app-doc/zeal/patches/zeal-0.7.0.patchset @@ -4,42 +4,6 @@ Date: Mon, 3 Sep 2018 20:03:29 +1000 Subject: Fix build for Haiku -diff --git a/src/app/main.cpp b/src/app/main.cpp -index 765bfe3..2072e7c 100644 ---- a/src/app/main.cpp -+++ b/src/app/main.cpp -@@ -219,6 +219,7 @@ int main(int argc, char *argv[]) - } - #endif - -+#ifndef Q_OS_HAIKU - QScopedPointer appSingleton(new Core::ApplicationSingleton()); - if (appSingleton->isSecondary()) { - #ifdef Q_OS_WIN32 -@@ -231,6 +232,7 @@ int main(int argc, char *argv[]) - appSingleton->sendMessage(ba); - return EXIT_SUCCESS; - } -+#endif - - // Set application-wide window icon. All message boxes and other windows will use it by default. - qapp->setDesktopFileName(QStringLiteral("org.zealdocs.zeal")); -@@ -241,6 +243,7 @@ int main(int argc, char *argv[]) - - QScopedPointer app(new Core::Application()); - -+#ifndef Q_OS_HAIKU - QObject::connect(appSingleton.data(), &Core::ApplicationSingleton::messageReceived, - [&app](const QByteArray &data) { - Registry::SearchQuery query; -@@ -251,6 +254,7 @@ int main(int argc, char *argv[]) - - app->executeQuery(query, preventActivation); - }); -+#endif - - if (!clParams.query.isEmpty()) { - QTimer::singleShot(0, app.data(), [&app, clParams] { diff --git a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt index f1c6a05..36660e4 100644 --- a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt diff --git a/app-doc/zeal/zeal-0.6.1.recipe b/app-doc/zeal/zeal-0.6.1.recipe deleted file mode 100644 index ecbfce69f..000000000 --- a/app-doc/zeal/zeal-0.6.1.recipe +++ /dev/null @@ -1,92 +0,0 @@ -SUMMARY="A simple offline documentation browser inspired by Dash" -DESCRIPTION="Zeal is a cross-platform, open source, offline \ -documentation browser for software developers, inspired by Dash Docs \ -for macOS and iOS. Zeal has over 195+ docsets and are all compatible \ -with Dash docsets." -HOMEPAGE="https://zealdocs.org/" -COPYRIGHT="2013-2018 Oleg Shparber" -LICENSE="GNU GPL v3" -REVISION="1" -SOURCE_URI="https://github.com/zealdocs/zeal/archive/v$portVersion.tar.gz" -CHECKSUM_SHA256="095c08f9903071849d5c79878abd48237ce1615f16d324afff1873ab6b5f0026" -SOURCE_FILENAME="zeal-$portVersion.tar.gz" -PATCHES="zeal-$portVersion.patchset" -ADDITIONAL_FILES="zeal.rdef.in" - -ARCHITECTURES="all !x86_gcc2 ?x86" -if [ "$targetArchitecture" = x86_gcc2 ]; then -SECONDARY_ARCHITECTURES="x86" -fi - -PROVIDES=" - zeal$secondaryArchSuffix = $portVersion - app:Zeal = $portVersion - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libarchive$secondaryArchSuffix - lib:libGL$secondaryArchSuffix - lib:libQt5Core$secondaryArchSuffix - lib:libQt5Gui$secondaryArchSuffix - lib:libQt5Network$secondaryArchSuffix - lib:libQt5WebKit$secondaryArchSuffix - lib:libQt5WebKitWidgets$secondaryArchSuffix - lib:libsqlite3$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - extra_cmake_modules$secondaryArchSuffix - devel:libarchive$secondaryArchSuffix - devel:libQt5Core$secondaryArchSuffix - devel:libQt5Gui$secondaryArchSuffix - devel:libQt5Network$secondaryArchSuffix - devel:libQt5WebKit$secondaryArchSuffix - devel:libsqlite3$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:cmake - cmd:g++$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:pkg_config$secondaryArchSuffix - " - -BUILD() -{ - mkdir -p build - cd build - cmake .. $cmakeDirArgs \ - -DECM_DIR=/system/data/cmake/Modules/ECM/cmake - make $jobArgs -} - -INSTALL() -{ - mkdir -p $appsDir - cp build/bin/zeal $appsDir/Zeal - - local APP_SIGNATURE="application/x-vnd.zeal" - local MAJOR="`echo "$portVersion" | cut -d. -f1`" - local MIDDLE="`echo "$portVersion" | cut -d. -f2`" - local MINOR="`echo "$portVersion" | cut -d. -f3`" - local LONG_INFO="$SUMMARY" - sed \ - -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ - -e "s|@MAJOR@|$MAJOR|" \ - -e "s|@MIDDLE@|$MIDDLE|" \ - -e "s|@MINOR@|$MINOR|" \ - -e "s|@LONG_INFO@|$LONG_INFO|" \ - $portDir/additional-files/zeal.rdef.in > zeal.rdef - - addResourcesToBinaries zeal.rdef $appsDir/Zeal - mimeset -f $appsDir/Zeal - addAppDeskbarSymlink $appsDir/Zeal -} - -TEST() -{ - make test -} diff --git a/app-doc/zeal/zeal-0.7.0.recipe b/app-doc/zeal/zeal-0.7.0.recipe index 2fccbf395..49ae1d946 100644 --- a/app-doc/zeal/zeal-0.7.0.recipe +++ b/app-doc/zeal/zeal-0.7.0.recipe @@ -6,17 +6,14 @@ with Dash docsets." HOMEPAGE="https://zealdocs.org/" COPYRIGHT="2013-2023 Oleg Shparber and other contributors" LICENSE="GNU GPL v3" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/zealdocs/zeal/archive/v$portVersion.tar.gz" CHECKSUM_SHA256="937cbfe3ca49a7ee2d908baa3c5b008f425ae88cf2dade0abb2651b14f0f89ca" -SOURCE_FILENAME="zeal-$portVersion.tar.gz" PATCHES="zeal-$portVersion.patchset" ADDITIONAL_FILES="zeal.rdef.in" -ARCHITECTURES="all !x86_gcc2 ?x86" -if [ "$targetArchitecture" = x86_gcc2 ]; then -SECONDARY_ARCHITECTURES="?x86" -fi +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" PROVIDES=" zeal$secondaryArchSuffix = $portVersion @@ -68,8 +65,8 @@ BUILD() INSTALL() { - mkdir -p $appsDir - cp build/zeal $appsDir/Zeal + mkdir -pv $appsDir + cp -afv build/zeal $appsDir/Zeal local APP_SIGNATURE="application/x-vnd.zeal" local MAJOR="`echo "$portVersion" | cut -d. -f1`"