Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt/5: Use libglvnd on FreeBSD and Linux #23280

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@

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) and self.options.cross_compile == "None" and not is_apple_os(self) and self.settings.os != "Android":
raise ConanInvalidConfiguration("option cross_compile must be set for cross compilation "
Expand All @@ -338,6 +336,11 @@
if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata:
raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt")

if self.settings.os in ["Linux", "FreeBSD"] and self.options.qtwebengine and not self.dependencies.direct_host["libglvnd"].options.egl:
raise ConanInvalidConfiguration("The 'egl' option for the 'libglvnd' package must be enabled when the 'qtwebengine' 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 requirements(self):
self.requires("zlib/[>=1.2.11 <2]")
if self.options.openssl:
Expand Down Expand Up @@ -386,7 +389,9 @@
self.requires("xorg/system")
if self.options.get_safe("with_x11") or self.options.qtwayland:
self.requires("xkbcommon/1.5.0")
if self.options.get_safe("opengl", "no") != "no":
if self.settings.os in ["Linux", "FreeBSD"] and (self.options.get_safe("opengl", "no") != "no" or self.options.qtwebengine):
self.requires("libglvnd/1.7.0")
if self.settings.os not in ["Linux", "FreeBSD"] and self.options.get_safe("opengl", "no") != "no":
self.requires("opengl/system")
if self.options.with_zstd:
self.requires("zstd/1.5.5")
Expand All @@ -398,7 +403,6 @@
self.requires("libxshmfence/1.3")
self.requires("nss/3.93")
self.requires("libdrm/2.4.119")
self.requires("egl/system")
if self.options.get_safe("with_gstreamer", False):
self.requires("gst-plugins-base/1.19.2")
if self.options.get_safe("with_pulseaudio", False):
Expand Down Expand Up @@ -931,7 +935,7 @@
filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n'
save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)

def _create_private_module(module, dependencies=[]):

Check warning on line 938 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
if "Core" not in dependencies:
dependencies.append("Core")
dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies)
Expand Down Expand Up @@ -1000,7 +1004,7 @@
reqs.append(corrected_req)
return reqs

def _create_module(module, requires=[], has_include_dir=True):

Check warning on line 1007 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
componentname = f"qt{module}"
assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components"
self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}")
Expand Down Expand Up @@ -1087,7 +1091,10 @@
if self.options.get_safe("with_x11", False):
gui_reqs.append("xorg::xorg")
if 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 Expand Up @@ -1290,7 +1297,7 @@
webenginereqs = ["Gui", "Quick", "WebChannel", "Positioning"]
if self.settings.os in ["Linux", "FreeBSD"]:
webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \
"nss::nss", "libdrm::libdrm", "egl::egl"])
"nss::nss", "libdrm::libdrm", "libglvnd::egl"])
_create_module("WebEngineCore", webenginereqs)
if self.settings.os != "Windows":
self.cpp_info.components["WebEngineCore"].system_libs.append("resolv")
Expand Down
Loading