We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Letter misprint in jemalloc recipe
https://github.com/conan-io/conan-center-index/blob/a40f8d2e097ffb1f98797011f7694ba7b9efe91d/recipes/jemalloc/all/conanfile.py#L96

Instead of --enable-initial-exec-tld must be --enbal-initial-exec-tls

--- 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/jemalloc/all/conanfile.py`
Content:
```
1 from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 import shutil
5 import string
6 
7 
8 class JemallocConan(ConanFile):
9     name = "jemalloc"
10     description = "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support."
11     url = "https://github.com/conan-io/conan-center-index"
12     license = "BSD-2-Clause"
13     homepage = "http://jemalloc.net/"
14     topics = ("conan", "jemalloc", "malloc", "free")
15     settings = "os", "arch", "compiler", "build_type"
16     options = {
17         "shared": [True, False],
18         "fPIC": [True, False],
19         "prefix": "ANY",
20         "enable_cxx": [True, False],
21         "enable_fill": [True, False],
22         "enable_xmalloc": [True, False],
23         "enable_readlinkat": [True, False],
24         "enable_syscall": [True, False],
25         "enable_lazy_lock": [True, False],
26         "enable_debug_logging": [True, False],
27         "enable_initial_exec_tls": [True, False],
28         "enable_libdl": [True, False],
29     }
30     default_options = {
31         "shared": False,
32         "fPIC": True,
33         "prefix": "",
34         "enable_cxx": True,
35         "enable_fill": True,
36         "enable_xmalloc": False,
37         "enable_readlinkat": False,
38         "enable_syscall": True,
39         "enable_lazy_lock": False,
40         "enable_debug_logging": False,
41         "enable_initial_exec_tls": True,
42         "enable_libdl": True,
43     }
44 
45     _autotools = None
46 
47     _source_subfolder = "source_subfolder"
48 
49     def config_options(self):
50         if self.settings.os == "Windows":
51             del self.options.fPIC
52 
53     def configure(self):
54         if self.options.enable_cxx and \
55                 self.settings.compiler.get_safe("libcxx") == "libc++" and \
56                 self.settings.compiler == "clang" and \
57                 tools.Version(self.settings.compiler.version) < "10":
58             raise ConanInvalidConfiguration("clang and libc++ version {} (< 10) is missing a mutex implementation".format(self.settings.compiler.version))
59         if self.settings.compiler == "Visual Studio" and \
60                 self.options.shared and \
61                 "MT" in self.settings.compiler.runtime:
62             raise ConanInvalidConfiguration("Visual Studio build for shared library with MT runtime is not supported")
63         if self.settings.compiler == "Visual Studio" and self.settings.compiler.version != "15":
64             # https://github.com/jemalloc/jemalloc/issues/1703
65             raise ConanInvalidConfiguration("Only Visual Studio 15 2017 is supported.  Please fix this if other versions are supported")
66         if self.options.shared:
67             del self.options.fPIC
68         if not self.options.enable_cxx:
69             del self.settings.compiler.libcxx
70             del self.settings.compiler.cppstd
71         if self.settings.build_type not in ("Release", "Debug", None):
72             raise ConanInvalidConfiguration("Only Release and Debug build_types are supported")
73         if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"):
74             raise ConanInvalidConfiguration("Unsupported arch")
75 
76     def source(self):
77         tools.get(**self.conan_data["sources"][self.version])
78         os.rename("{}-{}".format(self.name, self.version), self._source_subfolder)
79 
80     def build_requirements(self):
81         if tools.os_info.is_windows and not os.environ.get("CONAN_BASH_PATH", None):
82             self.build_requires("msys2/20200517")
83 
84     @property
85     def _autotools_args(self):
86         conf_args = [
87             "--with-jemalloc-prefix={}".format(self.options.prefix),
88             "--enable-debug" if self.settings.build_type == "Debug" else "--disable-debug",
89             "--enable-cxx" if self.options.enable_cxx else "--disable-cxx",
90             "--enable-fill" if self.options.enable_fill else "--disable-fill",
91             "--enable-xmalloc" if self.options.enable_cxx else "--disable-xmalloc",
92             "--enable-readlinkat" if self.options.enable_readlinkat else "--disable-readlinkat",
93             "--enable-syscall" if self.options.enable_syscall else "--disable-syscall",
94             "--enable-lazy-lock" if self.options.enable_lazy_lock else "--disable-lazy-lock",
95             "--enable-log" if self.options.enable_debug_logging else "--disable-log",
96             "--enable-initial-exec-tld" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls",
97             "--enable-libdl" if self.options.enable_libdl else "--disable-libdl",
98         ]
99         if self.options.shared:
100             conf_args.extend(["--enable-shared", "--disable-static"])
101         else:
102             conf_args.extend(["--disable-shared", "--enable-static"])
103         return conf_args
104 
105     def _configure_autotools(self):
106         if self._autotools:
107             return self._autotools
108         self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
109         self._autotools.configure(args=self._autotools_args, configure_dir=self._source_subfolder)
110         return self._autotools
111 
112     @property
113     def _msvc_build_type(self):
114         build_type = str(self.settings.build_type) or "Release"
115         if not self.options.shared:
116             build_type += "-static"
117         return build_type
118 
119     def _patch_sources(self):
120         if self.settings.os == "Windows":
121             makefile_in = os.path.join(self._source_subfolder, "Makefile.in")
122             tools.replace_in_file(makefile_in,
123                                   "DSO_LDFLAGS = @DSO_LDFLAGS@",
124                                   "DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a")
125             tools.replace_in_file(makefile_in,
126                                   "\t$(INSTALL) -d $(LIBDIR)\n"
127                                   "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)",
128                                   "\t$(INSTALL) -d $(BINDIR)\n"
129                                   "\t$(INSTALL) -d $(LIBDIR)\n"
130                                   "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n"
131                                   "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)")
132 
133     def build(self):
134         self._patch_sources()
135         if self.settings.compiler == "Visual Studio":
136             with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op():
137                 with tools.environment_append({"CC": "cl", "CXX": "cl"}) if self.settings.compiler == "Visual Studio" else tools.no_op():
138                     with tools.chdir(self._source_subfolder):
139                         # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure
140                         self.run("./configure {}".format(" ".join(self._autotools_args)), win_bash=tools.os_info.is_windows)
141             msbuild = MSBuild(self)
142             # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook
143             sln_file = os.path.join(self._source_subfolder, "msvc", "jemalloc_vc2017.sln")
144             msbuild.build(sln_file, targets=["jemalloc"], build_type=self._msvc_build_type)
145         else:
146             autotools = self._configure_autotools()
147             autotools.make()
148 
149     @property
150     def _library_name(self):
151         libname = "jemalloc"
152         if self.settings.compiler == "Visual Studio":
153             if self.options.shared:
154                 if self.settings.build_type == "Debug":
155                     libname += "d"
156             else:
157                 toolset = tools.msvs_toolset(self.settings)
158                 toolset_number = "".join(c for c in toolset if c in string.digits)
159                 libname += "-vc{}-{}".format(toolset_number, self._msvc_build_type)
160         else:
161             if self.settings.os == "Windows":
162                 if not self.options.shared:
163                     libname += "_s"
164             else:
165                 if not self.options.shared and self.options.fPIC:
166                     libname += "_pic"
167         return libname
168 
169     def package(self):
170         self.copy(pattern="COPYING", src=self._source_subfolder, dst="licenses")
171         if self.settings.compiler == "Visual Studio":
172             arch_subdir = {
173                 "x86_64": "x64",
174                 "x86": "x86",
175             }[str(self.settings.arch)]
176             self.copy("*.lib", src=os.path.join(self._source_subfolder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "lib"))
177             self.copy("*.dll", src=os.path.join(self._source_subfolder, "msvc", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, "bin"))
178             self.copy("jemalloc.h", src=os.path.join(self._source_subfolder, "include", "jemalloc"), dst=os.path.join(self.package_folder, "include", "jemalloc"), keep_path=True)
179             shutil.copytree(os.path.join(self._source_subfolder, "include", "msvc_compat"),
180                             os.path.join(self.package_folder, "include", "msvc_compat"))
181         else:
182             autotools = self._configure_autotools()
183             # Use install_lib_XXX and install_include to avoid mixing binaries and dll's
184             autotools.make(target="install_lib_shared" if self.options.shared else "install_lib_static")
185             autotools.make(target="install_include")
186             if self.settings.os == "Windows" and self.settings.compiler == "gcc":
187                 os.rename(os.path.join(self.package_folder, "lib", "{}.lib".format(self._library_name)),
188                           os.path.join(self.package_folder, "lib", "lib{}.a".format(self._library_name)))
189                 if not self.options.shared:
190                     os.unlink(os.path.join(self.package_folder, "lib", "jemalloc.lib"))
191 
192     def package_id(self):
193         if not self.settings.build_type:
194             self.info.settings.build_type = "Release"
195 
196     def package_info(self):
197         self.cpp_info.libs = [self._library_name]
198         self.cpp_info.includedirs = [os.path.join(self.package_folder, "include"),
199                                      os.path.join(self.package_folder, "include", "jemalloc")]
200         if self.settings.compiler == "Visual Studio":
201             self.cpp_info.includedirs.append(os.path.join(self.package_folder, "include", "msvc_compat"))
202         if not self.options.shared:
203             self.cpp_info.defines = ["JEMALLOC_EXPORT="]
204         if self.settings.os == "Linux":
205             self.cpp_info.system_libs.extend(["dl", "pthread", "rt"])
206
```
--- 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/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py
--- a/recipes/jemalloc/all/conanfile.py
+++ b/recipes/jemalloc/all/conanfile.py
@@ -41,6 +41,7 @@
         "enable_initial_exec_tls": True,
         "enable_libdl": True,
     }
+    exports_sources = ["patches/**"]
 
     _autotools = None
 
@@ -72,6 +73,8 @@
             raise ConanInvalidConfiguration("Only Release and Debug build_types are supported")
         if self.settings.compiler == "Visual Studio" and self.settings.arch not in ("x86_64", "x86"):
             raise ConanInvalidConfiguration("Unsupported arch")
+        if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) <= "3.9":
+            raise ConanInvalidConfiguration("Unsupported compiler version")
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
@@ -93,7 +96,7 @@
             "--enable-syscall" if self.options.enable_syscall else "--disable-syscall",
             "--enable-lazy-lock" if self.options.enable_lazy_lock else "--disable-lazy-lock",
             "--enable-log" if self.options.enable_debug_logging else "--disable-log",
-            "--enable-initial-exec-tld" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls",
+            "--enable-initial-exec-tls" if self.options.enable_initial_exec_tls else "--disable-initial-exec-tls",
             "--enable-libdl" if self.options.enable_libdl else "--disable-libdl",
         ]
         if self.options.shared:
@@ -130,6 +133,9 @@
                                   "\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\n"
                                   "\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)")
 
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            tools.patch(**patch)
+
     def build(self):
         self._patch_sources()
         if self.settings.compiler == "Visual Studio":

{"golden_diff": "diff --git a/recipes/jemalloc/all/conanfile.py b/recipes/jemalloc/all/conanfile.py\n--- a/recipes/jemalloc/all/conanfile.py\n+++ b/recipes/jemalloc/all/conanfile.py\n@@ -41,6 +41,7 @@\n         \"enable_initial_exec_tls\": True,\n         \"enable_libdl\": True,\n     }\n+    exports_sources = [\"patches/**\"]\n \n     _autotools = None\n \n@@ -72,6 +73,8 @@\n             raise ConanInvalidConfiguration(\"Only Release and Debug build_types are supported\")\n         if self.settings.compiler == \"Visual Studio\" and self.settings.arch not in (\"x86_64\", \"x86\"):\n             raise ConanInvalidConfiguration(\"Unsupported arch\")\n+        if self.settings.compiler == \"clang\" and tools.Version(self.settings.compiler.version) <= \"3.9\":\n+            raise ConanInvalidConfiguration(\"Unsupported compiler version\")\n \n     def source(self):\n         tools.get(**self.conan_data[\"sources\"][self.version])\n@@ -93,7 +96,7 @@\n             \"--enable-syscall\" if self.options.enable_syscall else \"--disable-syscall\",\n             \"--enable-lazy-lock\" if self.options.enable_lazy_lock else \"--disable-lazy-lock\",\n             \"--enable-log\" if self.options.enable_debug_logging else \"--disable-log\",\n-            \"--enable-initial-exec-tld\" if self.options.enable_initial_exec_tls else \"--disable-initial-exec-tls\",\n+            \"--enable-initial-exec-tls\" if self.options.enable_initial_exec_tls else \"--disable-initial-exec-tls\",\n             \"--enable-libdl\" if self.options.enable_libdl else \"--disable-libdl\",\n         ]\n         if self.options.shared:\n@@ -130,6 +133,9 @@\n                                   \"\\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\\n\"\n                                   \"\\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)\")\n \n+        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n+            tools.patch(**patch)\n+\n     def build(self):\n         self._patch_sources()\n         if self.settings.compiler == \"Visual Studio\":\n", "issue": "Letter misprint in jemalloc recipe\nhttps://github.com/conan-io/conan-center-index/blob/a40f8d2e097ffb1f98797011f7694ba7b9efe91d/recipes/jemalloc/all/conanfile.py#L96\r\n\r\nInstead of --enable-initial-exec-tld must be --enbal-initial-exec-tls\n", "before_files": [{"content": "from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport shutil\nimport string\n\n\nclass JemallocConan(ConanFile):\n    name = \"jemalloc\"\n    description = \"jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"BSD-2-Clause\"\n    homepage = \"http://jemalloc.net/\"\n    topics = (\"conan\", \"jemalloc\", \"malloc\", \"free\")\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"prefix\": \"ANY\",\n        \"enable_cxx\": [True, False],\n        \"enable_fill\": [True, False],\n        \"enable_xmalloc\": [True, False],\n        \"enable_readlinkat\": [True, False],\n        \"enable_syscall\": [True, False],\n        \"enable_lazy_lock\": [True, False],\n        \"enable_debug_logging\": [True, False],\n        \"enable_initial_exec_tls\": [True, False],\n        \"enable_libdl\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"prefix\": \"\",\n        \"enable_cxx\": True,\n        \"enable_fill\": True,\n        \"enable_xmalloc\": False,\n        \"enable_readlinkat\": False,\n        \"enable_syscall\": True,\n        \"enable_lazy_lock\": False,\n        \"enable_debug_logging\": False,\n        \"enable_initial_exec_tls\": True,\n        \"enable_libdl\": True,\n    }\n\n    _autotools = None\n\n    _source_subfolder = \"source_subfolder\"\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.options.enable_cxx and \\\n                self.settings.compiler.get_safe(\"libcxx\") == \"libc++\" and \\\n                self.settings.compiler == \"clang\" and \\\n                tools.Version(self.settings.compiler.version) < \"10\":\n            raise ConanInvalidConfiguration(\"clang and libc++ version {} (< 10) is missing a mutex implementation\".format(self.settings.compiler.version))\n        if self.settings.compiler == \"Visual Studio\" and \\\n                self.options.shared and \\\n                \"MT\" in self.settings.compiler.runtime:\n            raise ConanInvalidConfiguration(\"Visual Studio build for shared library with MT runtime is not supported\")\n        if self.settings.compiler == \"Visual Studio\" and self.settings.compiler.version != \"15\":\n            # https://github.com/jemalloc/jemalloc/issues/1703\n            raise ConanInvalidConfiguration(\"Only Visual Studio 15 2017 is supported.  Please fix this if other versions are supported\")\n        if self.options.shared:\n            del self.options.fPIC\n        if not self.options.enable_cxx:\n            del self.settings.compiler.libcxx\n            del self.settings.compiler.cppstd\n        if self.settings.build_type not in (\"Release\", \"Debug\", None):\n            raise ConanInvalidConfiguration(\"Only Release and Debug build_types are supported\")\n        if self.settings.compiler == \"Visual Studio\" and self.settings.arch not in (\"x86_64\", \"x86\"):\n            raise ConanInvalidConfiguration(\"Unsupported arch\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"{}-{}\".format(self.name, self.version), self._source_subfolder)\n\n    def build_requirements(self):\n        if tools.os_info.is_windows and not os.environ.get(\"CONAN_BASH_PATH\", None):\n            self.build_requires(\"msys2/20200517\")\n\n    @property\n    def _autotools_args(self):\n        conf_args = [\n            \"--with-jemalloc-prefix={}\".format(self.options.prefix),\n            \"--enable-debug\" if self.settings.build_type == \"Debug\" else \"--disable-debug\",\n            \"--enable-cxx\" if self.options.enable_cxx else \"--disable-cxx\",\n            \"--enable-fill\" if self.options.enable_fill else \"--disable-fill\",\n            \"--enable-xmalloc\" if self.options.enable_cxx else \"--disable-xmalloc\",\n            \"--enable-readlinkat\" if self.options.enable_readlinkat else \"--disable-readlinkat\",\n            \"--enable-syscall\" if self.options.enable_syscall else \"--disable-syscall\",\n            \"--enable-lazy-lock\" if self.options.enable_lazy_lock else \"--disable-lazy-lock\",\n            \"--enable-log\" if self.options.enable_debug_logging else \"--disable-log\",\n            \"--enable-initial-exec-tld\" if self.options.enable_initial_exec_tls else \"--disable-initial-exec-tls\",\n            \"--enable-libdl\" if self.options.enable_libdl else \"--disable-libdl\",\n        ]\n        if self.options.shared:\n            conf_args.extend([\"--enable-shared\", \"--disable-static\"])\n        else:\n            conf_args.extend([\"--disable-shared\", \"--enable-static\"])\n        return conf_args\n\n    def _configure_autotools(self):\n        if self._autotools:\n            return self._autotools\n        self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n        self._autotools.configure(args=self._autotools_args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    @property\n    def _msvc_build_type(self):\n        build_type = str(self.settings.build_type) or \"Release\"\n        if not self.options.shared:\n            build_type += \"-static\"\n        return build_type\n\n    def _patch_sources(self):\n        if self.settings.os == \"Windows\":\n            makefile_in = os.path.join(self._source_subfolder, \"Makefile.in\")\n            tools.replace_in_file(makefile_in,\n                                  \"DSO_LDFLAGS = @DSO_LDFLAGS@\",\n                                  \"DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a\")\n            tools.replace_in_file(makefile_in,\n                                  \"\\t$(INSTALL) -d $(LIBDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)\",\n                                  \"\\t$(INSTALL) -d $(BINDIR)\\n\"\n                                  \"\\t$(INSTALL) -d $(LIBDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)\")\n\n    def build(self):\n        self._patch_sources()\n        if self.settings.compiler == \"Visual Studio\":\n            with tools.vcvars(self.settings) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n                with tools.environment_append({\"CC\": \"cl\", \"CXX\": \"cl\"}) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n                    with tools.chdir(self._source_subfolder):\n                        # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure\n                        self.run(\"./configure {}\".format(\" \".join(self._autotools_args)), win_bash=tools.os_info.is_windows)\n            msbuild = MSBuild(self)\n            # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook\n            sln_file = os.path.join(self._source_subfolder, \"msvc\", \"jemalloc_vc2017.sln\")\n            msbuild.build(sln_file, targets=[\"jemalloc\"], build_type=self._msvc_build_type)\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    @property\n    def _library_name(self):\n        libname = \"jemalloc\"\n        if self.settings.compiler == \"Visual Studio\":\n            if self.options.shared:\n                if self.settings.build_type == \"Debug\":\n                    libname += \"d\"\n            else:\n                toolset = tools.msvs_toolset(self.settings)\n                toolset_number = \"\".join(c for c in toolset if c in string.digits)\n                libname += \"-vc{}-{}\".format(toolset_number, self._msvc_build_type)\n        else:\n            if self.settings.os == \"Windows\":\n                if not self.options.shared:\n                    libname += \"_s\"\n            else:\n                if not self.options.shared and self.options.fPIC:\n                    libname += \"_pic\"\n        return libname\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        if self.settings.compiler == \"Visual Studio\":\n            arch_subdir = {\n                \"x86_64\": \"x64\",\n                \"x86\": \"x86\",\n            }[str(self.settings.arch)]\n            self.copy(\"*.lib\", src=os.path.join(self._source_subfolder, \"msvc\", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, \"lib\"))\n            self.copy(\"*.dll\", src=os.path.join(self._source_subfolder, \"msvc\", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, \"bin\"))\n            self.copy(\"jemalloc.h\", src=os.path.join(self._source_subfolder, \"include\", \"jemalloc\"), dst=os.path.join(self.package_folder, \"include\", \"jemalloc\"), keep_path=True)\n            shutil.copytree(os.path.join(self._source_subfolder, \"include\", \"msvc_compat\"),\n                            os.path.join(self.package_folder, \"include\", \"msvc_compat\"))\n        else:\n            autotools = self._configure_autotools()\n            # Use install_lib_XXX and install_include to avoid mixing binaries and dll's\n            autotools.make(target=\"install_lib_shared\" if self.options.shared else \"install_lib_static\")\n            autotools.make(target=\"install_include\")\n            if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\":\n                os.rename(os.path.join(self.package_folder, \"lib\", \"{}.lib\".format(self._library_name)),\n                          os.path.join(self.package_folder, \"lib\", \"lib{}.a\".format(self._library_name)))\n                if not self.options.shared:\n                    os.unlink(os.path.join(self.package_folder, \"lib\", \"jemalloc.lib\"))\n\n    def package_id(self):\n        if not self.settings.build_type:\n            self.info.settings.build_type = \"Release\"\n\n    def package_info(self):\n        self.cpp_info.libs = [self._library_name]\n        self.cpp_info.includedirs = [os.path.join(self.package_folder, \"include\"),\n                                     os.path.join(self.package_folder, \"include\", \"jemalloc\")]\n        if self.settings.compiler == \"Visual Studio\":\n            self.cpp_info.includedirs.append(os.path.join(self.package_folder, \"include\", \"msvc_compat\"))\n        if not self.options.shared:\n            self.cpp_info.defines = [\"JEMALLOC_EXPORT=\"]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"dl\", \"pthread\", \"rt\"])\n", "path": "recipes/jemalloc/all/conanfile.py"}], "after_files": [{"content": "from conans import AutoToolsBuildEnvironment, ConanFile, MSBuild, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\nimport shutil\nimport string\n\n\nclass JemallocConan(ConanFile):\n    name = \"jemalloc\"\n    description = \"jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    license = \"BSD-2-Clause\"\n    homepage = \"http://jemalloc.net/\"\n    topics = (\"conan\", \"jemalloc\", \"malloc\", \"free\")\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"prefix\": \"ANY\",\n        \"enable_cxx\": [True, False],\n        \"enable_fill\": [True, False],\n        \"enable_xmalloc\": [True, False],\n        \"enable_readlinkat\": [True, False],\n        \"enable_syscall\": [True, False],\n        \"enable_lazy_lock\": [True, False],\n        \"enable_debug_logging\": [True, False],\n        \"enable_initial_exec_tls\": [True, False],\n        \"enable_libdl\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"prefix\": \"\",\n        \"enable_cxx\": True,\n        \"enable_fill\": True,\n        \"enable_xmalloc\": False,\n        \"enable_readlinkat\": False,\n        \"enable_syscall\": True,\n        \"enable_lazy_lock\": False,\n        \"enable_debug_logging\": False,\n        \"enable_initial_exec_tls\": True,\n        \"enable_libdl\": True,\n    }\n    exports_sources = [\"patches/**\"]\n\n    _autotools = None\n\n    _source_subfolder = \"source_subfolder\"\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.options.enable_cxx and \\\n                self.settings.compiler.get_safe(\"libcxx\") == \"libc++\" and \\\n                self.settings.compiler == \"clang\" and \\\n                tools.Version(self.settings.compiler.version) < \"10\":\n            raise ConanInvalidConfiguration(\"clang and libc++ version {} (< 10) is missing a mutex implementation\".format(self.settings.compiler.version))\n        if self.settings.compiler == \"Visual Studio\" and \\\n                self.options.shared and \\\n                \"MT\" in self.settings.compiler.runtime:\n            raise ConanInvalidConfiguration(\"Visual Studio build for shared library with MT runtime is not supported\")\n        if self.settings.compiler == \"Visual Studio\" and self.settings.compiler.version != \"15\":\n            # https://github.com/jemalloc/jemalloc/issues/1703\n            raise ConanInvalidConfiguration(\"Only Visual Studio 15 2017 is supported.  Please fix this if other versions are supported\")\n        if self.options.shared:\n            del self.options.fPIC\n        if not self.options.enable_cxx:\n            del self.settings.compiler.libcxx\n            del self.settings.compiler.cppstd\n        if self.settings.build_type not in (\"Release\", \"Debug\", None):\n            raise ConanInvalidConfiguration(\"Only Release and Debug build_types are supported\")\n        if self.settings.compiler == \"Visual Studio\" and self.settings.arch not in (\"x86_64\", \"x86\"):\n            raise ConanInvalidConfiguration(\"Unsupported arch\")\n        if self.settings.compiler == \"clang\" and tools.Version(self.settings.compiler.version) <= \"3.9\":\n            raise ConanInvalidConfiguration(\"Unsupported compiler version\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        os.rename(\"{}-{}\".format(self.name, self.version), self._source_subfolder)\n\n    def build_requirements(self):\n        if tools.os_info.is_windows and not os.environ.get(\"CONAN_BASH_PATH\", None):\n            self.build_requires(\"msys2/20200517\")\n\n    @property\n    def _autotools_args(self):\n        conf_args = [\n            \"--with-jemalloc-prefix={}\".format(self.options.prefix),\n            \"--enable-debug\" if self.settings.build_type == \"Debug\" else \"--disable-debug\",\n            \"--enable-cxx\" if self.options.enable_cxx else \"--disable-cxx\",\n            \"--enable-fill\" if self.options.enable_fill else \"--disable-fill\",\n            \"--enable-xmalloc\" if self.options.enable_cxx else \"--disable-xmalloc\",\n            \"--enable-readlinkat\" if self.options.enable_readlinkat else \"--disable-readlinkat\",\n            \"--enable-syscall\" if self.options.enable_syscall else \"--disable-syscall\",\n            \"--enable-lazy-lock\" if self.options.enable_lazy_lock else \"--disable-lazy-lock\",\n            \"--enable-log\" if self.options.enable_debug_logging else \"--disable-log\",\n            \"--enable-initial-exec-tls\" if self.options.enable_initial_exec_tls else \"--disable-initial-exec-tls\",\n            \"--enable-libdl\" if self.options.enable_libdl else \"--disable-libdl\",\n        ]\n        if self.options.shared:\n            conf_args.extend([\"--enable-shared\", \"--disable-static\"])\n        else:\n            conf_args.extend([\"--disable-shared\", \"--enable-static\"])\n        return conf_args\n\n    def _configure_autotools(self):\n        if self._autotools:\n            return self._autotools\n        self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n        self._autotools.configure(args=self._autotools_args, configure_dir=self._source_subfolder)\n        return self._autotools\n\n    @property\n    def _msvc_build_type(self):\n        build_type = str(self.settings.build_type) or \"Release\"\n        if not self.options.shared:\n            build_type += \"-static\"\n        return build_type\n\n    def _patch_sources(self):\n        if self.settings.os == \"Windows\":\n            makefile_in = os.path.join(self._source_subfolder, \"Makefile.in\")\n            tools.replace_in_file(makefile_in,\n                                  \"DSO_LDFLAGS = @DSO_LDFLAGS@\",\n                                  \"DSO_LDFLAGS = @DSO_LDFLAGS@ -Wl,--out-implib,lib/libjemalloc.a\")\n            tools.replace_in_file(makefile_in,\n                                  \"\\t$(INSTALL) -d $(LIBDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(LIBDIR)\",\n                                  \"\\t$(INSTALL) -d $(BINDIR)\\n\"\n                                  \"\\t$(INSTALL) -d $(LIBDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 755 $(objroot)lib/$(LIBJEMALLOC).$(SOREV) $(BINDIR)\\n\"\n                                  \"\\t$(INSTALL) -m 644 $(objroot)lib/libjemalloc.a $(LIBDIR)\")\n\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def build(self):\n        self._patch_sources()\n        if self.settings.compiler == \"Visual Studio\":\n            with tools.vcvars(self.settings) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n                with tools.environment_append({\"CC\": \"cl\", \"CXX\": \"cl\"}) if self.settings.compiler == \"Visual Studio\" else tools.no_op():\n                    with tools.chdir(self._source_subfolder):\n                        # Do not use AutoToolsBuildEnvironment because we want to run configure as ./configure\n                        self.run(\"./configure {}\".format(\" \".join(self._autotools_args)), win_bash=tools.os_info.is_windows)\n            msbuild = MSBuild(self)\n            # Do not use the 2015 solution: unresolved external symbols: test_hooks_libc_hook and test_hooks_arena_new_hook\n            sln_file = os.path.join(self._source_subfolder, \"msvc\", \"jemalloc_vc2017.sln\")\n            msbuild.build(sln_file, targets=[\"jemalloc\"], build_type=self._msvc_build_type)\n        else:\n            autotools = self._configure_autotools()\n            autotools.make()\n\n    @property\n    def _library_name(self):\n        libname = \"jemalloc\"\n        if self.settings.compiler == \"Visual Studio\":\n            if self.options.shared:\n                if self.settings.build_type == \"Debug\":\n                    libname += \"d\"\n            else:\n                toolset = tools.msvs_toolset(self.settings)\n                toolset_number = \"\".join(c for c in toolset if c in string.digits)\n                libname += \"-vc{}-{}\".format(toolset_number, self._msvc_build_type)\n        else:\n            if self.settings.os == \"Windows\":\n                if not self.options.shared:\n                    libname += \"_s\"\n            else:\n                if not self.options.shared and self.options.fPIC:\n                    libname += \"_pic\"\n        return libname\n\n    def package(self):\n        self.copy(pattern=\"COPYING\", src=self._source_subfolder, dst=\"licenses\")\n        if self.settings.compiler == \"Visual Studio\":\n            arch_subdir = {\n                \"x86_64\": \"x64\",\n                \"x86\": \"x86\",\n            }[str(self.settings.arch)]\n            self.copy(\"*.lib\", src=os.path.join(self._source_subfolder, \"msvc\", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, \"lib\"))\n            self.copy(\"*.dll\", src=os.path.join(self._source_subfolder, \"msvc\", arch_subdir, self._msvc_build_type), dst=os.path.join(self.package_folder, \"bin\"))\n            self.copy(\"jemalloc.h\", src=os.path.join(self._source_subfolder, \"include\", \"jemalloc\"), dst=os.path.join(self.package_folder, \"include\", \"jemalloc\"), keep_path=True)\n            shutil.copytree(os.path.join(self._source_subfolder, \"include\", \"msvc_compat\"),\n                            os.path.join(self.package_folder, \"include\", \"msvc_compat\"))\n        else:\n            autotools = self._configure_autotools()\n            # Use install_lib_XXX and install_include to avoid mixing binaries and dll's\n            autotools.make(target=\"install_lib_shared\" if self.options.shared else \"install_lib_static\")\n            autotools.make(target=\"install_include\")\n            if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\":\n                os.rename(os.path.join(self.package_folder, \"lib\", \"{}.lib\".format(self._library_name)),\n                          os.path.join(self.package_folder, \"lib\", \"lib{}.a\".format(self._library_name)))\n                if not self.options.shared:\n                    os.unlink(os.path.join(self.package_folder, \"lib\", \"jemalloc.lib\"))\n\n    def package_id(self):\n        if not self.settings.build_type:\n            self.info.settings.build_type = \"Release\"\n\n    def package_info(self):\n        self.cpp_info.libs = [self._library_name]\n        self.cpp_info.includedirs = [os.path.join(self.package_folder, \"include\"),\n                                     os.path.join(self.package_folder, \"include\", \"jemalloc\")]\n        if self.settings.compiler == \"Visual Studio\":\n            self.cpp_info.includedirs.append(os.path.join(self.package_folder, \"include\", \"msvc_compat\"))\n        if not self.options.shared:\n            self.cpp_info.defines = [\"JEMALLOC_EXPORT=\"]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"dl\", \"pthread\", \"rt\"])\n", "path": "recipes/jemalloc/all/conanfile.py"}]}