diff --git a/100.patch b/100.patch new file mode 100644 index 0000000..2e5a146 --- /dev/null +++ b/100.patch @@ -0,0 +1,113 @@ +From b0595dd3ca6b812223af8695a87480f54d094523 Mon Sep 17 00:00:00 2001 +From: Nicolas Fella +Date: Mon, 9 Oct 2023 20:22:03 +0200 +Subject: [PATCH] Add build option for KF6 coinstallability + +When shipping both KF5 and KF6 one wants to disable installing some runtime components + +We have the BUILD_RUNTIME option, but that disables too much, i.e. the KGlobalAccelPrivate library that is needed to build KWin + +Add another option for the coinstallability build +--- + CMakeLists.txt | 2 ++ + src/runtime/CMakeLists.txt | 60 ++++++++++++++++++++------------------ + 2 files changed, 34 insertions(+), 28 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 69171686..37772501 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,6 +32,8 @@ set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprec + option(BUILD_RUNTIME "Build the kglobalacceld runtime" ON) + add_feature_info(BUILD_RUNTIME ${BUILD_RUNTIME} "The kglobalacceld runtime") + ++option(KF6_COMPAT_BUILD "Don't build runtime components that conflict with KF6" OFF) ++ + option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) + add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") + +diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt +index 5562d0c9..8a2447ca 100644 +--- a/src/runtime/CMakeLists.txt ++++ b/src/runtime/CMakeLists.txt +@@ -52,26 +52,45 @@ if(XCB_XCB_FOUND) + endif() + endif() + +-add_executable(kglobalaccel5 main.cpp logging.cpp) +-ecm_mark_nongui_executable(kglobalaccel5) ++if (NOT KF6_COMPAT_BUILD) ++ add_executable(kglobalaccel5 main.cpp logging.cpp) ++ ecm_mark_nongui_executable(kglobalaccel5) + +-target_include_directories(kglobalaccel5 PRIVATE ${CMAKE_BINARY_DIR}) ++ target_include_directories(kglobalaccel5 PRIVATE ${CMAKE_BINARY_DIR}) + +-target_link_libraries(kglobalaccel5 +- KF5GlobalAccelPrivate +- KF5::DBusAddons # KDBusService +- KF5::Crash ++ target_link_libraries(kglobalaccel5 ++ KF5GlobalAccelPrivate ++ KF5::DBusAddons # KDBusService ++ KF5::Crash ++ ) ++ ++ add_subdirectory(plugins) ++ ++ if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.102.0) ++ install( FILES kglobalaccel.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR} RENAME kglobalaccel5.desktop) ++ endif() ++ ++ install( TARGETS kglobalaccel5 ${KF_INSTALL_TARGETS_DEFAULT_ARGS} ) ++ ++ ++ # D-Bus activation service file, and associated systemd service ++ include (ECMGenerateDBusServiceFile) ++ include (ECMConfiguredInstall) ++ ecm_generate_dbus_service_file( ++ NAME org.kde.kglobalaccel ++ EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/kglobalaccel5" ++ SYSTEMD_SERVICE plasma-kglobalaccel.service ++ DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR} + ) + +-add_subdirectory(plugins) ++ ecm_install_configured_files( ++ INPUT plasma-kglobalaccel.service.in ++ DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR} ++ ) ++endif() + + # Install application and configuration + install(TARGETS KF5GlobalAccelPrivate EXPORT KF5GlobalAccelTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) +-install( TARGETS kglobalaccel5 ${KF_INSTALL_TARGETS_DEFAULT_ARGS} ) +- +-if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.102.0) +- install( FILES kglobalaccel.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR} RENAME kglobalaccel5.desktop) +-endif() + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/kf5globalaccelprivate_export.h +@@ -79,18 +98,3 @@ install(FILES + kglobalaccel_interface.h + DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KGlobalAccel/private COMPONENT Devel + ) +- +-# D-Bus activation service file, and associated systemd service +-include (ECMGenerateDBusServiceFile) +-include (ECMConfiguredInstall) +-ecm_generate_dbus_service_file( +- NAME org.kde.kglobalaccel +- EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/kglobalaccel5" +- SYSTEMD_SERVICE plasma-kglobalaccel.service +- DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR} +-) +- +-ecm_install_configured_files( +- INPUT plasma-kglobalaccel.service.in +- DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR} +-) +-- +GitLab + diff --git a/kf5-kglobalaccel.spec b/kf5-kglobalaccel.spec index 115080c..b37c3a2 100644 --- a/kf5-kglobalaccel.spec +++ b/kf5-kglobalaccel.spec @@ -1,10 +1,10 @@ -%bcond build_runtime 1 +%bcond kf6_compat %[0%{?fedora} >= 40 || 0%{?rhel} >= 10] %global framework kglobalaccel Name: kf5-%{framework} Version: 5.111.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: KDE Frameworks 5 Tier 3 integration module for global shortcuts License: LGPLv2+ @@ -15,6 +15,9 @@ URL: https://invent.kde.org/frameworks/%{framework} Source0: http://download.kde.org/%{stable}/frameworks/%{majmin}/%{framework}-%{version}.tar.xz ## upstream fixes +# Add build flag for KF6 coinstallability +# https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/100 +Patch0: 100.patch BuildRequires: extra-cmake-modules >= %{majmin} BuildRequires: kf5-rpm-macros @@ -60,7 +63,7 @@ developing applications that use %{name}. %build -%cmake_kf5 %{?!with_build_runtime:-DBUILD_RUNTIME=OFF} +%cmake_kf5 %{?with_kf6_compat:-DKF6_COMPAT_BUILD=ON} %cmake_build @@ -68,7 +71,7 @@ developing applications that use %{name}. %cmake_install # unpackaged files -%if 0%{?flatpak:1} && %{with build_runtime} +%if 0%{?flatpak:1} rm -fv %{buildroot}%{_prefix}/lib/systemd/user/plasma-kglobalaccel.service %endif @@ -80,21 +83,19 @@ rm -fv %{buildroot}%{_prefix}/lib/systemd/user/plasma-kglobalaccel.service %doc README.md %license LICENSES/*.txt %{_kf5_datadir}/qlogging-categories5/%{framework}* -%if %{with build_runtime} +%if %{without kf6_compat} %{_kf5_bindir}/kglobalaccel5 %{_kf5_datadir}/kservices5/kglobalaccel5.desktop %{_datadir}/dbus-1/services/org.kde.kglobalaccel.service -%endif %if ! 0%{?flatpak:1} -%if %{with build_runtime} %{_userunitdir}/plasma-kglobalaccel.service %endif %endif %files libs %{_kf5_libdir}/libKF5GlobalAccel.so.* -%if %{with build_runtime} %{_kf5_libdir}/libKF5GlobalAccelPrivate.so.* +%if %{without kf6_compat} %{_kf5_qtplugindir}/org.kde.kglobalaccel5.platforms/ %endif @@ -107,6 +108,9 @@ rm -fv %{buildroot}%{_prefix}/lib/systemd/user/plasma-kglobalaccel.service %changelog +* Thu Oct 12 2023 Alessandro Astone - 5.111.0-2 +- Backport patch for KF6 coinstallability + * Tue Oct 10 2023 Marc Deop i Argemí - 5.111.0-1 - 5.111.0