Skip to content

Commit

Permalink
avoid unecessary call to package manager (#25400)
Browse files Browse the repository at this point in the history
When building for an OS different from Linux, FreeBSD or SunOS, don't try to call a sytem package manager. It may actually install a useless GLU system library (ie unrelated to host OS) when build machine is Linux, FreeBSD or SunOS.
  • Loading branch information
SpaceIm authored Nov 7, 2024
1 parent 74bc767 commit 5d5ae92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion recipes/glu/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def package_id(self):
self.info.clear()

def system_requirements(self):
if self.settings.os not in ["Linux", "FreeBSD", "SunOS"]:
return

dnf = package_manager.Dnf(self)
dnf.install(["mesa-libGLU-devel"], update=True, check=True)

Expand All @@ -47,13 +50,16 @@ def system_requirements(self):
pkg = package_manager.Pkg(self)
pkg.install(["libGLU"], update=True, check=True)

pkg_util = package_manager.PkgUtil(self)
pkg_util.install(["mesalibs"], update=True, check=True)

def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.includedirs = []
self.cpp_info.libdirs = []

if self.settings.os == "Windows":
self.cpp_info.system_libs = ["glu32"]
elif self.settings.os in ["Linux", "FreeBSD"]:
elif self.settings.os in ["Linux", "FreeBSD", "SunOS"]:
pkg_config = PkgConfig(self, 'glu')
pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD")

0 comments on commit 5d5ae92

Please sign in to comment.