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/ktouch/, kde-apps/ktouch/files/
Date: Sat, 06 Aug 2022 07:45:10
Message-Id: 1659771846.0ae6c63bcf85cdf1a3446f76f76c2f28209a176b.asturm@gentoo
1 commit: 0ae6c63bcf85cdf1a3446f76f76c2f28209a176b
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 28 14:40:55 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 6 07:44:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ae6c63b
7
8 kde-apps/ktouch: Fix build with USE -X
9
10 Add IUSE metadata description
11
12 Upstream commit d290b2a51d5aa4694ec746ce5cc9456977efde71
13
14 Bug: https://bugs.gentoo.org/813450
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 .../ktouch/files/ktouch-22.04.3-without_x11.patch | 95 ++++++++++++++++++++++
18 kde-apps/ktouch/ktouch-22.04.3.ebuild | 5 +-
19 kde-apps/ktouch/metadata.xml | 3 +
20 3 files changed, 101 insertions(+), 2 deletions(-)
21
22 diff --git a/kde-apps/ktouch/files/ktouch-22.04.3-without_x11.patch b/kde-apps/ktouch/files/ktouch-22.04.3-without_x11.patch
23 new file mode 100644
24 index 000000000000..2278011d6e20
25 --- /dev/null
26 +++ b/kde-apps/ktouch/files/ktouch-22.04.3-without_x11.patch
27 @@ -0,0 +1,95 @@
28 +From f94d8b2bcdb738354f73efabbbe4fcf5bb623bf7 Mon Sep 17 00:00:00 2001
29 +From: Andreas Sturmlechner <asturm@g.o>
30 +Date: Sun, 31 Jul 2022 16:17:30 +0200
31 +Subject: [PATCH] Add CMake option to build WITHOUT_X11
32 +
33 +We want to be able to build without X11 support even if some of the used
34 +libraries may not work w/o X11 themselves yet or need to be built with
35 +X11 support for other reverse dependencies.
36 +
37 +KTOUCH_BUILD_WITH_X11 already exists and is set automagically so far,
38 +but using -DCMAKE_DISABLE_FIND_PACKAGE_X11 will break if any
39 +dependencies list X11 as required in their cmake config.
40 +
41 +Introducing this option means there is no behavior change by default,
42 +cmake will just skip finding X11 or adding unwanted features if the
43 +option is enabled.
44 +
45 +- Move the checks to root CMakeLists.txt
46 +- Move finding Qt5X11Extras behind "NOT WITHOUT_X11" too
47 +- x11_helper is conditional on KTOUCH_BUILD_WITH_X11
48 +
49 +* backported to release/22.04
50 +
51 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
52 +---
53 + CMakeLists.txt | 14 +++++++++++++-
54 + src/CMakeLists.txt | 13 +------------
55 + 2 files changed, 14 insertions(+), 13 deletions(-)
56 +
57 +diff --git a/CMakeLists.txt b/CMakeLists.txt
58 +index ae5dfb8..55753cd 100644
59 +--- a/CMakeLists.txt
60 ++++ b/CMakeLists.txt
61 +@@ -40,7 +40,6 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS
62 + XmlPatterns
63 + )
64 +
65 +-find_package(Qt5X11Extras)
66 + find_package(Qt5 CONFIG QUIET OPTIONAL_COMPONENTS QuickCompiler)
67 +
68 + find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
69 +@@ -61,6 +60,19 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
70 +
71 +
72 + option(COMPILE_QML "Precompile QML code" OFF)
73 ++option(WITHOUT_X11 "Build without X11 Keyboard Layout Detection (skips finding X11)" OFF)
74 ++
75 ++if (NOT WITHOUT_X11)
76 ++ find_package(X11)
77 ++ find_package(XCB OPTIONAL_COMPONENTS XCB XKB)
78 ++ find_package(Qt5X11Extras ${QT_MIN_VERSION} CONFIG)
79 ++
80 ++ if (Qt5X11Extras_FOUND AND X11_FOUND AND X11_Xkbfile_FOUND AND X11_Xkb_FOUND AND XCB_FOUND AND XCB_XKB_FOUND)
81 ++ set(KTOUCH_BUILD_WITH_X11 TRUE)
82 ++ endif()
83 ++
84 ++ add_feature_info ("Keyboard Layout Detection" KTOUCH_BUILD_WITH_X11 "needs Qt5X11Extras, libX11, libxkb, libxkbfile, libxcb, and libxcb-xkb")
85 ++endif()
86 +
87 + # enable QML debugging for debug builds
88 + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG")
89 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
90 +index e158d7c..b352184 100644
91 +--- a/src/CMakeLists.txt
92 ++++ b/src/CMakeLists.txt
93 +@@ -4,15 +4,6 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION}
94 + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KTouchConfigVersion.cmake"
95 + )
96 +
97 +-find_package(X11)
98 +-find_package(XCB OPTIONAL_COMPONENTS XCB XKB)
99 +-
100 +-if (Qt5X11Extras_FOUND AND X11_FOUND AND X11_Xkbfile_FOUND AND X11_Xkb_FOUND AND XCB_FOUND AND XCB_XKB_FOUND)
101 +- set(KTOUCH_BUILD_WITH_X11 TRUE)
102 +-endif()
103 +-
104 +-add_feature_info ("Keyboard Layout Detection" KTOUCH_BUILD_WITH_X11 "needs Qt5X11Extras, libX11, libxkb, libxkbfile, libxcb, and libxcb-xkb")
105 +-
106 + ecm_optional_add_subdirectory(schemata)
107 +
108 + # set include directories
109 +@@ -142,9 +133,7 @@ set(ktouch_SRCS
110 + undocommands/coursecommands.cpp
111 + undocommands/coursecommands.h
112 + undocommands/keyboardlayoutcommands.cpp
113 +- undocommands/keyboardlayoutcommands.h
114 +- x11_helper.cpp
115 +- x11_helper.h)
116 ++ undocommands/keyboardlayoutcommands.h)
117 +
118 + qt_add_resources(ktouch_imgs_SRCS images/images.qrc)
119 +
120 +--
121 +2.35.1
122 +
123
124 diff --git a/kde-apps/ktouch/ktouch-22.04.3.ebuild b/kde-apps/ktouch/ktouch-22.04.3.ebuild
125 index 1437028afa44..5e61ab78de92 100644
126 --- a/kde-apps/ktouch/ktouch-22.04.3.ebuild
127 +++ b/kde-apps/ktouch/ktouch-22.04.3.ebuild
128 @@ -54,11 +54,12 @@ RDEPEND="${COMMON_DEPEND}
129 >=kde-apps/kqtquickcharts-${PVCUT}:5
130 "
131
132 +PATCHES=( "${FILESDIR}/${P}-without_x11.patch" )
133 +
134 src_configure() {
135 local mycmakeargs=(
136 -DCOMPILE_QML=OFF
137 - $(cmake_use_find_package X X11)
138 - $(cmake_use_find_package X Qt5X11Extras)
139 + -DWITHOUT_X11=$(usex !X)
140 )
141 ecm_src_configure
142 }
143
144 diff --git a/kde-apps/ktouch/metadata.xml b/kde-apps/ktouch/metadata.xml
145 index d925f2439758..6e812b0dfadd 100644
146 --- a/kde-apps/ktouch/metadata.xml
147 +++ b/kde-apps/ktouch/metadata.xml
148 @@ -8,4 +8,7 @@
149 <upstream>
150 <bugs-to>https://bugs.kde.org/</bugs-to>
151 </upstream>
152 + <use>
153 + <flag name="X">Enable support for X11 Keyboard Layout Detection</flag>
154 + </use>
155 </pkgmetadata>