We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[request] libtorrent/2.0.10
### Package Name/Version

libtorrent/2.0.10

### Changelog

https://github.com/arvidn/libtorrent/releases/tag/v2.0.10

### Context about the new update

The above-mentioned version is newly released by the upstream project and not yet available as a recipe.
Please add this version.


--- 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/libtorrent/all/conanfile.py`
Content:
```
1 from conan import ConanFile
2 from conan.errors import ConanInvalidConfiguration
3 from conan.tools.build import check_min_cppstd
4 from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
5 from conan.tools.env import VirtualBuildEnv
6 from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file
7 from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
8 from conan.tools.scm import Version
9 import os
10 
11 required_conan_version = ">=1.53.0"
12 
13 
14 class LibtorrentConan(ConanFile):
15     name = "libtorrent"
16     description = (
17         "libtorrent is a feature complete C++ bittorrent implementation "
18         "focusing on efficiency and scalability"
19     )
20     topics = ("p2p", "network", "mesh")
21     url = "https://github.com/conan-io/conan-center-index"
22     homepage = "http://libtorrent.org"
23     license = ("BSD-3-clause", "ZLIB", "BSL-1.0")
24 
25     package_type = "library"
26     settings = "os", "arch", "compiler", "build_type"
27     options = {
28         "shared": [True, False],
29         "fPIC": [True, False],
30         "enable_deprecated_functions": [True, False],
31         "enable_dht": [True, False],
32         "enable_encryption": [True, False],
33         "enable_exceptions": [True, False],
34         "enable_extensions": [True, False],
35         "enable_i2p": [True, False],
36         "enable_iconv": [True, False],
37         "enable_logging": [True, False],
38         "enable_mutable_torrents": [True, False],
39     }
40     default_options = {
41         "shared": False,
42         "fPIC": True,
43         "enable_dht": True,
44         "enable_deprecated_functions": True,
45         "enable_encryption": True,
46         "enable_exceptions": True,
47         "enable_extensions": True,
48         "enable_i2p": True,
49         "enable_iconv": False,
50         "enable_logging": True,
51         "enable_mutable_torrents": True,
52     }
53 
54     @property
55     def _min_cppstd(self):
56         return "11" if Version(self.version) < "2.0.0" else "14"
57 
58     @property
59     def _compilers_minimum_version(self):
60         return {
61             "14": {
62                 "Visual Studio": "15",
63                 "msvc": "191",
64                 "gcc": "5" if Version(self.version) < "2.0.8" else "6",
65                 "clang": "5",
66                 "apple-clang": "5",
67             },
68         }.get(self._min_cppstd, {})
69 
70     def export_sources(self):
71         export_conandata_patches(self)
72 
73     def config_options(self):
74         if self.settings.os == "Windows":
75             del self.options.fPIC
76 
77     def configure(self):
78         if self.options.shared:
79             self.options.rm_safe("fPIC")
80 
81     def layout(self):
82         cmake_layout(self, src_folder="src")
83 
84     def requirements(self):
85         # libtorrent 2.0.x [x<=6] have issue for recent boost https://github.com/arvidn/libtorrent/discussions/6757
86         if Version(self.version) < "2.0.0" or Version(self.version) >= "2.0.7":
87             self.requires("boost/1.81.0", transitive_headers=True)
88         else:
89             self.requires("boost/1.76.0", transitive_headers=True)
90         if self.options.enable_encryption:
91             self.requires("openssl/[>=1.1 <4]", transitive_headers=True, transitive_libs=True)
92         if self.options.enable_iconv:
93             self.requires("libiconv/1.17")
94 
95     def validate(self):
96         if self.settings.compiler.get_safe("cppstd"):
97             check_min_cppstd(self, self._min_cppstd)
98 
99         minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
100         if minimum_version and Version(self.settings.compiler.version) < minimum_version:
101             raise ConanInvalidConfiguration(
102                 f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
103             )
104 
105         if Version(self.dependencies["boost"].ref.version) < "1.69.0" and \
106            (self.dependencies["boost"].options.header_only or self.dependencies["boost"].options.without_system):
107             raise ConanInvalidConfiguration(f"{self.ref} requires boost with system, which is non-header only in boost < 1.69.0")
108 
109     def build_requirements(self):
110         if Version(self.version) >= "2.0.4":
111             self.tool_requires("cmake/[>=3.16 <4]")
112 
113     def source(self):
114         get(self, **self.conan_data["sources"][self.version], strip_root=True)
115 
116     def generate(self):
117         env = VirtualBuildEnv(self)
118         env.generate()
119 
120         tc = CMakeToolchain(self)
121         tc.variables["Boost_USE_STATIC_LIBS"] = not self.dependencies["boost"].options.get_safe("shared", False)
122         tc.variables["deprecated-functions"] = self.options.enable_deprecated_functions
123         tc.variables["dht"] = self.options.enable_dht
124         tc.variables["encryption"] = self.options.enable_encryption
125         tc.variables["exceptions"] = self.options.enable_exceptions
126         tc.variables["i2p"] = self.options.enable_i2p
127         tc.variables["logging"] = self.options.enable_logging
128         tc.variables["mutable-torrents"] = self.options.enable_mutable_torrents
129         tc.variables["build_tests"] = False
130         tc.variables["build_examples"] = False
131         tc.variables["build_tools"] = False
132         tc.variables["python-bindings"] = False
133         tc.variables["python-bindings"] = False
134         if is_msvc(self):
135             tc.variables["static_runtime"] = is_msvc_static_runtime(self)
136         tc.generate()
137 
138         deps = CMakeDeps(self)
139         deps.generate()
140 
141     def _patch_sources(self):
142         apply_conandata_patches(self)
143 
144         replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "/W4", "")
145         if Version(self.version) < "2.0":
146             if self.options.enable_iconv:
147                 replace = "find_public_dependency(Iconv REQUIRED)"
148             else:
149                 replace = "set(Iconv_FOUND OFF)"
150             replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
151                                   "find_public_dependency(Iconv)",
152                                   replace)
153             if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++":
154                 # https://github.com/arvidn/libtorrent/issues/3557
155                 replace_in_file(self, os.path.join(self.source_folder, "include", "libtorrent", "file_storage.hpp"),
156                                       "file_entry& operator=(file_entry&&) & noexcept = default;",
157                                       "file_entry& operator=(file_entry&&) & = default;")
158 
159     def build(self):
160         self._patch_sources()
161         cmake = CMake(self)
162         cmake.configure()
163         cmake.build()
164 
165     def package(self):
166         copy(self, pattern="COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
167         cmake = CMake(self)
168         cmake.install()
169 
170         rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
171         rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
172         rmdir(self, os.path.join(self.package_folder, "share"))
173 
174     def package_info(self):
175         self.cpp_info.set_property("cmake_file_name", "LibtorrentRasterbar")
176         self.cpp_info.set_property("cmake_target_name", "LibtorrentRasterbar::torrent-rasterbar")
177         self.cpp_info.set_property("pkg_config_name", "libtorrent-rasterbar")
178 
179         # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed
180         self.cpp_info.components["libtorrent-rasterbar"].includedirs = ["include", os.path.join("include", "libtorrent")]
181         self.cpp_info.components["libtorrent-rasterbar"].libs = ["torrent-rasterbar"]
182 
183         self.cpp_info.components["libtorrent-rasterbar"].requires = ["boost::headers", "boost::system"]
184         if self.options.enable_encryption:
185             self.cpp_info.components["libtorrent-rasterbar"].requires.append("openssl::openssl")
186         if self.options.enable_iconv:
187             self.cpp_info.components["libtorrent-rasterbar"].requires.append("libiconv::libiconv")
188 
189         if self.settings.os in ["Linux", "FreeBSD"]:
190             self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread"]
191         elif self.settings.os == "Windows":
192             self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp"]
193         elif self.settings.os == "Macos":
194             self.cpp_info.components["libtorrent-rasterbar"].frameworks = ["CoreFoundation", "SystemConfiguration"]
195 
196         if self.options.shared:
197             self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_LINKING_SHARED")
198         if self.options.enable_encryption:
199             self.cpp_info.components["libtorrent-rasterbar"].defines.extend(["TORRENT_USE_OPENSSL", "TORRENT_USE_LIBCRYPTO"])
200         else:
201             self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_DISABLE_ENCRYPTION")
202         if self.options.enable_iconv:
203             self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_USE_ICONV")
204         if not self.options.enable_dht:
205             self.cpp_info.components["libtorrent-rasterbar"].defines.append("TORRENT_DISABLE_DHT")
206 
207         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
208         self.cpp_info.names["cmake_find_package"] = "LibtorrentRasterbar"
209         self.cpp_info.names["cmake_find_package_multi"] = "LibtorrentRasterbar"
210         self.cpp_info.components["libtorrent-rasterbar"].names["cmake_find_package"] = "torrent-rasterbar"
211         self.cpp_info.components["libtorrent-rasterbar"].names["cmake_find_package_multi"] = "torrent-rasterbar"
212         self.cpp_info.components["libtorrent-rasterbar"].set_property("cmake_target_name", "LibtorrentRasterbar::torrent-rasterbar")
213         self.cpp_info.components["libtorrent-rasterbar"].set_property("pkg_config_name", "libtorrent-rasterbar")
214
```
--- 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/libtorrent/all/conanfile.py b/recipes/libtorrent/all/conanfile.py
--- a/recipes/libtorrent/all/conanfile.py
+++ b/recipes/libtorrent/all/conanfile.py
@@ -187,9 +187,9 @@
             self.cpp_info.components["libtorrent-rasterbar"].requires.append("libiconv::libiconv")
 
         if self.settings.os in ["Linux", "FreeBSD"]:
-            self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread"]
+            self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["dl", "pthread", "m"]
         elif self.settings.os == "Windows":
-            self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp"]
+            self.cpp_info.components["libtorrent-rasterbar"].system_libs = ["wsock32", "ws2_32", "iphlpapi", "dbghelp", "mswsock"]
         elif self.settings.os == "Macos":
             self.cpp_info.components["libtorrent-rasterbar"].frameworks = ["CoreFoundation", "SystemConfiguration"]

{"golden_diff": "diff --git a/recipes/libtorrent/all/conanfile.py b/recipes/libtorrent/all/conanfile.py\n--- a/recipes/libtorrent/all/conanfile.py\n+++ b/recipes/libtorrent/all/conanfile.py\n@@ -187,9 +187,9 @@\n             self.cpp_info.components[\"libtorrent-rasterbar\"].requires.append(\"libiconv::libiconv\")\n \n         if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n-            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"dl\", \"pthread\"]\n+            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"dl\", \"pthread\", \"m\"]\n         elif self.settings.os == \"Windows\":\n-            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"wsock32\", \"ws2_32\", \"iphlpapi\", \"dbghelp\"]\n+            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"wsock32\", \"ws2_32\", \"iphlpapi\", \"dbghelp\", \"mswsock\"]\n         elif self.settings.os == \"Macos\":\n             self.cpp_info.components[\"libtorrent-rasterbar\"].frameworks = [\"CoreFoundation\", \"SystemConfiguration\"]\n", "issue": "[request] libtorrent/2.0.10\n### Package Name/Version\n\nlibtorrent/2.0.10\n\n### Changelog\n\nhttps://github.com/arvidn/libtorrent/releases/tag/v2.0.10\n\n### Context about the new update\n\nThe above-mentioned version is newly released by the upstream project and not yet available as a recipe.\r\nPlease add this version.\r\n\n", "before_files": [{"content": "from conan import ConanFile\nfrom conan.errors import ConanInvalidConfiguration\nfrom conan.tools.build import check_min_cppstd\nfrom conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout\nfrom conan.tools.env import VirtualBuildEnv\nfrom conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file\nfrom conan.tools.microsoft import is_msvc, is_msvc_static_runtime\nfrom conan.tools.scm import Version\nimport os\n\nrequired_conan_version = \">=1.53.0\"\n\n\nclass LibtorrentConan(ConanFile):\n    name = \"libtorrent\"\n    description = (\n        \"libtorrent is a feature complete C++ bittorrent implementation \"\n        \"focusing on efficiency and scalability\"\n    )\n    topics = (\"p2p\", \"network\", \"mesh\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"http://libtorrent.org\"\n    license = (\"BSD-3-clause\", \"ZLIB\", \"BSL-1.0\")\n\n    package_type = \"library\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_deprecated_functions\": [True, False],\n        \"enable_dht\": [True, False],\n        \"enable_encryption\": [True, False],\n        \"enable_exceptions\": [True, False],\n        \"enable_extensions\": [True, False],\n        \"enable_i2p\": [True, False],\n        \"enable_iconv\": [True, False],\n        \"enable_logging\": [True, False],\n        \"enable_mutable_torrents\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_dht\": True,\n        \"enable_deprecated_functions\": True,\n        \"enable_encryption\": True,\n        \"enable_exceptions\": True,\n        \"enable_extensions\": True,\n        \"enable_i2p\": True,\n        \"enable_iconv\": False,\n        \"enable_logging\": True,\n        \"enable_mutable_torrents\": True,\n    }\n\n    @property\n    def _min_cppstd(self):\n        return \"11\" if Version(self.version) < \"2.0.0\" else \"14\"\n\n    @property\n    def _compilers_minimum_version(self):\n        return {\n            \"14\": {\n                \"Visual Studio\": \"15\",\n                \"msvc\": \"191\",\n                \"gcc\": \"5\" if Version(self.version) < \"2.0.8\" else \"6\",\n                \"clang\": \"5\",\n                \"apple-clang\": \"5\",\n            },\n        }.get(self._min_cppstd, {})\n\n    def export_sources(self):\n        export_conandata_patches(self)\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.shared:\n            self.options.rm_safe(\"fPIC\")\n\n    def layout(self):\n        cmake_layout(self, src_folder=\"src\")\n\n    def requirements(self):\n        # libtorrent 2.0.x [x<=6] have issue for recent boost https://github.com/arvidn/libtorrent/discussions/6757\n        if Version(self.version) < \"2.0.0\" or Version(self.version) >= \"2.0.7\":\n            self.requires(\"boost/1.81.0\", transitive_headers=True)\n        else:\n            self.requires(\"boost/1.76.0\", transitive_headers=True)\n        if self.options.enable_encryption:\n            self.requires(\"openssl/[>=1.1 <4]\", transitive_headers=True, transitive_libs=True)\n        if self.options.enable_iconv:\n            self.requires(\"libiconv/1.17\")\n\n    def validate(self):\n        if self.settings.compiler.get_safe(\"cppstd\"):\n            check_min_cppstd(self, self._min_cppstd)\n\n        minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)\n        if minimum_version and Version(self.settings.compiler.version) < minimum_version:\n            raise ConanInvalidConfiguration(\n                f\"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.\"\n            )\n\n        if Version(self.dependencies[\"boost\"].ref.version) < \"1.69.0\" and \\\n           (self.dependencies[\"boost\"].options.header_only or self.dependencies[\"boost\"].options.without_system):\n            raise ConanInvalidConfiguration(f\"{self.ref} requires boost with system, which is non-header only in boost < 1.69.0\")\n\n    def build_requirements(self):\n        if Version(self.version) >= \"2.0.4\":\n            self.tool_requires(\"cmake/[>=3.16 <4]\")\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version], strip_root=True)\n\n    def generate(self):\n        env = VirtualBuildEnv(self)\n        env.generate()\n\n        tc = CMakeToolchain(self)\n        tc.variables[\"Boost_USE_STATIC_LIBS\"] = not self.dependencies[\"boost\"].options.get_safe(\"shared\", False)\n        tc.variables[\"deprecated-functions\"] = self.options.enable_deprecated_functions\n        tc.variables[\"dht\"] = self.options.enable_dht\n        tc.variables[\"encryption\"] = self.options.enable_encryption\n        tc.variables[\"exceptions\"] = self.options.enable_exceptions\n        tc.variables[\"i2p\"] = self.options.enable_i2p\n        tc.variables[\"logging\"] = self.options.enable_logging\n        tc.variables[\"mutable-torrents\"] = self.options.enable_mutable_torrents\n        tc.variables[\"build_tests\"] = False\n        tc.variables[\"build_examples\"] = False\n        tc.variables[\"build_tools\"] = False\n        tc.variables[\"python-bindings\"] = False\n        tc.variables[\"python-bindings\"] = False\n        if is_msvc(self):\n            tc.variables[\"static_runtime\"] = is_msvc_static_runtime(self)\n        tc.generate()\n\n        deps = CMakeDeps(self)\n        deps.generate()\n\n    def _patch_sources(self):\n        apply_conandata_patches(self)\n\n        replace_in_file(self, os.path.join(self.source_folder, \"CMakeLists.txt\"), \"/W4\", \"\")\n        if Version(self.version) < \"2.0\":\n            if self.options.enable_iconv:\n                replace = \"find_public_dependency(Iconv REQUIRED)\"\n            else:\n                replace = \"set(Iconv_FOUND OFF)\"\n            replace_in_file(self, os.path.join(self.source_folder, \"CMakeLists.txt\"),\n                                  \"find_public_dependency(Iconv)\",\n                                  replace)\n            if self.settings.compiler == \"clang\" and self.settings.compiler.libcxx == \"libstdc++\":\n                # https://github.com/arvidn/libtorrent/issues/3557\n                replace_in_file(self, os.path.join(self.source_folder, \"include\", \"libtorrent\", \"file_storage.hpp\"),\n                                      \"file_entry& operator=(file_entry&&) & noexcept = default;\",\n                                      \"file_entry& operator=(file_entry&&) & = default;\")\n\n    def build(self):\n        self._patch_sources()\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def package(self):\n        copy(self, pattern=\"COPYING\", dst=os.path.join(self.package_folder, \"licenses\"), src=self.source_folder)\n        cmake = CMake(self)\n        cmake.install()\n\n        rmdir(self, os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        rmdir(self, os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n        rmdir(self, os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"LibtorrentRasterbar\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"LibtorrentRasterbar::torrent-rasterbar\")\n        self.cpp_info.set_property(\"pkg_config_name\", \"libtorrent-rasterbar\")\n\n        # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.components[\"libtorrent-rasterbar\"].includedirs = [\"include\", os.path.join(\"include\", \"libtorrent\")]\n        self.cpp_info.components[\"libtorrent-rasterbar\"].libs = [\"torrent-rasterbar\"]\n\n        self.cpp_info.components[\"libtorrent-rasterbar\"].requires = [\"boost::headers\", \"boost::system\"]\n        if self.options.enable_encryption:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].requires.append(\"openssl::openssl\")\n        if self.options.enable_iconv:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].requires.append(\"libiconv::libiconv\")\n\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"dl\", \"pthread\"]\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"wsock32\", \"ws2_32\", \"iphlpapi\", \"dbghelp\"]\n        elif self.settings.os == \"Macos\":\n            self.cpp_info.components[\"libtorrent-rasterbar\"].frameworks = [\"CoreFoundation\", \"SystemConfiguration\"]\n\n        if self.options.shared:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_LINKING_SHARED\")\n        if self.options.enable_encryption:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.extend([\"TORRENT_USE_OPENSSL\", \"TORRENT_USE_LIBCRYPTO\"])\n        else:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_DISABLE_ENCRYPTION\")\n        if self.options.enable_iconv:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_USE_ICONV\")\n        if not self.options.enable_dht:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_DISABLE_DHT\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.names[\"cmake_find_package\"] = \"LibtorrentRasterbar\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"LibtorrentRasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].names[\"cmake_find_package\"] = \"torrent-rasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].names[\"cmake_find_package_multi\"] = \"torrent-rasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].set_property(\"cmake_target_name\", \"LibtorrentRasterbar::torrent-rasterbar\")\n        self.cpp_info.components[\"libtorrent-rasterbar\"].set_property(\"pkg_config_name\", \"libtorrent-rasterbar\")\n", "path": "recipes/libtorrent/all/conanfile.py"}], "after_files": [{"content": "from conan import ConanFile\nfrom conan.errors import ConanInvalidConfiguration\nfrom conan.tools.build import check_min_cppstd\nfrom conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout\nfrom conan.tools.env import VirtualBuildEnv\nfrom conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file\nfrom conan.tools.microsoft import is_msvc, is_msvc_static_runtime\nfrom conan.tools.scm import Version\nimport os\n\nrequired_conan_version = \">=1.53.0\"\n\n\nclass LibtorrentConan(ConanFile):\n    name = \"libtorrent\"\n    description = (\n        \"libtorrent is a feature complete C++ bittorrent implementation \"\n        \"focusing on efficiency and scalability\"\n    )\n    topics = (\"p2p\", \"network\", \"mesh\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"http://libtorrent.org\"\n    license = (\"BSD-3-clause\", \"ZLIB\", \"BSL-1.0\")\n\n    package_type = \"library\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"enable_deprecated_functions\": [True, False],\n        \"enable_dht\": [True, False],\n        \"enable_encryption\": [True, False],\n        \"enable_exceptions\": [True, False],\n        \"enable_extensions\": [True, False],\n        \"enable_i2p\": [True, False],\n        \"enable_iconv\": [True, False],\n        \"enable_logging\": [True, False],\n        \"enable_mutable_torrents\": [True, False],\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"enable_dht\": True,\n        \"enable_deprecated_functions\": True,\n        \"enable_encryption\": True,\n        \"enable_exceptions\": True,\n        \"enable_extensions\": True,\n        \"enable_i2p\": True,\n        \"enable_iconv\": False,\n        \"enable_logging\": True,\n        \"enable_mutable_torrents\": True,\n    }\n\n    @property\n    def _min_cppstd(self):\n        return \"11\" if Version(self.version) < \"2.0.0\" else \"14\"\n\n    @property\n    def _compilers_minimum_version(self):\n        return {\n            \"14\": {\n                \"Visual Studio\": \"15\",\n                \"msvc\": \"191\",\n                \"gcc\": \"5\" if Version(self.version) < \"2.0.8\" else \"6\",\n                \"clang\": \"5\",\n                \"apple-clang\": \"5\",\n            },\n        }.get(self._min_cppstd, {})\n\n    def export_sources(self):\n        export_conandata_patches(self)\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.shared:\n            self.options.rm_safe(\"fPIC\")\n\n    def layout(self):\n        cmake_layout(self, src_folder=\"src\")\n\n    def requirements(self):\n        # libtorrent 2.0.x [x<=6] have issue for recent boost https://github.com/arvidn/libtorrent/discussions/6757\n        if Version(self.version) < \"2.0.0\" or Version(self.version) >= \"2.0.7\":\n            self.requires(\"boost/1.81.0\", transitive_headers=True)\n        else:\n            self.requires(\"boost/1.76.0\", transitive_headers=True)\n        if self.options.enable_encryption:\n            self.requires(\"openssl/[>=1.1 <4]\", transitive_headers=True, transitive_libs=True)\n        if self.options.enable_iconv:\n            self.requires(\"libiconv/1.17\")\n\n    def validate(self):\n        if self.settings.compiler.get_safe(\"cppstd\"):\n            check_min_cppstd(self, self._min_cppstd)\n\n        minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)\n        if minimum_version and Version(self.settings.compiler.version) < minimum_version:\n            raise ConanInvalidConfiguration(\n                f\"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.\"\n            )\n\n        if Version(self.dependencies[\"boost\"].ref.version) < \"1.69.0\" and \\\n           (self.dependencies[\"boost\"].options.header_only or self.dependencies[\"boost\"].options.without_system):\n            raise ConanInvalidConfiguration(f\"{self.ref} requires boost with system, which is non-header only in boost < 1.69.0\")\n\n    def build_requirements(self):\n        if Version(self.version) >= \"2.0.4\":\n            self.tool_requires(\"cmake/[>=3.16 <4]\")\n\n    def source(self):\n        get(self, **self.conan_data[\"sources\"][self.version], strip_root=True)\n\n    def generate(self):\n        env = VirtualBuildEnv(self)\n        env.generate()\n\n        tc = CMakeToolchain(self)\n        tc.variables[\"Boost_USE_STATIC_LIBS\"] = not self.dependencies[\"boost\"].options.get_safe(\"shared\", False)\n        tc.variables[\"deprecated-functions\"] = self.options.enable_deprecated_functions\n        tc.variables[\"dht\"] = self.options.enable_dht\n        tc.variables[\"encryption\"] = self.options.enable_encryption\n        tc.variables[\"exceptions\"] = self.options.enable_exceptions\n        tc.variables[\"i2p\"] = self.options.enable_i2p\n        tc.variables[\"logging\"] = self.options.enable_logging\n        tc.variables[\"mutable-torrents\"] = self.options.enable_mutable_torrents\n        tc.variables[\"build_tests\"] = False\n        tc.variables[\"build_examples\"] = False\n        tc.variables[\"build_tools\"] = False\n        tc.variables[\"python-bindings\"] = False\n        tc.variables[\"python-bindings\"] = False\n        if is_msvc(self):\n            tc.variables[\"static_runtime\"] = is_msvc_static_runtime(self)\n        tc.generate()\n\n        deps = CMakeDeps(self)\n        deps.generate()\n\n    def _patch_sources(self):\n        apply_conandata_patches(self)\n\n        replace_in_file(self, os.path.join(self.source_folder, \"CMakeLists.txt\"), \"/W4\", \"\")\n        if Version(self.version) < \"2.0\":\n            if self.options.enable_iconv:\n                replace = \"find_public_dependency(Iconv REQUIRED)\"\n            else:\n                replace = \"set(Iconv_FOUND OFF)\"\n            replace_in_file(self, os.path.join(self.source_folder, \"CMakeLists.txt\"),\n                                  \"find_public_dependency(Iconv)\",\n                                  replace)\n            if self.settings.compiler == \"clang\" and self.settings.compiler.libcxx == \"libstdc++\":\n                # https://github.com/arvidn/libtorrent/issues/3557\n                replace_in_file(self, os.path.join(self.source_folder, \"include\", \"libtorrent\", \"file_storage.hpp\"),\n                                      \"file_entry& operator=(file_entry&&) & noexcept = default;\",\n                                      \"file_entry& operator=(file_entry&&) & = default;\")\n\n    def build(self):\n        self._patch_sources()\n        cmake = CMake(self)\n        cmake.configure()\n        cmake.build()\n\n    def package(self):\n        copy(self, pattern=\"COPYING\", dst=os.path.join(self.package_folder, \"licenses\"), src=self.source_folder)\n        cmake = CMake(self)\n        cmake.install()\n\n        rmdir(self, os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        rmdir(self, os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n        rmdir(self, os.path.join(self.package_folder, \"share\"))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"LibtorrentRasterbar\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"LibtorrentRasterbar::torrent-rasterbar\")\n        self.cpp_info.set_property(\"pkg_config_name\", \"libtorrent-rasterbar\")\n\n        # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.components[\"libtorrent-rasterbar\"].includedirs = [\"include\", os.path.join(\"include\", \"libtorrent\")]\n        self.cpp_info.components[\"libtorrent-rasterbar\"].libs = [\"torrent-rasterbar\"]\n\n        self.cpp_info.components[\"libtorrent-rasterbar\"].requires = [\"boost::headers\", \"boost::system\"]\n        if self.options.enable_encryption:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].requires.append(\"openssl::openssl\")\n        if self.options.enable_iconv:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].requires.append(\"libiconv::libiconv\")\n\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"dl\", \"pthread\", \"m\"]\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.components[\"libtorrent-rasterbar\"].system_libs = [\"wsock32\", \"ws2_32\", \"iphlpapi\", \"dbghelp\", \"mswsock\"]\n        elif self.settings.os == \"Macos\":\n            self.cpp_info.components[\"libtorrent-rasterbar\"].frameworks = [\"CoreFoundation\", \"SystemConfiguration\"]\n\n        if self.options.shared:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_LINKING_SHARED\")\n        if self.options.enable_encryption:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.extend([\"TORRENT_USE_OPENSSL\", \"TORRENT_USE_LIBCRYPTO\"])\n        else:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_DISABLE_ENCRYPTION\")\n        if self.options.enable_iconv:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_USE_ICONV\")\n        if not self.options.enable_dht:\n            self.cpp_info.components[\"libtorrent-rasterbar\"].defines.append(\"TORRENT_DISABLE_DHT\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.names[\"cmake_find_package\"] = \"LibtorrentRasterbar\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"LibtorrentRasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].names[\"cmake_find_package\"] = \"torrent-rasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].names[\"cmake_find_package_multi\"] = \"torrent-rasterbar\"\n        self.cpp_info.components[\"libtorrent-rasterbar\"].set_property(\"cmake_target_name\", \"LibtorrentRasterbar::torrent-rasterbar\")\n        self.cpp_info.components[\"libtorrent-rasterbar\"].set_property(\"pkg_config_name\", \"libtorrent-rasterbar\")\n", "path": "recipes/libtorrent/all/conanfile.py"}]}