We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] m4/1.4.19: Fails test_package with latest Conan 2.0
### Description

Trying to build with the latest version of the CCI m4 recipe results in the following error when using Conan 2

> -------- Installing (downloading, building) binaries... --------
> cmake/3.24.2: Already installed!
> m4/1.4.19: Already installed!
> m4/1.4.19: Appending PATH environment variable: /home/marc/.conan2/p/4c23d7e6a6e4b9b7/p/bin
> WARN: The use of 'env_info' is deprecated in Conan 2.0 and will be removed in Conan 2.X. Please, update your recipes unless you are maintaining compatibility with Conan 1.X
> ERROR: m4/1.4.19: 'NoneType' object has no attribute 'append'. No default values are set for components. You are probably trying to manipulate a component attribute in the 'package_info' method without defining it previously
> ERROR: Conan-2.0 test failed for 'm4'

### Package and Environment Details

* Package Name/Version: **m4/1.4.19**
* Operating System+version: **Debian 10**
* Compiler+version: **GCC 8**
* Docker image: **N/A**
* Conan version: **conan 2.0.0-dev beta5+**
* Python version: **Python 3.7.3**


### Conan profile

Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[options]
cmake*:bootstrap=True
[tool_requires]
!openssl*: cmake/3.24.2

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[options]
cmake*:bootstrap=True
[tool_requires]
!openssl*: cmake/3.24.2


### Steps to reproduce

conan-2.0 test -pr:b tools.jinja -pr:h tools.jinja test_package m4/1.4.19

### Logs

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

```
conan-2.0 test -pr:b tools.jinja -pr:h tools.jinja test_package m4/1.4.19

-------- Input profiles --------
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[options]
cmake*:bootstrap=True
[tool_requires]
!openssl*: cmake/3.24.2

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
[options]
cmake*:bootstrap=True
[tool_requires]
!openssl*: cmake/3.24.2


-------- test_package: Computing dependency graph --------
Graph root
    m4/1.4.19 (test package): /tmp/tmp.Hu84j8HryY/m4/test_package/conanfile.py
Build requirements
    cmake/3.24.2#623afae5289cadc0b9f11a8f43eae83b - Cache
    m4/1.4.19#d5e4c4ec85145f2a2bfea4bceef5e56a - Cache
    openssl/1.1.1s#b304462aeda9923b735e6b37368c233e - Cache

-------- test_package: Computing necessary packages --------
Build requirements
    cmake/3.24.2#623afae5289cadc0b9f11a8f43eae83b:ccbf287e38142241463d713141c76d0c18207a9d#5e10a6d92143344f25472aa9178b24fc - Cache
    m4/1.4.19#d5e4c4ec85145f2a2bfea4bceef5e56a:3593751651824fb813502c69c971267624ced41a#028e06b2ec8f151ba5ee47e640cc2c5c - Cache
    openssl/1.1.1s#b304462aeda9923b735e6b37368c233e:896855b1e3b5961bfcc08e699116d9ed588cac00#7fbe50a5f635dbba8a47e75cf8b42165 - Skip

-------- test_package: Installing packages --------

-------- Installing (downloading, building) binaries... --------
cmake/3.24.2: Already installed!
m4/1.4.19: Already installed!
m4/1.4.19: Appending PATH environment variable: /home/marc/.conan2/p/4c23d7e6a6e4b9b7/p/bin
WARN: The use of 'env_info' is deprecated in Conan 2.0 and will be removed in Conan 2.X. Please, update your recipes unless you are maintaining compatibility with Conan 1.X
ERROR: m4/1.4.19: 'NoneType' object has no attribute 'append'. No default values are set for components. You are probably trying to manipulate a component attribute in the 'package_info' method without defining it previously
ERROR: Conan-2.0 test failed for 'm4'
```

