Skip to content

Commit

Permalink
xorg/system: Support PkgConfigDeps
Browse files Browse the repository at this point in the history
Fix file names of *.pc files when using PkgConfigDeps generator.
Include custom variables in *.pc files.

Fixes a long-standing issue of a missing variable when building xkbcommon.
Fixes #3377.
  • Loading branch information
jwillikers committed Jul 11, 2022
1 parent e5d1a55 commit 6ade0d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/xorg/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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 +41,9 @@ 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(
"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")

0 comments on commit 6ade0d8

Please sign in to comment.