We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] wayland/all: incompatible with latest (1.52.0) Conan version
### Package and Environment Details

* Package Name/Version: **wayland/1.20.0**
* Conan version: **conan 1.52.0**

### Conan profile

_No response_

### Steps to reproduce

conan export recipes/wayland/all wayland/1.20.0@

### Logs

<details><summary>Click to expand log</summary>

```
File "recipes/wayland/all/conanfile.py", line 5, in <module>
    from conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content
ModuleNotFoundError: No module named 'conan.tools.gnu.pkgconfigdeps.pc_files_creator'; 'conan.tools.gnu.pkgconfigdeps' is not a package
```

</details>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/wayland/all/conanfile.py`
Content:
```
1 from conan import ConanFile
2 from conan.errors import ConanInvalidConfiguration
3 from conan.tools.build import cross_building
4 from conan.tools.files import copy, get, mkdir, replace_in_file, rmdir, save
5 from conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content
6 from conan.tools.layout import basic_layout
7 from conan.tools.meson import Meson, MesonToolchain
8 from conan.tools.scm import Version
9 import os
10 
11 required_conan_version = ">=1.50.0"
12 
13 
14 class WaylandConan(ConanFile):
15     name = "wayland"
16     description = (
17         "Wayland is a project to define a protocol for a compositor to talk to "
18         "its clients as well as a library implementation of the protocol"
19     )
20     topics = ("protocol", "compositor", "display")
21     url = "https://github.com/conan-io/conan-center-index"
22     homepage = "https://wayland.freedesktop.org"
23     license = "MIT"
24 
25     settings = "os", "arch", "compiler", "build_type"
26     options = {
27         "shared": [True, False],
28         "fPIC": [True, False],
29         "enable_libraries": [True, False],
30         "enable_dtd_validation": [True, False],
31     }
32     default_options = {
33         "shared": False,
34         "fPIC": True,
35         "enable_libraries": True,
36         "enable_dtd_validation": True,
37     }
38 
39     generators = "PkgConfigDeps", "VirtualBuildEnv", "VirtualRunEnv"
40 
41     def configure(self):
42         if self.options.shared:
43             del self.options.fPIC
44         try:
45            del self.settings.compiler.libcxx
46         except Exception:
47            pass
48         try:
49            del self.settings.compiler.cppstd
50         except Exception:
51            pass
52 
53     def requirements(self):
54         if self.options.enable_libraries:
55             self.requires("libffi/3.4.2")
56         if self.options.enable_dtd_validation:
57             self.requires("libxml2/2.9.14")
58         self.requires("expat/2.4.8")
59 
60     def validate(self):
61         if self.info.settings.os != "Linux":
62             raise ConanInvalidConfiguration("Wayland can be built on Linux only")
63 
64     def build_requirements(self):
65         self.tool_requires("meson/0.63.1")
66         self.tool_requires("pkgconf/1.7.4")
67         if cross_building(self):
68             self.tool_requires(self.ref)
69 
70     def layout(self):
71         basic_layout(self, src_folder="src")
72 
73     def source(self):
74         get(self, **self.conan_data["sources"][self.version], strip_root=True)
75 
76     def generate(self):
77         tc = MesonToolchain(self)
78         tc.project_options["libdir"] = "lib"
79         tc.project_options["datadir"] = "res"
80         tc.project_options["libraries"] = self.options.enable_libraries
81         tc.project_options["dtd_validation"] = self.options.enable_dtd_validation
82         tc.project_options["documentation"] = False
83         if Version(self.version) >= "1.18.91":
84             tc.project_options["scanner"] = True
85 
86             # Generate PC files for the tool_requires wayland package to ensure wayland-scanner is found for build machine.
87             if cross_building(self):
88                 native_generators_folder = os.path.join(self.generators_folder, "native")
89                 mkdir(self, native_generators_folder)
90                 for target in ["wayland", "expat", "libxml2", "libiconv"]:
91                     for pc_name, pc_content in get_pc_files_and_content(self, self.dependencies.build[target]).items():
92                         save(self, os.path.join(native_generators_folder, pc_name), pc_content)
93                 tc.project_options["build.pkg_config_path"] = native_generators_folder
94         tc.generate()
95 
96     def _patch_sources(self):
97         replace_in_file(self, os.path.join(self.source_folder, "meson.build"),
98                         "subdir('tests')", "#subdir('tests')")
99 
100     def build(self):
101         self._patch_sources()
102         meson = Meson(self)
103         meson.configure()
104         meson.build()
105 
106     def package(self):
107         copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
108         meson = Meson(self)
109         meson.install()
110         pkg_config_dir = os.path.join(self.package_folder, "lib", "pkgconfig")
111         rmdir(self, pkg_config_dir)
112 
113     def package_info(self):
114         self.cpp_info.components["wayland-scanner"].set_property("pkg_config_name", "wayland-scanner")
115         self.cpp_info.components["wayland-scanner"].names["pkg_config"] = "wayland-scanner"
116         self.cpp_info.components["wayland-scanner"].resdirs = ["res"]
117 
118         self.cpp_info.components["wayland-scanner"].includedirs = []
119         self.cpp_info.components["wayland-scanner"].libdirs = []
120         self.cpp_info.components["wayland-scanner"].set_property("component_version", self.version)
121 
122         self.cpp_info.components["wayland-scanner"].requires = ["expat::expat"]
123         if self.options.enable_dtd_validation:
124             self.cpp_info.components["wayland-scanner"].requires.append("libxml2::libxml2")
125         pkgconfig_variables = {
126             'datarootdir': '${prefix}/res',
127             'pkgdatadir': '${datarootdir}/wayland',
128             'bindir': '${prefix}/bin',
129             'wayland_scanner': '${bindir}/wayland-scanner',
130         }
131         self.cpp_info.components["wayland-scanner"].set_property(
132             "pkg_config_custom_content",
133             "\n".join(f"{key}={value}" for key,value in pkgconfig_variables.items()))
134 
135         bindir = os.path.join(self.package_folder, "bin")
136         self.buildenv_info.prepend_path("PATH", bindir)
137         self.runenv_info.prepend_path("PATH", bindir)
138         # TODO: Remove in Conan 2.0 where Environment class will be required.
139         self.output.info("Appending PATH environment variable: {}".format(bindir))
140         self.env_info.PATH.append(bindir)
141 
142         if self.options.enable_libraries:
143             self.cpp_info.components["wayland-server"].libs = ["wayland-server"]
144             self.cpp_info.components["wayland-server"].set_property("pkg_config_name", "wayland-server")
145             self.cpp_info.components["wayland-server"].names["pkg_config"] = "wayland-server"
146             self.cpp_info.components["wayland-server"].requires = ["libffi::libffi"]
147             self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"]
148             self.cpp_info.components["wayland-server"].resdirs = ["res"]
149             if self.version >= Version("1.21.0") and self.settings.os == "Linux":
150                 self.cpp_info.components["wayland-server"].system_libs += ["rt"]
151             self.cpp_info.components["wayland-server"].set_property("component_version", self.version)
152 
153             pkgconfig_variables = {
154                 'datarootdir': '${prefix}/res',
155                 'pkgdatadir': '${datarootdir}/wayland',
156             }
157             self.cpp_info.components["wayland-server"].set_property(
158                 "pkg_config_custom_content",
159                 "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()))
160 
161             self.cpp_info.components["wayland-client"].libs = ["wayland-client"]
162             self.cpp_info.components["wayland-client"].set_property("pkg_config_name", "wayland-client")
163             self.cpp_info.components["wayland-client"].names["pkg_config"] = "wayland-client"
164             self.cpp_info.components["wayland-client"].requires = ["libffi::libffi"]
165             self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"]
166             self.cpp_info.components["wayland-client"].resdirs = ["res"]
167             if self.version >= Version("1.21.0") and self.settings.os == "Linux":
168                 self.cpp_info.components["wayland-client"].system_libs += ["rt"]
169             self.cpp_info.components["wayland-client"].set_property("component_version", self.version)
170 
171             pkgconfig_variables = {
172                 'datarootdir': '${prefix}/res',
173                 'pkgdatadir': '${datarootdir}/wayland',
174             }
175             self.cpp_info.components["wayland-client"].set_property(
176                 "pkg_config_custom_content",
177                 "\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()))
178 
179             self.cpp_info.components["wayland-cursor"].libs = ["wayland-cursor"]
180             self.cpp_info.components["wayland-cursor"].set_property("pkg_config_name", "wayland-cursor")
181             self.cpp_info.components["wayland-cursor"].names["pkg_config"] = "wayland-cursor"
182             self.cpp_info.components["wayland-cursor"].requires = ["wayland-client"]
183             self.cpp_info.components["wayland-cursor"].set_property("component_version", self.version)
184 
185             self.cpp_info.components["wayland-egl"].libs = ["wayland-egl"]
186             self.cpp_info.components["wayland-egl"].set_property("pkg_config_name", "wayland-egl")
187             self.cpp_info.components["wayland-egl"].names["pkg_config"] = "wayland-egl"
188             self.cpp_info.components["wayland-egl"].requires = ["wayland-client"]
189             self.cpp_info.components["wayland-egl"].set_property("component_version", "18.1.0")
190 
191             self.cpp_info.components["wayland-egl-backend"].names["pkg_config"] = "wayland-egl-backend"
192             self.cpp_info.components["wayland-egl-backend"].set_property("pkg_config_name", "wayland-egl-backend")
193             self.cpp_info.components["wayland-egl-backend"].set_property("component_version", "3")
194 
195             bindir = os.path.join(self.package_folder, "bin")
196             self.output.info("Appending PATH environment variable: {}".format(bindir))
197             self.env_info.PATH.append(bindir)
198
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py
--- a/recipes/wayland/all/conanfile.py
+++ b/recipes/wayland/all/conanfile.py
@@ -1,8 +1,7 @@
 from conan import ConanFile
 from conan.errors import ConanInvalidConfiguration
 from conan.tools.build import cross_building
-from conan.tools.files import copy, get, mkdir, replace_in_file, rmdir, save
-from conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content
+from conan.tools.files import copy, get, replace_in_file, rmdir
 from conan.tools.layout import basic_layout
 from conan.tools.meson import Meson, MesonToolchain
 from conan.tools.scm import Version
@@ -82,21 +81,20 @@
         tc.project_options["documentation"] = False
         if Version(self.version) >= "1.18.91":
             tc.project_options["scanner"] = True
-
-            # Generate PC files for the tool_requires wayland package to ensure wayland-scanner is found for build machine.
-            if cross_building(self):
-                native_generators_folder = os.path.join(self.generators_folder, "native")
-                mkdir(self, native_generators_folder)
-                for target in ["wayland", "expat", "libxml2", "libiconv"]:
-                    for pc_name, pc_content in get_pc_files_and_content(self, self.dependencies.build[target]).items():
-                        save(self, os.path.join(native_generators_folder, pc_name), pc_content)
-                tc.project_options["build.pkg_config_path"] = native_generators_folder
         tc.generate()
 
     def _patch_sources(self):
         replace_in_file(self, os.path.join(self.source_folder, "meson.build"),
                         "subdir('tests')", "#subdir('tests')")
 
+        if cross_building(self):
+            replace_in_file(self, f"{self.source_folder}/src/meson.build",
+                            "scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())",
+                                "# scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())")
+            replace_in_file(self, f"{self.source_folder}/src/meson.build",
+                            "wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))",
+                                "wayland_scanner_for_build = find_program('wayland-scanner')")
+
     def build(self):
         self._patch_sources()
         meson = Meson(self)

{"golden_diff": "diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py\n--- a/recipes/wayland/all/conanfile.py\n+++ b/recipes/wayland/all/conanfile.py\n@@ -1,8 +1,7 @@\n from conan import ConanFile\n from conan.errors import ConanInvalidConfiguration\n from conan.tools.build import cross_building\n-from conan.tools.files import copy, get, mkdir, replace_in_file, rmdir, save\n-from conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content\n+from conan.tools.files import copy, get, replace_in_file, rmdir\n from conan.tools.layout import basic_layout\n from conan.tools.meson import Meson, MesonToolchain\n from conan.tools.scm import Version\n@@ -82,21 +81,20 @@\n         tc.project_options[\"documentation\"] = False\n         if Version(self.version) >= \"1.18.91\":\n             tc.project_options[\"scanner\"] = True\n-\n-            # Generate PC files for the tool_requires wayland package to ensure wayland-scanner is found for build machine.\n-            if cross_building(self):\n-                native_generators_folder = os.path.join(self.generators_folder, \"native\")\n-                mkdir(self, native_generators_folder)\n-                for target in [\"wayland\", \"expat\", \"libxml2\", \"libiconv\"]:\n-                    for pc_name, pc_content in get_pc_files_and_content(self, self.dependencies.build[target]).items():\n-                        save(self, os.path.join(native_generators_folder, pc_name), pc_content)\n-                tc.project_options[\"build.pkg_config_path\"] = native_generators_folder\n         tc.generate()\n \n     def _patch_sources(self):\n         replace_in_file(self, os.path.join(self.source_folder, \"meson.build\"),\n                         \"subdir('tests')\", \"#subdir('tests')\")\n \n+        if cross_building(self):\n+            replace_in_file(self, f\"{self.source_folder}/src/meson.build\",\n+                            \"scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())\",\n+                                \"# scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())\")\n+            replace_in_file(self, f\"{self.source_folder}/src/meson.build\",\n+                            \"wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))\",\n+                                \"wayland_scanner_for_build = find_program('wayland-scanner')\")\n+\n     def build(self):\n         self._patch_sources()\n         meson = Meson(self)\n", "issue": "[package] wayland/all: incompatible with latest (1.52.0) Conan version\n### Package and Environment Details\n\n* Package Name/Version: **wayland/1.20.0**\r\n* Conan version: **conan 1.52.0**\n\n### Conan profile\n\n_No response_\n\n### Steps to reproduce\n\nconan export recipes/wayland/all wayland/1.20.0@\n\n### Logs\n\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nFile \"recipes/wayland/all/conanfile.py\", line 5, in <module>\r\n    from conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content\r\nModuleNotFoundError: No module named 'conan.tools.gnu.pkgconfigdeps.pc_files_creator'; 'conan.tools.gnu.pkgconfigdeps' is not a package\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conan import ConanFile\nfrom conan.errors import ConanInvalidConfiguration\nfrom conan.tools.build import cross_building\nfrom conan.tools.files import copy, get, mkdir, replace_in_file, rmdir, save\nfrom conan.tools.gnu.pkgconfigdeps.pc_files_creator import get_pc_files_and_content\nfrom conan.tools.layout import basic_layout\nfrom conan.tools.meson import Meson, MesonToolchain\nfrom conan.tools.scm import Version\nimport os\n\nrequired_conan_version = \">=1.50.0\"\n\n\nclass WaylandConan(ConanFile):\n    name = \"wayland\"\n    description = (\n        \"Wayland is a project to define a protocol for a compositor to talk to \"\n        \"its clients as well as a library implementation of the protocol\"\n    )\n    topics = (\"protocol\", \"compositor\", \"display\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://wayland.freedesktop.org\"\n    license = \"MIT\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_libraries\": [True, False],\n        \"enable_dtd_validation\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_libraries\": True,\n        \"enable_dtd_validation\": True,\n    }\n\n    generators = \"PkgConfigDeps\", \"VirtualBuildEnv\", \"VirtualRunEnv\"\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        try:\n           del self.settings.compiler.libcxx\n        except Exception:\n           pass\n        try:\n           del self.settings.compiler.cppstd\n        except Exception:\n           pass\n\n    def requirements(self):\n        if self.options.enable_libraries:\n            self.requires(\"libffi/3.4.2\")\n        if self.options.enable_dtd_validation:\n            self.requires(\"libxml2/2.9.14\")\n        self.requires(\"expat/2.4.8\")\n\n    def validate(self):\n        if self.info.settings.os != \"Linux\":\n            raise ConanInvalidConfiguration(\"Wayland can be built on Linux only\")\n\n    def build_requirements(self):\n        self.tool_requires(\"meson/0.63.1\")\n        self.tool_requires(\"pkgconf/1.7.4\")\n        if cross_building(self):\n            self.tool_requires(self.ref)\n\n    def layout(self):\n        basic_layout(self, src_folder=\"src\")\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version], strip_root=True)\n\n    def generate(self):\n        tc = MesonToolchain(self)\n        tc.project_options[\"libdir\"] = \"lib\"\n        tc.project_options[\"datadir\"] = \"res\"\n        tc.project_options[\"libraries\"] = self.options.enable_libraries\n        tc.project_options[\"dtd_validation\"] = self.options.enable_dtd_validation\n        tc.project_options[\"documentation\"] = False\n        if Version(self.version) >= \"1.18.91\":\n            tc.project_options[\"scanner\"] = True\n\n            # Generate PC files for the tool_requires wayland package to ensure wayland-scanner is found for build machine.\n            if cross_building(self):\n                native_generators_folder = os.path.join(self.generators_folder, \"native\")\n                mkdir(self, native_generators_folder)\n                for target in [\"wayland\", \"expat\", \"libxml2\", \"libiconv\"]:\n                    for pc_name, pc_content in get_pc_files_and_content(self, self.dependencies.build[target]).items():\n                        save(self, os.path.join(native_generators_folder, pc_name), pc_content)\n                tc.project_options[\"build.pkg_config_path\"] = native_generators_folder\n        tc.generate()\n\n    def _patch_sources(self):\n        replace_in_file(self, os.path.join(self.source_folder, \"meson.build\"),\n                        \"subdir('tests')\", \"#subdir('tests')\")\n\n    def build(self):\n        self._patch_sources()\n        meson = Meson(self)\n        meson.configure()\n        meson.build()\n\n    def package(self):\n        copy(self, \"COPYING\", src=self.source_folder, dst=os.path.join(self.package_folder, \"licenses\"))\n        meson = Meson(self)\n        meson.install()\n        pkg_config_dir = os.path.join(self.package_folder, \"lib\", \"pkgconfig\")\n        rmdir(self, pkg_config_dir)\n\n    def package_info(self):\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\"pkg_config_name\", \"wayland-scanner\")\n        self.cpp_info.components[\"wayland-scanner\"].names[\"pkg_config\"] = \"wayland-scanner\"\n        self.cpp_info.components[\"wayland-scanner\"].resdirs = [\"res\"]\n\n        self.cpp_info.components[\"wayland-scanner\"].includedirs = []\n        self.cpp_info.components[\"wayland-scanner\"].libdirs = []\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\"component_version\", self.version)\n\n        self.cpp_info.components[\"wayland-scanner\"].requires = [\"expat::expat\"]\n        if self.options.enable_dtd_validation:\n            self.cpp_info.components[\"wayland-scanner\"].requires.append(\"libxml2::libxml2\")\n        pkgconfig_variables = {\n            'datarootdir': '${prefix}/res',\n            'pkgdatadir': '${datarootdir}/wayland',\n            'bindir': '${prefix}/bin',\n            'wayland_scanner': '${bindir}/wayland-scanner',\n        }\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\n            \"pkg_config_custom_content\",\n            \"\\n\".join(f\"{key}={value}\" for key,value in pkgconfig_variables.items()))\n\n        bindir = os.path.join(self.package_folder, \"bin\")\n        self.buildenv_info.prepend_path(\"PATH\", bindir)\n        self.runenv_info.prepend_path(\"PATH\", bindir)\n        # TODO: Remove in Conan 2.0 where Environment class will be required.\n        self.output.info(\"Appending PATH environment variable: {}\".format(bindir))\n        self.env_info.PATH.append(bindir)\n\n        if self.options.enable_libraries:\n            self.cpp_info.components[\"wayland-server\"].libs = [\"wayland-server\"]\n            self.cpp_info.components[\"wayland-server\"].set_property(\"pkg_config_name\", \"wayland-server\")\n            self.cpp_info.components[\"wayland-server\"].names[\"pkg_config\"] = \"wayland-server\"\n            self.cpp_info.components[\"wayland-server\"].requires = [\"libffi::libffi\"]\n            self.cpp_info.components[\"wayland-server\"].system_libs = [\"pthread\", \"m\"]\n            self.cpp_info.components[\"wayland-server\"].resdirs = [\"res\"]\n            if self.version >= Version(\"1.21.0\") and self.settings.os == \"Linux\":\n                self.cpp_info.components[\"wayland-server\"].system_libs += [\"rt\"]\n            self.cpp_info.components[\"wayland-server\"].set_property(\"component_version\", self.version)\n\n            pkgconfig_variables = {\n                'datarootdir': '${prefix}/res',\n                'pkgdatadir': '${datarootdir}/wayland',\n            }\n            self.cpp_info.components[\"wayland-server\"].set_property(\n                \"pkg_config_custom_content\",\n                \"\\n\".join(f\"{key}={value}\" for key, value in pkgconfig_variables.items()))\n\n            self.cpp_info.components[\"wayland-client\"].libs = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-client\"].set_property(\"pkg_config_name\", \"wayland-client\")\n            self.cpp_info.components[\"wayland-client\"].names[\"pkg_config\"] = \"wayland-client\"\n            self.cpp_info.components[\"wayland-client\"].requires = [\"libffi::libffi\"]\n            self.cpp_info.components[\"wayland-client\"].system_libs = [\"pthread\", \"m\"]\n            self.cpp_info.components[\"wayland-client\"].resdirs = [\"res\"]\n            if self.version >= Version(\"1.21.0\") and self.settings.os == \"Linux\":\n                self.cpp_info.components[\"wayland-client\"].system_libs += [\"rt\"]\n            self.cpp_info.components[\"wayland-client\"].set_property(\"component_version\", self.version)\n\n            pkgconfig_variables = {\n                'datarootdir': '${prefix}/res',\n                'pkgdatadir': '${datarootdir}/wayland',\n            }\n            self.cpp_info.components[\"wayland-client\"].set_property(\n                \"pkg_config_custom_content\",\n                \"\\n\".join(f\"{key}={value}\" for key, value in pkgconfig_variables.items()))\n\n            self.cpp_info.components[\"wayland-cursor\"].libs = [\"wayland-cursor\"]\n            self.cpp_info.components[\"wayland-cursor\"].set_property(\"pkg_config_name\", \"wayland-cursor\")\n            self.cpp_info.components[\"wayland-cursor\"].names[\"pkg_config\"] = \"wayland-cursor\"\n            self.cpp_info.components[\"wayland-cursor\"].requires = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-cursor\"].set_property(\"component_version\", self.version)\n\n            self.cpp_info.components[\"wayland-egl\"].libs = [\"wayland-egl\"]\n            self.cpp_info.components[\"wayland-egl\"].set_property(\"pkg_config_name\", \"wayland-egl\")\n            self.cpp_info.components[\"wayland-egl\"].names[\"pkg_config\"] = \"wayland-egl\"\n            self.cpp_info.components[\"wayland-egl\"].requires = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-egl\"].set_property(\"component_version\", \"18.1.0\")\n\n            self.cpp_info.components[\"wayland-egl-backend\"].names[\"pkg_config\"] = \"wayland-egl-backend\"\n            self.cpp_info.components[\"wayland-egl-backend\"].set_property(\"pkg_config_name\", \"wayland-egl-backend\")\n            self.cpp_info.components[\"wayland-egl-backend\"].set_property(\"component_version\", \"3\")\n\n            bindir = os.path.join(self.package_folder, \"bin\")\n            self.output.info(\"Appending PATH environment variable: {}\".format(bindir))\n            self.env_info.PATH.append(bindir)\n", "path": "recipes/wayland/all/conanfile.py"}], "after_files": [{"content": "from conan import ConanFile\nfrom conan.errors import ConanInvalidConfiguration\nfrom conan.tools.build import cross_building\nfrom conan.tools.files import copy, get, replace_in_file, rmdir\nfrom conan.tools.layout import basic_layout\nfrom conan.tools.meson import Meson, MesonToolchain\nfrom conan.tools.scm import Version\nimport os\n\nrequired_conan_version = \">=1.50.0\"\n\n\nclass WaylandConan(ConanFile):\n    name = \"wayland\"\n    description = (\n        \"Wayland is a project to define a protocol for a compositor to talk to \"\n        \"its clients as well as a library implementation of the protocol\"\n    )\n    topics = (\"protocol\", \"compositor\", \"display\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://wayland.freedesktop.org\"\n    license = \"MIT\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_libraries\": [True, False],\n        \"enable_dtd_validation\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_libraries\": True,\n        \"enable_dtd_validation\": True,\n    }\n\n    generators = \"PkgConfigDeps\", \"VirtualBuildEnv\", \"VirtualRunEnv\"\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        try:\n           del self.settings.compiler.libcxx\n        except Exception:\n           pass\n        try:\n           del self.settings.compiler.cppstd\n        except Exception:\n           pass\n\n    def requirements(self):\n        if self.options.enable_libraries:\n            self.requires(\"libffi/3.4.2\")\n        if self.options.enable_dtd_validation:\n            self.requires(\"libxml2/2.9.14\")\n        self.requires(\"expat/2.4.8\")\n\n    def validate(self):\n        if self.info.settings.os != \"Linux\":\n            raise ConanInvalidConfiguration(\"Wayland can be built on Linux only\")\n\n    def build_requirements(self):\n        self.tool_requires(\"meson/0.63.1\")\n        self.tool_requires(\"pkgconf/1.7.4\")\n        if cross_building(self):\n            self.tool_requires(self.ref)\n\n    def layout(self):\n        basic_layout(self, src_folder=\"src\")\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version], strip_root=True)\n\n    def generate(self):\n        tc = MesonToolchain(self)\n        tc.project_options[\"libdir\"] = \"lib\"\n        tc.project_options[\"datadir\"] = \"res\"\n        tc.project_options[\"libraries\"] = self.options.enable_libraries\n        tc.project_options[\"dtd_validation\"] = self.options.enable_dtd_validation\n        tc.project_options[\"documentation\"] = False\n        if Version(self.version) >= \"1.18.91\":\n            tc.project_options[\"scanner\"] = True\n        tc.generate()\n\n    def _patch_sources(self):\n        replace_in_file(self, os.path.join(self.source_folder, \"meson.build\"),\n                        \"subdir('tests')\", \"#subdir('tests')\")\n\n        if cross_building(self):\n            replace_in_file(self, f\"{self.source_folder}/src/meson.build\",\n                            \"scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())\",\n                                \"# scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())\")\n            replace_in_file(self, f\"{self.source_folder}/src/meson.build\",\n                            \"wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))\",\n                                \"wayland_scanner_for_build = find_program('wayland-scanner')\")\n\n    def build(self):\n        self._patch_sources()\n        meson = Meson(self)\n        meson.configure()\n        meson.build()\n\n    def package(self):\n        copy(self, \"COPYING\", src=self.source_folder, dst=os.path.join(self.package_folder, \"licenses\"))\n        meson = Meson(self)\n        meson.install()\n        pkg_config_dir = os.path.join(self.package_folder, \"lib\", \"pkgconfig\")\n        rmdir(self, pkg_config_dir)\n\n    def package_info(self):\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\"pkg_config_name\", \"wayland-scanner\")\n        self.cpp_info.components[\"wayland-scanner\"].names[\"pkg_config\"] = \"wayland-scanner\"\n        self.cpp_info.components[\"wayland-scanner\"].resdirs = [\"res\"]\n\n        self.cpp_info.components[\"wayland-scanner\"].includedirs = []\n        self.cpp_info.components[\"wayland-scanner\"].libdirs = []\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\"component_version\", self.version)\n\n        self.cpp_info.components[\"wayland-scanner\"].requires = [\"expat::expat\"]\n        if self.options.enable_dtd_validation:\n            self.cpp_info.components[\"wayland-scanner\"].requires.append(\"libxml2::libxml2\")\n        pkgconfig_variables = {\n            'datarootdir': '${prefix}/res',\n            'pkgdatadir': '${datarootdir}/wayland',\n            'bindir': '${prefix}/bin',\n            'wayland_scanner': '${bindir}/wayland-scanner',\n        }\n        self.cpp_info.components[\"wayland-scanner\"].set_property(\n            \"pkg_config_custom_content\",\n            \"\\n\".join(f\"{key}={value}\" for key,value in pkgconfig_variables.items()))\n\n        bindir = os.path.join(self.package_folder, \"bin\")\n        self.buildenv_info.prepend_path(\"PATH\", bindir)\n        self.runenv_info.prepend_path(\"PATH\", bindir)\n        # TODO: Remove in Conan 2.0 where Environment class will be required.\n        self.output.info(\"Appending PATH environment variable: {}\".format(bindir))\n        self.env_info.PATH.append(bindir)\n\n        if self.options.enable_libraries:\n            self.cpp_info.components[\"wayland-server\"].libs = [\"wayland-server\"]\n            self.cpp_info.components[\"wayland-server\"].set_property(\"pkg_config_name\", \"wayland-server\")\n            self.cpp_info.components[\"wayland-server\"].names[\"pkg_config\"] = \"wayland-server\"\n            self.cpp_info.components[\"wayland-server\"].requires = [\"libffi::libffi\"]\n            self.cpp_info.components[\"wayland-server\"].system_libs = [\"pthread\", \"m\"]\n            self.cpp_info.components[\"wayland-server\"].resdirs = [\"res\"]\n            if self.version >= Version(\"1.21.0\") and self.settings.os == \"Linux\":\n                self.cpp_info.components[\"wayland-server\"].system_libs += [\"rt\"]\n            self.cpp_info.components[\"wayland-server\"].set_property(\"component_version\", self.version)\n\n            pkgconfig_variables = {\n                'datarootdir': '${prefix}/res',\n                'pkgdatadir': '${datarootdir}/wayland',\n            }\n            self.cpp_info.components[\"wayland-server\"].set_property(\n                \"pkg_config_custom_content\",\n                \"\\n\".join(f\"{key}={value}\" for key, value in pkgconfig_variables.items()))\n\n            self.cpp_info.components[\"wayland-client\"].libs = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-client\"].set_property(\"pkg_config_name\", \"wayland-client\")\n            self.cpp_info.components[\"wayland-client\"].names[\"pkg_config\"] = \"wayland-client\"\n            self.cpp_info.components[\"wayland-client\"].requires = [\"libffi::libffi\"]\n            self.cpp_info.components[\"wayland-client\"].system_libs = [\"pthread\", \"m\"]\n            self.cpp_info.components[\"wayland-client\"].resdirs = [\"res\"]\n            if self.version >= Version(\"1.21.0\") and self.settings.os == \"Linux\":\n                self.cpp_info.components[\"wayland-client\"].system_libs += [\"rt\"]\n            self.cpp_info.components[\"wayland-client\"].set_property(\"component_version\", self.version)\n\n            pkgconfig_variables = {\n                'datarootdir': '${prefix}/res',\n                'pkgdatadir': '${datarootdir}/wayland',\n            }\n            self.cpp_info.components[\"wayland-client\"].set_property(\n                \"pkg_config_custom_content\",\n                \"\\n\".join(f\"{key}={value}\" for key, value in pkgconfig_variables.items()))\n\n            self.cpp_info.components[\"wayland-cursor\"].libs = [\"wayland-cursor\"]\n            self.cpp_info.components[\"wayland-cursor\"].set_property(\"pkg_config_name\", \"wayland-cursor\")\n            self.cpp_info.components[\"wayland-cursor\"].names[\"pkg_config\"] = \"wayland-cursor\"\n            self.cpp_info.components[\"wayland-cursor\"].requires = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-cursor\"].set_property(\"component_version\", self.version)\n\n            self.cpp_info.components[\"wayland-egl\"].libs = [\"wayland-egl\"]\n            self.cpp_info.components[\"wayland-egl\"].set_property(\"pkg_config_name\", \"wayland-egl\")\n            self.cpp_info.components[\"wayland-egl\"].names[\"pkg_config\"] = \"wayland-egl\"\n            self.cpp_info.components[\"wayland-egl\"].requires = [\"wayland-client\"]\n            self.cpp_info.components[\"wayland-egl\"].set_property(\"component_version\", \"18.1.0\")\n\n            self.cpp_info.components[\"wayland-egl-backend\"].names[\"pkg_config\"] = \"wayland-egl-backend\"\n            self.cpp_info.components[\"wayland-egl-backend\"].set_property(\"pkg_config_name\", \"wayland-egl-backend\")\n            self.cpp_info.components[\"wayland-egl-backend\"].set_property(\"component_version\", \"3\")\n\n            bindir = os.path.join(self.package_folder, \"bin\")\n            self.output.info(\"Appending PATH environment variable: {}\".format(bindir))\n            self.env_info.PATH.append(bindir)\n", "path": "recipes/wayland/all/conanfile.py"}]}