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

mesa-glu: Add an option to choose the glvnd implementation #24067

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
17 changes: 13 additions & 4 deletions recipes/mesa-glu/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class MesaGluConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"glvnd": ["libglvnd", "system"],
}
default_options = {
"shared": False,
"fPIC": True,
"glvnd": "system",
}

@property
Expand All @@ -40,7 +42,9 @@ def export_sources(self):

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
if not self._with_libglvnd:
self.options.rm_safe("glvnd")

def configure(self):
if self.options.shared:
Expand All @@ -52,16 +56,19 @@ def layout(self):
def requirements(self):
# The glu headers include OpenGL headers.
if self._with_libglvnd:
self.requires("libglvnd/1.7.0", transitive_headers=True)
if self.options.get_safe("glvnd") == "libglvnd":
self.requires("libglvnd/1.7.0", transitive_headers=True)
elif self.options.get_safe("glvnd") == "system":
self.requires("opengl/system", transitive_headers=True)

def validate(self):
if is_apple_os(self) or self.settings.os == "Windows":
raise ConanInvalidConfiguration(f"{self.ref} is not supported on {self.settings.os}")

def build_requirements(self):
self.tool_requires("meson/1.2.3")
self.tool_requires("meson/1.4.0")
if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.2.0")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -100,4 +107,6 @@ def package(self):

def package_info(self):
self.cpp_info.libs = ["GLU"]
if self.settings.os in ["FreeBSD", "Linux"]:
self.cpp_info.system_libs = ["m"]
self.cpp_info.set_property("pkg_config_name", "glu")
4 changes: 2 additions & 2 deletions recipes/mesa-glu/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def requirements(self):
self.requires(self.tested_reference_str)

def build_requirements(self):
self.tool_requires("meson/1.2.3")
self.tool_requires("meson/1.4.0")
if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/2.2.0")

def build(self):
meson = Meson(self)
Expand Down
Loading