From 96e61c8357a22fbb642b6d533785a891d13b04ba Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 13 Mar 2025 21:24:13 +0000 Subject: [PATCH] Make KUnifiedPush required unless opted out Quiet dependencies like this are bad since they make it easy to miss the dependency --- .flatpak-manifest.json | 18 ++++++++++++++++++ .kde-ci.yml | 1 + CMakeLists.txt | 20 ++++++++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.flatpak-manifest.json b/.flatpak-manifest.json index 796641ce0..1c4d25ea0 100644 --- a/.flatpak-manifest.json +++ b/.flatpak-manifest.json @@ -170,6 +170,24 @@ } ] }, + { + "name": "kunifiedpush", + "buildsystem": "cmake-ninja", + "builddir": true, + "sources": [ + { + "type": "archive", + "url": "https://download.kde.org/stable/kunifiedpush/kunifiedpush-1.0.0.tar.xz", + "sha256": "2ddeba21306d0307114ec50a2c38159ec62359f9fc6cdd58da30a369fbd550cf", + "x-checker-data": { + "type": "anitya", + "project-id": 375055, + "stable-only": true, + "url-template": "https://download.kde.org/stable/kunifiedpush/kunifiedpush-$version.tar.xz" + } + } + ] + }, { "name": "neochat", "buildsystem": "cmake-ninja", diff --git a/.kde-ci.yml b/.kde-ci.yml index 7bdb088a5..e14487807 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -34,6 +34,7 @@ Dependencies: 'require': 'frameworks/kdbusaddons': '@latest-kf6' 'frameworks/purpose': '@latest-kf6' + 'libraries/kunifiedpush': '@latest-kf6' - 'on': ['Linux'] 'require': diff --git a/CMakeLists.txt b/CMakeLists.txt index 6afbc135c..ebee68c18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,12 +147,20 @@ set_package_properties(KF6DocTools PROPERTIES DESCRIPTION TYPE OPTIONAL ) -find_package(KUnifiedPush QUIET) -set_package_properties(KUnifiedPush PROPERTIES - TYPE OPTIONAL - PURPOSE "Push notification support" - URL "https://invent.kde.org/libraries/kunifiedpush" -) +option(WITH_UNIFIEDPUSH "Build with KUnifiedPush support" ON) + +if (ANDROID OR APPLE OR WIN32 OR HAIKU) + set(WITH_UNIFIEDPUSH OFF) +endif() + +if (WITH_UNIFIEDPUSH) + find_package(KUnifiedPush) + set_package_properties(KUnifiedPush PROPERTIES + TYPE REQUIRED + PURPOSE "Push notification support" + URL "https://invent.kde.org/libraries/kunifiedpush" + ) +endif() if(ANDROID) find_package(Sqlite3)