</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/m4/all/conanfile.py`
Content:
```
1 from conan import ConanFile
2 from conan.tools.env import VirtualBuildEnv
3 from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save
4 from conan.tools.gnu import Autotools, AutotoolsToolchain
5 from conan.tools.layout import basic_layout
6 from conan.tools.microsoft import is_msvc, unix_path
7 from conan.tools.scm import Version
8 import os
9 
10 required_conan_version = ">=1.52.0"
11 
12 
13 class M4Conan(ConanFile):
14     name = "m4"
15     description = "GNU M4 is an implementation of the traditional Unix macro processor"
16     topics = ("macro", "preprocessor")
17     homepage = "https://www.gnu.org/software/m4/"
18     url = "https://github.com/conan-io/conan-center-index"
19     license = "GPL-3.0-only"
20     settings = "os", "arch", "compiler", "build_type"
21 
22     @property
23     def _settings_build(self):
24         return getattr(self, "settings_build", self.settings)
25 
26     def export_sources(self):
27         export_conandata_patches(self)
28 
29     def layout(self):
30         basic_layout(self, src_folder="src")
31 
32     def package_id(self):
33         del self.info.settings.compiler
34 
35     def build_requirements(self):
36         if self._settings_build.os == "Windows":
37             if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
38                 self.tool_requires("msys2/cci.latest")
39             self.win_bash = True
40 
41     def source(self):
42         get(self, **self.conan_data["sources"][self.version],
43             destination=self.source_folder, strip_root=True)
44 
45     def generate(self):
46         env = VirtualBuildEnv(self)
47         env.generate()
48 
49         tc = AutotoolsToolchain(self)
50         if is_msvc(self):
51             tc.extra_cflags.append("-FS")
52             # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug
53             # Visual Studio does not support the %n format flag:
54             # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions
55             # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,
56             # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.
57             tc.configure_args.extend([
58                 "gl_cv_func_printf_directive_n=no",
59                 "gl_cv_func_snprintf_directive_n=no",
60                 "gl_cv_func_snprintf_directive_n=no",
61             ])
62             if self.settings.build_type in ("Debug", "RelWithDebInfo"):
63                 tc.extra_ldflags.append("-PDB")
64         elif self.settings.compiler == "clang":
65             if Version(self.version) < "1.4.19":
66                 tc.extra_cflags.extend([
67                     "-rtlib=compiler-rt",
68                     "-Wno-unused-command-line-argument",
69                 ])
70         if self.settings.os == "Windows":
71             tc.configure_args.append("ac_cv_func__set_invalid_parameter_handler=yes")
72         env = tc.environment()
73         # help2man trick
74         env.prepend_path("PATH", self.source_folder)
75         # handle msvc
76         if is_msvc(self):
77             ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib"))
78             env.define("CC", "cl -nologo")
79             env.define("CXX", "cl -nologo")
80             env.define("AR", f"{ar_wrapper} lib")
81             env.define("LD", "link")
82             env.define("NM", "dumpbin -symbols")
83             env.define("OBJDUMP", ":")
84             env.define("RANLIB", ":")
85             env.define("STRIP", ":")
86         tc.generate(env)
87 
88     def _patch_sources(self):
89         apply_conandata_patches(self)
90         # dummy file for configure
91         help2man = os.path.join(self.source_folder, "help2man")
92         save(self, help2man, "#!/usr/bin/env bash\n:")
93         if os.name == "posix":
94             os.chmod(help2man, os.stat(help2man).st_mode | 0o111)
95 
96     def build(self):
97         self._patch_sources()
98         autotools = Autotools(self)
99         autotools.configure()
100         autotools.make()
101 
102     def package(self):
103         copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
104         autotools = Autotools(self)
105         # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed
106         autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"])
107         rmdir(self, os.path.join(self.package_folder, "share"))
108 
109     def package_info(self):
110         self.cpp_info.libdirs = []
111         self.cpp_info.includedirs = []
112 
113         # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path
114         bin_ext = ".exe" if self.settings.os == "Windows" else ""
115         m4_bin = os.path.join(self.package_folder, "bin", f"m4{bin_ext}").replace("\\", "/")
116         self.runenv_info.define_path("M4", m4_bin)
117         self.buildenv_info.define_path("M4", m4_bin)
118 
119         # TODO: to remove in conan v2
120         bin_path = os.path.join(self.package_folder, "bin")
121         self.output.info(f"Appending PATH environment variable: {bin_path}")
122         self.env_info.PATH.append(bin_path)
123         self.env_info.M4 = m4_bin
124
```
--- 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/m4/all/conanfile.py b/recipes/m4/all/conanfile.py
--- a/recipes/m4/all/conanfile.py
+++ b/recipes/m4/all/conanfile.py
@@ -6,12 +6,14 @@
 from conan.tools.microsoft import is_msvc, unix_path
 from conan.tools.scm import Version
 import os
+import shutil
 
-required_conan_version = ">=1.52.0"
+required_conan_version = ">=1.55.0"
 
 
 class M4Conan(ConanFile):
     name = "m4"
+    package_type = "application"
     description = "GNU M4 is an implementation of the traditional Unix macro processor"
     topics = ("macro", "preprocessor")
     homepage = "https://www.gnu.org/software/m4/"
@@ -34,9 +36,9 @@
 
     def build_requirements(self):
         if self._settings_build.os == "Windows":
-            if not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
-                self.tool_requires("msys2/cci.latest")
             self.win_bash = True
+            if not self.conf.get("tools.microsoft.bash:path", check_type=str):
+                self.tool_requires("msys2/cci.latest")
 
     def source(self):
         get(self, **self.conan_data["sources"][self.version],
@@ -87,11 +89,12 @@
 
     def _patch_sources(self):
         apply_conandata_patches(self)
-        # dummy file for configure
-        help2man = os.path.join(self.source_folder, "help2man")
-        save(self, help2man, "#!/usr/bin/env bash\n:")
-        if os.name == "posix":
-            os.chmod(help2man, os.stat(help2man).st_mode | 0o111)
+        if shutil.which("help2man") == None:
+            # dummy file for configure
+            help2man = os.path.join(self.source_folder, "help2man")
+            save(self, help2man, "#!/usr/bin/env bash\n:")
+            if os.name == "posix":
+                os.chmod(help2man, os.stat(help2man).st_mode | 0o111)
 
     def build(self):
         self._patch_sources()
@@ -102,8 +105,7 @@
     def package(self):
         copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
         autotools = Autotools(self)
-        # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed
-        autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"])
+        autotools.install()
         rmdir(self, os.path.join(self.package_folder, "share"))
 
     def package_info(self):

{"golden_diff": "diff --git a/recipes/m4/all/conanfile.py b/recipes/m4/all/conanfile.py\n--- a/recipes/m4/all/conanfile.py\n+++ b/recipes/m4/all/conanfile.py\n@@ -6,12 +6,14 @@\n from conan.tools.microsoft import is_msvc, unix_path\n from conan.tools.scm import Version\n import os\n+import shutil\n \n-required_conan_version = \">=1.52.0\"\n+required_conan_version = \">=1.55.0\"\n \n \n class M4Conan(ConanFile):\n     name = \"m4\"\n+    package_type = \"application\"\n     description = \"GNU M4 is an implementation of the traditional Unix macro processor\"\n     topics = (\"macro\", \"preprocessor\")\n     homepage = \"https://www.gnu.org/software/m4/\"\n@@ -34,9 +36,9 @@\n \n     def build_requirements(self):\n         if self._settings_build.os == \"Windows\":\n-            if not self.conf.get(\"tools.microsoft.bash:path\", default=False, check_type=bool):\n-                self.tool_requires(\"msys2/cci.latest\")\n             self.win_bash = True\n+            if not self.conf.get(\"tools.microsoft.bash:path\", check_type=str):\n+                self.tool_requires(\"msys2/cci.latest\")\n \n     def source(self):\n         get(self, **self.conan_data[\"sources\"][self.version],\n@@ -87,11 +89,12 @@\n \n     def _patch_sources(self):\n         apply_conandata_patches(self)\n-        # dummy file for configure\n-        help2man = os.path.join(self.source_folder, \"help2man\")\n-        save(self, help2man, \"#!/usr/bin/env bash\\n:\")\n-        if os.name == \"posix\":\n-            os.chmod(help2man, os.stat(help2man).st_mode | 0o111)\n+        if shutil.which(\"help2man\") == None:\n+            # dummy file for configure\n+            help2man = os.path.join(self.source_folder, \"help2man\")\n+            save(self, help2man, \"#!/usr/bin/env bash\\n:\")\n+            if os.name == \"posix\":\n+                os.chmod(help2man, os.stat(help2man).st_mode | 0o111)\n \n     def build(self):\n         self._patch_sources()\n@@ -102,8 +105,7 @@\n     def package(self):\n         copy(self, \"COPYING\", src=self.source_folder, dst=os.path.join(self.package_folder, \"licenses\"))\n         autotools = Autotools(self)\n-        # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed\n-        autotools.install(args=[f\"DESTDIR={unix_path(self, self.package_folder)}\"])\n+        autotools.install()\n         rmdir(self, os.path.join(self.package_folder, \"share\"))\n \n     def package_info(self):\n", "issue": "[package] m4/1.4.19: Fails test_package with latest Conan 2.0\n### Description\n\nTrying to build with the latest version of the CCI m4 recipe results in the following error when using Conan 2\r\n\r\n> -------- Installing (downloading, building) binaries... --------\r\n> cmake/3.24.2: Already installed!\r\n> m4/1.4.19: Already installed!\r\n> m4/1.4.19: Appending PATH environment variable: /home/marc/.conan2/p/4c23d7e6a6e4b9b7/p/bin\r\n> WARN: The use of 'env_info' is deprecated in Conan 2.0 and will be removed in Conan 2.X. Please, update your recipes unless you are maintaining compatibility with Conan 1.X\r\n> ERROR: m4/1.4.19: 'NoneType' object has no attribute 'append'. No default values are set for components. You are probably trying to manipulate a component attribute in the 'package_info' method without defining it previously\r\n> ERROR: Conan-2.0 test failed for 'm4'\n\n### Package and Environment Details\n\n* Package Name/Version: **m4/1.4.19**\r\n* Operating System+version: **Debian 10**\r\n* Compiler+version: **GCC 8**\r\n* Docker image: **N/A**\r\n* Conan version: **conan 2.0.0-dev beta5+**\r\n* Python version: **Python 3.7.3**\r\n\n\n### Conan profile\n\nProfile host:\r\n[settings]\r\narch=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++11\r\ncompiler.version=8\r\nos=Linux\r\n[options]\r\ncmake*:bootstrap=True\r\n[tool_requires]\r\n!openssl*: cmake/3.24.2\r\n\r\nProfile build:\r\n[settings]\r\narch=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++11\r\ncompiler.version=8\r\nos=Linux\r\n[options]\r\ncmake*:bootstrap=True\r\n[tool_requires]\r\n!openssl*: cmake/3.24.2\r\n\n\n### Steps to reproduce\n\nconan-2.0 test -pr:b tools.jinja -pr:h tools.jinja test_package m4/1.4.19\n\n### Logs\n\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nconan-2.0 test -pr:b tools.jinja -pr:h tools.jinja test_package m4/1.4.19\r\n\r\n-------- Input profiles --------\r\nProfile host:\r\n[settings]\r\narch=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++11\r\ncompiler.version=8\r\nos=Linux\r\n[options]\r\ncmake*:bootstrap=True\r\n[tool_requires]\r\n!openssl*: cmake/3.24.2\r\n\r\nProfile build:\r\n[settings]\r\narch=x86_64\r\nbuild_type=Release\r\ncompiler=gcc\r\ncompiler.libcxx=libstdc++11\r\ncompiler.version=8\r\nos=Linux\r\n[options]\r\ncmake*:bootstrap=True\r\n[tool_requires]\r\n!openssl*: cmake/3.24.2\r\n\r\n\r\n-------- test_package: Computing dependency graph --------\r\nGraph root\r\n    m4/1.4.19 (test package): /tmp/tmp.Hu84j8HryY/m4/test_package/conanfile.py\r\nBuild requirements\r\n    cmake/3.24.2#623afae5289cadc0b9f11a8f43eae83b - Cache\r\n    m4/1.4.19#d5e4c4ec85145f2a2bfea4bceef5e56a - Cache\r\n    openssl/1.1.1s#b304462aeda9923b735e6b37368c233e - Cache\r\n\r\n-------- test_package: Computing necessary packages --------\r\nBuild requirements\r\n    cmake/3.24.2#623afae5289cadc0b9f11a8f43eae83b:ccbf287e38142241463d713141c76d0c18207a9d#5e10a6d92143344f25472aa9178b24fc - Cache\r\n    m4/1.4.19#d5e4c4ec85145f2a2bfea4bceef5e56a:3593751651824fb813502c69c971267624ced41a#028e06b2ec8f151ba5ee47e640cc2c5c - Cache\r\n    openssl/1.1.1s#b304462aeda9923b735e6b37368c233e:896855b1e3b5961bfcc08e699116d9ed588cac00#7fbe50a5f635dbba8a47e75cf8b42165 - Skip\r\n\r\n-------- test_package: Installing packages --------\r\n\r\n-------- Installing (downloading, building) binaries... --------\r\ncmake/3.24.2: Already installed!\r\nm4/1.4.19: Already installed!\r\nm4/1.4.19: Appending PATH environment variable: /home/marc/.conan2/p/4c23d7e6a6e4b9b7/p/bin\r\nWARN: The use of 'env_info' is deprecated in Conan 2.0 and will be removed in Conan 2.X. Please, update your recipes unless you are maintaining compatibility with Conan 1.X\r\nERROR: m4/1.4.19: 'NoneType' object has no attribute 'append'. No default values are set for components. You are probably trying to manipulate a component attribute in the 'package_info' method without defining it previously\r\nERROR: Conan-2.0 test failed for 'm4'\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conan import ConanFile\nfrom conan.tools.env import VirtualBuildEnv\nfrom conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save\nfrom conan.tools.gnu import Autotools, AutotoolsToolchain\nfrom conan.tools.layout import basic_layout\nfrom conan.tools.microsoft import is_msvc, unix_path\nfrom conan.tools.scm import Version\nimport os\n\nrequired_conan_version = \">=1.52.0\"\n\n\nclass M4Conan(ConanFile):\n    name = \"m4\"\n    description = \"GNU M4 is an implementation of the traditional Unix macro processor\"\n    topics = (\"macro\", \"preprocessor\")\n    homepage = \"https://www.gnu.org/software/m4/\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"GPL-3.0-only\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n\n    @property\n    def _settings_build(self):\n        return getattr(self, \"settings_build\", self.settings)\n\n    def export_sources(self):\n        export_conandata_patches(self)\n\n    def layout(self):\n        basic_layout(self, src_folder=\"src\")\n\n    def package_id(self):\n        del self.info.settings.compiler\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\":\n            if not self.conf.get(\"tools.microsoft.bash:path\", default=False, check_type=bool):\n                self.tool_requires(\"msys2/cci.latest\")\n            self.win_bash = True\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version],\n            destination=self.source_folder, strip_root=True)\n\n    def generate(self):\n        env = VirtualBuildEnv(self)\n        env.generate()\n\n        tc = AutotoolsToolchain(self)\n        if is_msvc(self):\n            tc.extra_cflags.append(\"-FS\")\n            # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug\n            # Visual Studio does not support the %n format flag:\n            # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions\n            # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,\n            # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.\n            tc.configure_args.extend([\n                \"gl_cv_func_printf_directive_n=no\",\n                \"gl_cv_func_snprintf_directive_n=no\",\n                \"gl_cv_func_snprintf_directive_n=no\",\n            ])\n            if self.settings.build_type in (\"Debug\", \"RelWithDebInfo\"):\n                tc.extra_ldflags.append(\"-PDB\")\n        elif self.settings.compiler == \"clang\":\n            if Version(self.version) < \"1.4.19\":\n                tc.extra_cflags.extend([\n                    \"-rtlib=compiler-rt\",\n                    \"-Wno-unused-command-line-argument\",\n                ])\n        if self.settings.os == \"Windows\":\n            tc.configure_args.append(\"ac_cv_func__set_invalid_parameter_handler=yes\")\n        env = tc.environment()\n        # help2man trick\n        env.prepend_path(\"PATH\", self.source_folder)\n        # handle msvc\n        if is_msvc(self):\n            ar_wrapper = unix_path(self, os.path.join(self.source_folder, \"build-aux\", \"ar-lib\"))\n            env.define(\"CC\", \"cl -nologo\")\n            env.define(\"CXX\", \"cl -nologo\")\n            env.define(\"AR\", f\"{ar_wrapper} lib\")\n            env.define(\"LD\", \"link\")\n            env.define(\"NM\", \"dumpbin -symbols\")\n            env.define(\"OBJDUMP\", \":\")\n            env.define(\"RANLIB\", \":\")\n            env.define(\"STRIP\", \":\")\n        tc.generate(env)\n\n    def _patch_sources(self):\n        apply_conandata_patches(self)\n        # dummy file for configure\n        help2man = os.path.join(self.source_folder, \"help2man\")\n        save(self, help2man, \"#!/usr/bin/env bash\\n:\")\n        if os.name == \"posix\":\n            os.chmod(help2man, os.stat(help2man).st_mode | 0o111)\n\n    def build(self):\n        self._patch_sources()\n        autotools = Autotools(self)\n        autotools.configure()\n        autotools.make()\n\n    def package(self):\n        copy(self, \"COPYING\", src=self.source_folder, dst=os.path.join(self.package_folder, \"licenses\"))\n        autotools = Autotools(self)\n        # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed\n        autotools.install(args=[f\"DESTDIR={unix_path(self, self.package_folder)}\"])\n        rmdir(self, os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.libdirs = []\n        self.cpp_info.includedirs = []\n\n        # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path\n        bin_ext = \".exe\" if self.settings.os == \"Windows\" else \"\"\n        m4_bin = os.path.join(self.package_folder, \"bin\", f\"m4{bin_ext}\").replace(\"\\\\\", \"/\")\n        self.runenv_info.define_path(\"M4\", m4_bin)\n        self.buildenv_info.define_path(\"M4\", m4_bin)\n\n        # TODO: to remove in conan v2\n        bin_path = os.path.join(self.package_folder, \"bin\")\n        self.output.info(f\"Appending PATH environment variable: {bin_path}\")\n        self.env_info.PATH.append(bin_path)\n        self.env_info.M4 = m4_bin\n", "path": "recipes/m4/all/conanfile.py"}], "after_files": [{"content": "from conan import ConanFile\nfrom conan.tools.env import VirtualBuildEnv\nfrom conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save\nfrom conan.tools.gnu import Autotools, AutotoolsToolchain\nfrom conan.tools.layout import basic_layout\nfrom conan.tools.microsoft import is_msvc, unix_path\nfrom conan.tools.scm import Version\nimport os\nimport shutil\n\nrequired_conan_version = \">=1.55.0\"\n\n\nclass M4Conan(ConanFile):\n    name = \"m4\"\n    package_type = \"application\"\n    description = \"GNU M4 is an implementation of the traditional Unix macro processor\"\n    topics = (\"macro\", \"preprocessor\")\n    homepage = \"https://www.gnu.org/software/m4/\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"GPL-3.0-only\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n\n    @property\n    def _settings_build(self):\n        return getattr(self, \"settings_build\", self.settings)\n\n    def export_sources(self):\n        export_conandata_patches(self)\n\n    def layout(self):\n        basic_layout(self, src_folder=\"src\")\n\n    def package_id(self):\n        del self.info.settings.compiler\n\n    def build_requirements(self):\n        if self._settings_build.os == \"Windows\":\n            self.win_bash = True\n            if not self.conf.get(\"tools.microsoft.bash:path\", check_type=str):\n                self.tool_requires(\"msys2/cci.latest\")\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version],\n            destination=self.source_folder, strip_root=True)\n\n    def generate(self):\n        env = VirtualBuildEnv(self)\n        env.generate()\n\n        tc = AutotoolsToolchain(self)\n        if is_msvc(self):\n            tc.extra_cflags.append(\"-FS\")\n            # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug\n            # Visual Studio does not support the %n format flag:\n            # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions\n            # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string,\n            # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output.\n            tc.configure_args.extend([\n                \"gl_cv_func_printf_directive_n=no\",\n                \"gl_cv_func_snprintf_directive_n=no\",\n                \"gl_cv_func_snprintf_directive_n=no\",\n            ])\n            if self.settings.build_type in (\"Debug\", \"RelWithDebInfo\"):\n                tc.extra_ldflags.append(\"-PDB\")\n        elif self.settings.compiler == \"clang\":\n            if Version(self.version) < \"1.4.19\":\n                tc.extra_cflags.extend([\n                    \"-rtlib=compiler-rt\",\n                    \"-Wno-unused-command-line-argument\",\n                ])\n        if self.settings.os == \"Windows\":\n            tc.configure_args.append(\"ac_cv_func__set_invalid_parameter_handler=yes\")\n        env = tc.environment()\n        # help2man trick\n        env.prepend_path(\"PATH\", self.source_folder)\n        # handle msvc\n        if is_msvc(self):\n            ar_wrapper = unix_path(self, os.path.join(self.source_folder, \"build-aux\", \"ar-lib\"))\n            env.define(\"CC\", \"cl -nologo\")\n            env.define(\"CXX\", \"cl -nologo\")\n            env.define(\"AR\", f\"{ar_wrapper} lib\")\n            env.define(\"LD\", \"link\")\n            env.define(\"NM\", \"dumpbin -symbols\")\n            env.define(\"OBJDUMP\", \":\")\n            env.define(\"RANLIB\", \":\")\n            env.define(\"STRIP\", \":\")\n        tc.generate(env)\n\n    def _patch_sources(self):\n        apply_conandata_patches(self)\n        if shutil.which(\"help2man\") == None:\n            # dummy file for configure\n            help2man = os.path.join(self.source_folder, \"help2man\")\n            save(self, help2man, \"#!/usr/bin/env bash\\n:\")\n            if os.name == \"posix\":\n                os.chmod(help2man, os.stat(help2man).st_mode | 0o111)\n\n    def build(self):\n        self._patch_sources()\n        autotools = Autotools(self)\n        autotools.configure()\n        autotools.make()\n\n    def package(self):\n        copy(self, \"COPYING\", src=self.source_folder, dst=os.path.join(self.package_folder, \"licenses\"))\n        autotools = Autotools(self)\n        autotools.install()\n        rmdir(self, os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.libdirs = []\n        self.cpp_info.includedirs = []\n\n        # M4 environment variable is used by a lot of scripts as a way to override a hard-coded embedded m4 path\n        bin_ext = \".exe\" if self.settings.os == \"Windows\" else \"\"\n        m4_bin = os.path.join(self.package_folder, \"bin\", f\"m4{bin_ext}\").replace(\"\\\\\", \"/\")\n        self.runenv_info.define_path(\"M4\", m4_bin)\n        self.buildenv_info.define_path(\"M4\", m4_bin)\n\n        # TODO: to remove in conan v2\n        bin_path = os.path.join(self.package_folder, \"bin\")\n        self.output.info(f\"Appending PATH environment variable: {bin_path}\")\n        self.env_info.PATH.append(bin_path)\n        self.env_info.M4 = m4_bin\n", "path": "recipes/m4/all/conanfile.py"}]}