public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/plasma/files/, kde-frameworks/plasma/
Date: Sat, 24 Sep 2022 08:53:55 +0000 (UTC)	[thread overview]
Message-ID: <1664009626.e991c3a01691713332f47d6e397ae8aaa35a3a90.asturm@gentoo> (raw)

commit:     e991c3a01691713332f47d6e397ae8aaa35a3a90
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  2 08:56:39 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Sep 24 08:53:46 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e991c3a0

kde-frameworks/plasma: Fix build with USE -X

Upstream commit d674a99d19efcad866a773fe6c848a7626a61c0a

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

 .../plasma/files/plasma-5.98.0-without_x11.patch   | 140 +++++++++++++++++++++
 ...lasma-5.98.0.ebuild => plasma-5.98.0-r1.ebuild} |   7 +-
 2 files changed, 144 insertions(+), 3 deletions(-)

diff --git a/kde-frameworks/plasma/files/plasma-5.98.0-without_x11.patch b/kde-frameworks/plasma/files/plasma-5.98.0-without_x11.patch
new file mode 100644
index 000000000000..62b393ba9b91
--- /dev/null
+++ b/kde-frameworks/plasma/files/plasma-5.98.0-without_x11.patch
@@ -0,0 +1,140 @@
+From d674a99d19efcad866a773fe6c848a7626a61c0a Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Tue, 2 Aug 2022 10:52:59 +0200
+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 <asturm@gentoo.org>
+---
+ CMakeLists.txt                                | 51 ++++++++++---------
+ .../core/config-x11.h.cmake                   |  1 +
+ src/plasmaquick/CMakeLists.txt                |  8 +--
+ src/plasmaquick/dialog.cpp                    |  1 +
+ 4 files changed, 31 insertions(+), 30 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3b6405725..15698543f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -88,28 +88,33 @@ set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate doc
+                        TYPE OPTIONAL
+                       )
+ 
+-#optional features
+-find_package(X11 MODULE)
+-set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
+-                       URL "https://www.x.org/"
+-                       TYPE OPTIONAL
+-                      )
+-find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE SHAPE XFIXES RENDER)
+-set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
+-                       URL "https://xcb.freedesktop.org/"
+-                       TYPE OPTIONAL
+-                      )
+-if(X11_FOUND AND XCB_XCB_FOUND)
+-  set(HAVE_X11 1)
+-  if (QT_MAJOR_VERSION STREQUAL "5")
+-      find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
+-  elseif (QT_MAJOR_VERSION STREQUAL "6")
+-      find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) # qtx11extras_p.h
+-  endif()
+-  #X11_Xrender discovery is done by FindX11
+-  #add_feature_info("X Rendering Extension (libXrender)" X11_Xrender_FOUND "Support for compositing, rendering operations, and alpha-blending. STRONGLY RECOMMENDED")
+-else()
+-  set(HAVE_X11 0)
++option(WITHOUT_X11 "Build without X11 support (skips finding X11)." OFF)
++if(NOT WITHOUT_X11)
++    #optional features
++    find_package(X11 MODULE)
++    set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
++                        URL "https://www.x.org/"
++                        TYPE OPTIONAL
++                        )
++    find_package(XCB MODULE COMPONENTS XCB COMPOSITE DAMAGE SHAPE XFIXES RENDER)
++    set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
++                        URL "https://xcb.freedesktop.org/"
++                        TYPE OPTIONAL
++                        )
++    if(X11_FOUND AND XCB_XCB_FOUND)
++        set(HAVE_X11 1)
++        if (QT_MAJOR_VERSION STREQUAL "5")
++            find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} NO_MODULE)
++        elseif (QT_MAJOR_VERSION STREQUAL "6")
++            find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) # qtx11extras_p.h
++        endif()
++        #X11_Xrender discovery is done by FindX11
++        #add_feature_info("X Rendering Extension (libXrender)" X11_Xrender_FOUND "Support for compositing, rendering operations, and alpha-blending. STRONGLY RECOMMENDED")
++        set(HAVE_XCB_SHAPE ${XCB_SHAPE_FOUND})
++    else()
++        set(HAVE_X11 0)
++        set(HAVE_XCB_SHAPE 0)
++    endif()
+ endif()
+ 
+ find_package(OpenGL)
+@@ -125,7 +130,7 @@ set_package_properties(EGL PROPERTIES
+                       )
+ 
+ get_target_property(QtGui_Enabled_Features Qt${QT_MAJOR_VERSION}::Gui QT_ENABLED_PUBLIC_FEATURES)
+-if(OpenGL_GLX_FOUND AND X11_FOUND AND (QtGui_Enabled_Features MATCHES "opengl"))
++if(OpenGL_GLX_FOUND AND HAVE_X11 AND (QtGui_Enabled_Features MATCHES "opengl"))
+     add_feature_info(GLX OpenGL_GLX_FOUND "OpenGL GLX libraries.")
+     set(HAVE_GLX 1)
+ else()
+diff --git a/src/declarativeimports/core/config-x11.h.cmake b/src/declarativeimports/core/config-x11.h.cmake
+index 2f543d547..ad1b45099 100644
+--- a/src/declarativeimports/core/config-x11.h.cmake
++++ b/src/declarativeimports/core/config-x11.h.cmake
+@@ -1,2 +1,3 @@
+ #cmakedefine01 HAVE_X11
+ #cmakedefine01 HAVE_XCB_COMPOSITE
++#cmakedefine01 HAVE_XCB_SHAPE
+diff --git a/src/plasmaquick/CMakeLists.txt b/src/plasmaquick/CMakeLists.txt
+index 37bbc5097..dd2442e70 100644
+--- a/src/plasmaquick/CMakeLists.txt
++++ b/src/plasmaquick/CMakeLists.txt
+@@ -1,9 +1,3 @@
+-if(HAVE_X11 AND XCB_XCB_FOUND AND XCB_SHAPE_FOUND)
+-    add_definitions(-DHAVE_XCB_SHAPE=1)
+-else()
+-    add_definitions(-DHAVE_XCB_SHAPE=0)
+-endif()
+-
+ add_library(KF5PlasmaQuick SHARED)
+ add_library(KF5::PlasmaQuick ALIAS KF5PlasmaQuick)
+ 
+@@ -81,7 +75,7 @@ if(HAVE_X11)
+         target_link_libraries(KF5PlasmaQuick PRIVATE Qt6::GuiPrivate)
+     endif()
+ 
+-    if(XCB_SHAPE_FOUND)
++    if(HAVE_XCB_SHAPE)
+         target_link_libraries(KF5PlasmaQuick PRIVATE XCB::SHAPE)
+     endif()
+ endif()
+diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp
+index 452e36523..2eabd5fb7 100644
+--- a/src/plasmaquick/dialog.cpp
++++ b/src/plasmaquick/dialog.cpp
+@@ -11,6 +11,7 @@
+ #include "../declarativeimports/core/framesvgitem.h"
+ #include "appletquickitem.h"
+ #include "config-plasma.h"
++#include "../declarativeimports/core/config-x11.h"
+ #include "configview.h"
+ #include "dialogshadows_p.h"
+ #include "view.h"
+-- 
+GitLab
+

