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

xorg/system: Support PkgConfigDeps #11634

Merged
merged 1 commit into from
Jul 12, 2022
Merged
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
8 changes: 7 additions & 1 deletion recipes/xorg/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from conans import ConanFile, tools
from conans.errors import ConanException, ConanInvalidConfiguration
import os

required_conan_version = ">=1.32"

Expand Down Expand Up @@ -30,6 +29,7 @@ def _fill_cppinfo_from_pkgconfig(self, name):
include_dirs = [include[2:] for include in pkg_config.cflags_only_I]
cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")]
defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")]
variables = pkg_config.variables

self.cpp_info.components[name].system_libs = libs
self.cpp_info.components[name].libdirs = lib_dirs
Expand All @@ -40,6 +40,10 @@ def _fill_cppinfo_from_pkgconfig(self, name):
self.cpp_info.components[name].cflags = cflags
self.cpp_info.components[name].cxxflags = cflags
self.cpp_info.components[name].version = pkg_config.version[0]
self.cpp_info.components[name].set_property("component_version", pkg_config.version[0])
self.cpp_info.components[name].set_property(
"pkg_config_custom_content",
"\n".join("%s=%s" % (key, value) for key,value in variables.items()))

def system_requirements(self):
packages = []
Expand Down Expand Up @@ -94,6 +98,8 @@ def package_info(self):
"xcb-xinerama", "xcb", "xkeyboard-config", "xcb-atom", "xcb-aux", "xcb-event", "xcb-util",
"xcb-dri3"] + ([] if self.settings.os == "FreeBSD" else ["uuid"]):
self._fill_cppinfo_from_pkgconfig(name)
self.cpp_info.components[name].set_property("pkg_config_name", name)

if self.settings.os == "Linux":
self.cpp_info.components["sm"].requires.append("uuid")