Skip to content

Commit

Permalink
(#11634) 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 authored Jul 12, 2022
1 parent 9161b8c commit d7db66b
Showing 1 changed file with 7 additions and 1 deletion.
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")

0 comments on commit d7db66b

Please sign in to comment.