From 1ff1c3a67fcac72da57943d679c9694b89c0334f Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 11 Jul 2022 12:35:52 -0500 Subject: [PATCH] xorg/system: Support PkgConfigDeps 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. --- recipes/xorg/all/conanfile.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes/xorg/all/conanfile.py b/recipes/xorg/all/conanfile.py index 9f211da4f29a3..1b97d1b0beacf 100644 --- a/recipes/xorg/all/conanfile.py +++ b/recipes/xorg/all/conanfile.py @@ -1,6 +1,5 @@ from conans import ConanFile, tools from conans.errors import ConanException, ConanInvalidConfiguration -import os required_conan_version = ">=1.32" @@ -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 @@ -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 = [] @@ -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")