Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-apps/kruler/files/, kde-apps/kruler/
Date: Sat, 06 Aug 2022 07:45:09
Message-Id: 1659771104.13d75459110d7c10653329988c2ebe9af1b99c5f.asturm@gentoo
1 commit: 13d75459110d7c10653329988c2ebe9af1b99c5f
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 28 14:31:08 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 6 07:31:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13d75459
7
8 kde-apps/kruler: Fix build with USE -X
9
10 Upstream commit 7a29873231061948408b36089a683ab4e0fc8a69
11
12 Bug: https://bugs.gentoo.org/813450
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 .../kruler/files/kruler-22.04.3-without_x11.patch | 64 ++++++++++++++++++++++
16 kde-apps/kruler/kruler-22.04.3.ebuild | 4 +-
17 2 files changed, 67 insertions(+), 1 deletion(-)
18
19 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
20 new file mode 100644
21 index 000000000000..79bd597d9377
22 --- /dev/null
23 +++ b/kde-apps/kruler/files/kruler-22.04.3-without_x11.patch
24 @@ -0,0 +1,64 @@
25 +From 7a29873231061948408b36089a683ab4e0fc8a69 Mon Sep 17 00:00:00 2001
26 +From: Andreas Sturmlechner <asturm@g.o>
27 +Date: Sun, 31 Jul 2022 14:59:24 +0200
28 +Subject: [PATCH] Add CMake option to build WITHOUT_X11, drop unused X11
29 + dependency
30 +
31 +We want to be able to build without X11 support even if some of the
32 +used libraries may not work w/o X11 themselves yet or need to be built
33 +with X11 support for other reverse dependencies.
34 +
35 +KRULER_HAVE_X11 already exists and is set automagically so far, but
36 +using -DCMAKE_DISABLE_FIND_PACKAGE_X11 will break if any dependencies
37 +list X11 as required in their cmake config.
38 +
39 +X11 dependency (introduced in 4c7cab8e90f8f360fb1c6b21c73f4acba609e0fe)
40 +was not actually used at build time, so the new option will replace it
41 +to determine if the feature is enabled, however libXCB remains
42 +non-required.
43 +
44 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
45 +---
46 + CMakeLists.txt | 18 ++++++++++--------
47 + 1 file changed, 10 insertions(+), 8 deletions(-)
48 +
49 +diff --git a/CMakeLists.txt b/CMakeLists.txt
50 +index 86a5dc7..a5839ff 100644
51 +--- a/CMakeLists.txt
52 ++++ b/CMakeLists.txt
53 +@@ -41,14 +41,16 @@ set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
54 + TYPE OPTIONAL
55 + )
56 + if (NOT APPLE)
57 +- find_package(X11)
58 +- set (KRULER_HAVE_X11 ${X11_FOUND})
59 +- if (X11_FOUND)
60 ++ option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" OFF)
61 ++ if (NOT WITHOUT_X11)
62 + find_package(XCB COMPONENTS XCB)
63 +- if (QT_MAJOR_VERSION STREQUAL "5")
64 +- find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
65 +- else()
66 +- # qtx11extras_p.h is in Qt6Gui, which implied by the Qt6Gui above
67 ++ set (KRULER_HAVE_X11 ${XCB_FOUND})
68 ++ if (XCB_FOUND)
69 ++ if (QT_MAJOR_VERSION STREQUAL "5")
70 ++ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
71 ++ else()
72 ++ # qtx11extras_p.h is in Qt6Gui, which implied by the Qt6Gui above
73 ++ endif()
74 + endif()
75 + endif()
76 + endif()
77 +@@ -101,7 +103,7 @@ target_link_libraries(kruler
78 + KF5::WindowSystem
79 + KF5::XmlGui
80 + )
81 +-if (X11_FOUND)
82 ++if (KRULER_HAVE_X11)
83 + target_link_libraries(kruler
84 + ${XCB_LIBRARIES}
85 + )
86 +--
87 +GitLab
88 +
89
90 diff --git a/kde-apps/kruler/kruler-22.04.3.ebuild b/kde-apps/kruler/kruler-22.04.3.ebuild
91 index 7b51b8f8f795..0a74d158d6f9 100644
92 --- a/kde-apps/kruler/kruler-22.04.3.ebuild
93 +++ b/kde-apps/kruler/kruler-22.04.3.ebuild
94 @@ -34,9 +34,11 @@ DEPEND="
95 "
96 RDEPEND="${DEPEND}"
97
98 +PATCHES=( "${FILESDIR}/${P}-without_x11.patch" )
99 +
100 src_configure() {
101 local mycmakeargs=(
102 - $(cmake_use_find_package X X11)
103 + -DWITHOUT_X11=$(usex !X)
104 )
105
106 ecm_src_configure