commit:     8914f0f3d54236bc6696f11e457293ba4315c895
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 14:01:18 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Jul 31 18:03:56 2022 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=8914f0f3

kde-apps/yakuake: Fix build with USE -X

Upstream commit 1213c6dfd34583b005d0a2dbe7876951a13361a2

Bug: https://bugs.gentoo.org/813450
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/yakuake-22.04.3-without_x11.patch        | 87 ++++++++++++++++++++++
 kde-apps/yakuake/yakuake-22.07.80.ebuild           |  4 +-
 kde-apps/yakuake/yakuake-22.08.49.9999.ebuild      |  4 +-
 kde-apps/yakuake/yakuake-9999.ebuild               |  2 +-
 4 files changed, 94 insertions(+), 3 deletions(-)

diff --git a/kde-apps/yakuake/files/yakuake-22.04.3-without_x11.patch 
b/kde-apps/yakuake/files/yakuake-22.04.3-without_x11.patch
new file mode 100644
index 0000000000..2d46600e3d
--- /dev/null
+++ b/kde-apps/yakuake/files/yakuake-22.04.3-without_x11.patch
@@ -0,0 +1,87 @@
+From 1213c6dfd34583b005d0a2dbe7876951a13361a2 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Sat, 27 Nov 2021 14:49:51 +0100
+Subject: [PATCH] Add CMake option to build WITHOUT_X11
+
+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.
+
+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.
+
+Introducing this option means there is no behavior change by default,
+cmake will just skip finding X11 or adding unwanted features if the
+option is enabled.
+
+Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org>
+---
+ CMakeLists.txt     | 30 ++++++++++++++++--------------
+ app/CMakeLists.txt |  4 ++--
+ 2 files changed, 18 insertions(+), 16 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eafad24..f9a8167 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -51,20 +51,22 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
+ )
+ 
+ if(NOT APPLE)
+-  find_package(X11)
+-  set(HAVE_X11 ${X11_FOUND})
+-
+-  if(X11_FOUND)
+-      if (QT_MAJOR_VERSION EQUAL "5")
+-          find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
+-      else()
+-          find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui)
+-      endif()
+-  endif(X11_FOUND)
+-
+-  find_package(KF5Wayland ${KF5_MIN_VERSION} CONFIG)
+-  set(HAVE_KWAYLAND ${KF5Wayland_FOUND})
+-endif(NOT APPLE)
++    option(WITHOUT_X11 "Build without X11 integration (skips finding X11)" 
OFF)
++    if(NOT WITHOUT_X11)
++        find_package(X11)
++        set(HAVE_X11 ${X11_FOUND})
++        if(X11_FOUND)
++            if (QT_MAJOR_VERSION EQUAL "5")
++                find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
++            else()
++                find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui)
++            endif()
++        endif()
++    endif()
++
++    find_package(KF5Wayland ${KF5_MIN_VERSION} CONFIG)
++    set(HAVE_KWAYLAND ${KF5Wayland_FOUND})
++endif()
+ 
+ add_subdirectory(app)
+ add_subdirectory(data)
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index b2838ec..6ada125 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -63,13 +63,13 @@ target_link_libraries(yakuake
+     KF5::WidgetsAddons
+     KF5::WindowSystem)
+ 
+-if(X11_FOUND)
++if(HAVE_X11)
+     if (TARGET Qt5::X11Extras)
+         target_link_libraries(yakuake Qt5::X11Extras)
+     elseif (TARGET Qt6::Gui)
+         target_link_libraries(yakuake Qt6::GuiPrivate) # qtx11extras_p.h in 
knotificationrestrictions
+     endif()
+-endif(X11_FOUND)
++endif()
+ 
+ if(KF5Wayland_FOUND)
+   target_link_libraries(yakuake KF5::WaylandClient)
+-- 
+GitLab
+

diff --git a/kde-apps/yakuake/yakuake-22.07.80.ebuild 
b/kde-apps/yakuake/yakuake-22.07.80.ebuild
index 20e43fc401..6a9e7e182e 100644
--- a/kde-apps/yakuake/yakuake-22.07.80.ebuild
+++ b/kde-apps/yakuake/yakuake-22.07.80.ebuild
@@ -48,10 +48,12 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${PN}-22.04.3-without_x11.patch" )
+
 src_configure() {
        local mycmakeargs=(
                $(cmake_use_find_package absolute-position KF5Wayland)
-               $(cmake_use_find_package X X11)
+               -DWITHOUT_X11=$(usex !X)
        )
 
        ecm_src_configure

diff --git a/kde-apps/yakuake/yakuake-22.08.49.9999.ebuild 
b/kde-apps/yakuake/yakuake-22.08.49.9999.ebuild
index 208be77172..2c2169a81b 100644
--- a/kde-apps/yakuake/yakuake-22.08.49.9999.ebuild
+++ b/kde-apps/yakuake/yakuake-22.08.49.9999.ebuild
@@ -48,10 +48,12 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${PN}-22.04.3-without_x11.patch" )
+
 src_configure() {
        local mycmakeargs=(
                $(cmake_use_find_package absolute-position KF5Wayland)
-               $(cmake_use_find_package X X11)
+               -DWITHOUT_X11=$(usex !X)
        )
 
        ecm_src_configure

diff --git a/kde-apps/yakuake/yakuake-9999.ebuild 
b/kde-apps/yakuake/yakuake-9999.ebuild
index 208be77172..cc3cc8a1b2 100644
--- a/kde-apps/yakuake/yakuake-9999.ebuild
+++ b/kde-apps/yakuake/yakuake-9999.ebuild
@@ -51,7 +51,7 @@ RDEPEND="${DEPEND}"
 src_configure() {
        local mycmakeargs=(
                $(cmake_use_find_package absolute-position KF5Wayland)
-               $(cmake_use_find_package X X11)
+               -DWITHOUT_X11=$(usex !X)
        )
 
        ecm_src_configure

Reply via email to