Skip to content

Commit

Permalink
(#12882) xkbcommon: Small fixes
Browse files Browse the repository at this point in the history
* xkbcommon: Small fixes

* Remove buildenv PATH
  • Loading branch information
jwillikers authored Sep 14, 2022
1 parent 6e721f5 commit cf3936e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 2 additions & 16 deletions recipes/xkbcommon/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class XkbcommonConan(ConanFile):
"xkbregistry": True,
}

generators = "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv"
generators = "PkgConfigDeps", "VirtualBuildEnv"

@property
def _has_xkbregistry_option(self):
Expand Down Expand Up @@ -68,7 +68,7 @@ def build_requirements(self):
self.tool_requires("meson/0.63.1")
self.tool_requires("bison/3.7.6")
self.tool_requires("pkgconf/1.7.4")
if self.options.get_safe("with_wayland"):
if hasattr(self, "settings_build") and self.options.get_safe("with_wayland"):
self.tool_requires("wayland/1.21.0")

def layout(self):
Expand Down Expand Up @@ -124,26 +124,14 @@ def package_info(self):
self.cpp_info.components["libxkbcommon"].requires = ["xorg::xkeyboard-config"]
self.cpp_info.components["libxkbcommon"].resdirs = ["res"]

# todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator.
self.cpp_info.components["libxkbcommon"].includedirs = ["include"]
self.cpp_info.components["libxkbcommon"].libdirs = ["lib"]

if self.options.with_x11:
self.cpp_info.components["libxkbcommon-x11"].set_property("pkg_config_name", "xkbcommon-x11")
self.cpp_info.components["libxkbcommon-x11"].libs = ["xkbcommon-x11"]
self.cpp_info.components["libxkbcommon-x11"].requires = ["libxkbcommon", "xorg::xcb", "xorg::xcb-xkb"]

# todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator.
self.cpp_info.components["libxkbcommon-x11"].includedirs = ["include"]
self.cpp_info.components["libxkbcommon-x11"].libdirs = ["lib"]
if self.options.get_safe("xkbregistry"):
self.cpp_info.components["libxkbregistry"].set_property("pkg_config_name", "xkbregistry")
self.cpp_info.components["libxkbregistry"].libs = ["xkbregistry"]
self.cpp_info.components["libxkbregistry"].requires = ["libxml2::libxml2"]

# todo Remove in Conan version 1.50.0 where these are set by default for the PkgConfigDeps generator.
self.cpp_info.components["libxkbregistry"].includedirs = ["include"]
self.cpp_info.components["libxkbregistry"].libdirs = ["lib"]
if self.options.get_safe("with_wayland", False):
# FIXME: This generates just executable, but I need to use the requirements to pass Conan checks
self.cpp_info.components["xkbcli-interactive-wayland"].libs = []
Expand All @@ -152,8 +140,6 @@ def package_info(self):

if Version(self.version) >= "1.0.0":
bindir = os.path.join(self.package_folder, "bin")
self.buildenv_info.prepend_path("PATH", bindir)
self.runenv_info.prepend_path("PATH", bindir)
self.output.info(f"Appending PATH environment variable: {bindir}")
self.env_info.PATH.append(bindir)

Expand Down
2 changes: 1 addition & 1 deletion recipes/xkbcommon/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualBuildEnv", "VirtualRunEnv"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"

def requirements(self):
self.requires(self.tested_reference_str)
Expand Down

0 comments on commit cf3936e

Please sign in to comment.