diff --git a/kde-frameworks/plasma/plasma-5.98.0.ebuild b/kde-frameworks/plasma/plasma-5.98.0-r1.ebuild
similarity index 93%
rename from kde-frameworks/plasma/plasma-5.98.0.ebuild
rename to kde-frameworks/plasma/plasma-5.98.0-r1.ebuild
index 376e2545e87e..36811b06c0b8 100644
--- a/kde-frameworks/plasma/plasma-5.98.0.ebuild
+++ b/kde-frameworks/plasma/plasma-5.98.0-r1.ebuild
@@ -41,7 +41,7 @@ RDEPEND="
 	=kde-frameworks/kpackage-${PVCUT}*:5
 	=kde-frameworks/kservice-${PVCUT}*:5
 	=kde-frameworks/kwidgetsaddons-${PVCUT}*:5
-	=kde-frameworks/kwindowsystem-${PVCUT}*:5
+	=kde-frameworks/kwindowsystem-${PVCUT}*:5[X?]
 	=kde-frameworks/kxmlgui-${PVCUT}*:5
 	!gles2-only? ( media-libs/libglvnd[X?] )
 	wayland? (
@@ -59,14 +59,15 @@ DEPEND="${RDEPEND}
 "
 BDEPEND="man? ( >=kde-frameworks/kdoctools-${PVCUT}:5 )"
 
+PATCHES=( "${FILESDIR}/${P}-without_x11.patch" )
+
 src_configure() {
 	local mycmakeargs=(
 		$(cmake_use_find_package !gles2-only OpenGL)
 		$(cmake_use_find_package man KF5DocTools)
 		$(cmake_use_find_package wayland EGL)
 		$(cmake_use_find_package wayland KF5Wayland)
-		$(cmake_use_find_package X X11)
-		$(cmake_use_find_package X XCB)
+		-DWITHOUT_X11=$(usex !X)
 	)
 
 	ecm_src_configure


             reply	other threads:[~2022-09-24  8:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24  8:53 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-22 16:21 [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/plasma/files/, kde-frameworks/plasma/ Andreas Sturmlechner
2022-12-10 10:47 Andreas Sturmlechner
2022-11-16 19:17 Andreas Sturmlechner
2022-10-10  8:15 Andreas Sturmlechner
2022-06-29 19:53 Andreas Sturmlechner
2022-05-14 11:33 Andreas Sturmlechner
2022-05-04 20:50 Andreas Sturmlechner
2022-04-09 16:07 Andreas Sturmlechner
2022-01-20 13:26 Andreas Sturmlechner
2021-12-15 11:28 Andreas Sturmlechner
2021-12-08 15:08 Andreas Sturmlechner
2021-09-04 21:01 Andreas Sturmlechner
2021-09-04 21:01 Andreas Sturmlechner
2020-09-29 12:49 Andreas Sturmlechner
2020-06-23 13:49 Andreas Sturmlechner
2020-06-23 13:49 Andreas Sturmlechner
2020-02-13 21:28 Andreas Sturmlechner
2019-12-31 20:09 Andreas Sturmlechner
2019-03-13 10:18 Andreas Sturmlechner
2017-03-13 21:00 Andreas Sturmlechner
2016-11-17 11:35 Michael Palimaka
2016-02-17 11:13 Michael Palimaka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1664009626.e991c3a01691713332f47d6e397ae8aaa35a3a90.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox