Skip to content

Commit

Permalink
qt/6: Use libglvnd on FreeBSD and Linux
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jwillikers committed Mar 26, 2024
1 parent 3f569fe commit 02b52a6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions recipes/qt/6.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 02b52a6

Please sign in to comment.