From 02b52a62e2dab7e365fc95a29c123596227a678a Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 26 Mar 2024 14:14:52 -0500 Subject: [PATCH 1/2] qt/6: Use libglvnd on FreeBSD and Linux The libglvnd package provides the necessary opengl/system and egl/system dependencies. The libglvnd package is a proper, non-system Conan package. Remove unnecessary check for wayland being enabled in xkbcommon. The Wayland option in xkbcommon only effects building an executable tool. --- recipes/qt/6.x.x/conanfile.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 02d45875b2ac6..0a6da3ec58a74 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -295,8 +295,6 @@ def validate(self): if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11: raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled") - if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: - raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") if cross_building(self): raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome") @@ -307,6 +305,11 @@ def validate(self): if self.options.get_safe("qtspeech") and not self.options.qtdeclarative: raise ConanInvalidConfiguration("qtspeech requires qtdeclarative, cf QTBUG-108381") + if self.settings.os in ["Linux", "FreeBSD"] and self.options.get_safe("with_egl") and not self.dependencies.direct_host["libglvnd"].options.egl: + raise ConanInvalidConfiguration("The 'egl' option for the 'libglvnd' package must be enabled when the 'with_egl' option is enabled") + if self.settings.os in ["Linux", "FreeBSD"] and self.options.get_safe("opengl", "no") != "no" and not self.dependencies.direct_host["libglvnd"].options.glx: + raise ConanInvalidConfiguration("The 'glx' option for the 'libglvnd' package must be enabled when the 'opengl' option is enabled") + def layout(self): cmake_layout(self, src_folder="src") @@ -356,10 +359,12 @@ def requirements(self): self.requires("xkbcommon/1.5.0") if self.options.get_safe("with_x11", False): self.requires("xorg/system") - if self.options.get_safe("with_egl"): + if self.options.get_safe("with_egl") and self.settings.os not in ["FreeBSD", "Linux"]: self.requires("egl/system") - if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + if self.settings.os not in ["FreeBSD", "Linux", "Windows"] and self.options.get_safe("opengl", "no") != "no": self.requires("opengl/system") + if self.settings.os in ["FreeBSD", "Linux"] and (self.options.get_safe("with_egl") or self.options.get_safe("opengl", "no") != "no"): + self.requires("libglvnd/1.7.0") if self.options.with_zstd: self.requires("zstd/1.5.5") if self.options.qtwayland: @@ -1055,9 +1060,12 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.get_safe("with_x11", False): gui_reqs.append("xorg::xorg") if self.options.get_safe("with_egl"): - gui_reqs.append("egl::egl") + gui_reqs.append("libglvnd::egl") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": - gui_reqs.append("opengl::opengl") + if self.settings.os in ["FreeBSD", "Linux"]: + gui_reqs.append("libglvnd::gl") + else: + gui_reqs.append("opengl::opengl") if self.options.get_safe("with_vulkan", False): gui_reqs.append("vulkan-loader::vulkan-loader") if is_apple_os(self): From f431abfb4c09296e4cbe43b59ae6386801a24cad Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 27 Mar 2024 07:18:57 -0500 Subject: [PATCH 2/2] Fix missing GUI requirement on egl/system --- recipes/qt/6.x.x/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py index 0a6da3ec58a74..3100b72c84b6d 100644 --- a/recipes/qt/6.x.x/conanfile.py +++ b/recipes/qt/6.x.x/conanfile.py @@ -1059,8 +1059,11 @@ def _create_plugin(pluginname, libname, plugintype, requires): gui_reqs.append("xkbcommon::xkbcommon") if self.options.get_safe("with_x11", False): gui_reqs.append("xorg::xorg") - if self.options.get_safe("with_egl"): + if self.options.get_safe("with_egl"): + if self.settings.os in ["Linux", "FreeBSD"]: gui_reqs.append("libglvnd::egl") + else: + gui_reqs.append("egl::egl") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": if self.settings.os in ["FreeBSD", "Linux"]: gui_reqs.append("libglvnd::gl")