summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-11-28 15:31:08 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2022-08-06 09:31:44 +0200
commit13d75459110d7c10653329988c2ebe9af1b99c5f (patch)
tree705cac4daaccd2aea6fd023ab1a93d004acf07ce /kde-apps/kruler/files/kruler-22.04.3-without_x11.patch
parentkde-apps/yakuake: Fix build with USE -X (diff)
downloadgentoo-13d75459110d7c10653329988c2ebe9af1b99c5f.tar.gz
gentoo-13d75459110d7c10653329988c2ebe9af1b99c5f.tar.bz2
gentoo-13d75459110d7c10653329988c2ebe9af1b99c5f.zip
kde-apps/kruler: Fix build with USE -X
Upstream commit 7a29873231061948408b36089a683ab4e0fc8a69 Bug: https://bugs.gentoo.org/813450 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-apps/kruler/files/kruler-22.04.3-without_x11.patch')
-rw-r--r--kde-apps/kruler/files/kruler-22.04.3-without_x11.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/kde-apps/kruler/files/kruler-22.04.3-without_x11.patch b/kde-apps/kruler/files/kruler-22.04.3-without_x11.patch
new file mode 100644
index 000000000000..79bd597d9377
--- /dev/null
+++ b/kde-apps/kruler/files/kruler-22.04.3-without_x11.patch
@@ -0,0 +1,64 @@
+From 7a29873231061948408b36089a683ab4e0fc8a69 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sun, 31 Jul 2022 14:59:24 +0200
+Subject: [PATCH] Add CMake option to build WITHOUT_X11, drop unused X11
+ dependency
+
+We want to be able to build without X11 support even if some of the
+used libraries may not work w/o X11 themselves yet or need to be built
+with X11 support for other reverse dependencies.
+
+KRULER_HAVE_X11 already exists and is set automagically so far, but
+using -DCMAKE_DISABLE_FIND_PACKAGE_X11 will break if any dependencies
+list X11 as required in their cmake config.
+
+X11 dependency (introduced in 4c7cab8e90f8f360fb1c6b21c73f4acba609e0fe)
+was not actually used at build time, so the new option will replace it
+to determine if the feature is enabled, however libXCB remains
+non-required.
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ CMakeLists.txt | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 86a5dc7..a5839ff 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,14 +41,16 @@ set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
+ TYPE OPTIONAL
+ )
+ if (NOT APPLE)
+- find_package(X11)
+- set (KRULER_HAVE_X11 ${X11_FOUND})
+- if (X11_FOUND)
++ option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" OFF)
++ if (NOT WITHOUT_X11)
+ find_package(XCB COMPONENTS XCB)
+- if (QT_MAJOR_VERSION STREQUAL "5")
+- find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
+- else()
+- # qtx11extras_p.h is in Qt6Gui, which implied by the Qt6Gui above
++ set (KRULER_HAVE_X11 ${XCB_FOUND})
++ if (XCB_FOUND)
++ if (QT_MAJOR_VERSION STREQUAL "5")
++ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
++ else()
++ # qtx11extras_p.h is in Qt6Gui, which implied by the Qt6Gui above
++ endif()
+ endif()
+ endif()
+ endif()
+@@ -101,7 +103,7 @@ target_link_libraries(kruler
+ KF5::WindowSystem
+ KF5::XmlGui
+ )
+-if (X11_FOUND)
++if (KRULER_HAVE_X11)
+ target_link_libraries(kruler
+ ${XCB_LIBRARIES}
+ )
+--
+GitLab
+