We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[libsodium] libsodium/1.0.18: Recipe broken on Python < 3.6
The use of f-strings in the Python recipe causes the package to not be installed with a Python version that is less than 3.6. This is a serious problem for using conan with older distributions, such as Ubuntu Xenial or CentOS. Instead of f-strings, the `.format(...)` or `%` interpolation methods should be used.

### Package and Environment Details
  * Package Name/Version: **libsodium/1.0.18**

### Conan output
```
ERROR: Error loading conanfile at '~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py': Unable to load conanfile in ~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py
  File "/usr/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 661, in exec_module
  File "<frozen importlib._bootstrap_external>", line 767, in get_code
  File "<frozen importlib._bootstrap_external>", line 727, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py", line 126
    raise ConanInvalidConfiguration(f"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}")
                                                                                                                                 ^
SyntaxError: invalid syntax
```

### Locations in Recipe
```
libsodium/1.0.18/conanfile.py
126:            raise ConanInvalidConfiguration(f"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}")
148:            raise ConanInvalidConfiguration(f"Unsupported os for libsodium: {self.settings.os}")
```

This is as far as I can tell the only package in this repository that uses f-strings.

--- 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/libsodium/1.0.18/conanfile.py`
Content:
```
1 from conans import ConanFile, AutoToolsBuildEnvironment, tools, MSBuild
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 
5 
6 class LibsodiumConan(ConanFile):
7     name        = "libsodium"
8     description = "A modern and easy-to-use crypto library."
9     license     = "ISC"
10     url         = "https://github.com/conan-io/conan-center-index"
11     homepage    = "https://download.libsodium.org/doc/"
12     exports_sources = ["patches/**"]
13     settings    = "os", "compiler", "arch", "build_type"
14     topics = ("sodium", "libsodium", "encryption", "signature", "hashing")
15     generators  = "cmake"
16     _source_subfolder = "source_subfolder"
17 
18     options = {
19         "shared" : [True, False],
20         "fPIC": [True, False],
21         "use_soname" : [True, False],
22         "PIE"    : [True, False],
23     }
24 
25     default_options = {
26         "shared": False,
27         "fPIC": True,
28         "use_soname": True,
29         "PIE": False,
30     }
31 
32     @property
33     def _android_id_str(self):
34         return "androideabi" if str(self.settings.arch) in ["armv6", "armv7"] else "android"
35 
36     @property
37     def _is_mingw(self):
38         return self.settings.os == "Windows" and self.settings.compiler == "gcc"
39 
40     @property
41     def _vs_configuration(self):
42         configuration = ""
43         if self.options.shared:
44             configuration += "Dyn"
45         else:
46             configuration += "Static"
47         build_type = "Debug" if self.settings.build_type == "Debug" else "Release"
48         configuration += build_type
49         return configuration
50 
51     @property
52     def _vs_sln_folder(self):
53         folder = {"14": "vs2015",
54                   "15": "vs2017",
55                   "16": "vs2019"}.get(str(self.settings.compiler.version), None)
56         if not folder:
57             raise ConanInvalidConfiguration("Unsupported msvc version: {}".format(self.settings.compiler.version))
58         return folder
59 
60     def configure(self):
61         del self.settings.compiler.libcxx
62         del self.settings.compiler.cppstd
63 
64     def config_options(self):
65         if self.settings.os == "Windows":
66             del self.options.fPIC
67 
68     def build_requirements(self):
69         # There are several unix tools used (bash scripts for Emscripten, autoreconf on MinGW, etc...)
70         if self.settings.compiler != "Visual Studio" and tools.os_info.is_windows and \
71                 not "CONAN_BASH_PATH" in os.environ and tools.os_info.detect_windows_subsystem() != "Windows":
72             self.build_requires("msys2/20190524")
73 
74     def source(self):
75         tools.get(**self.conan_data["sources"][self.version])
76         extracted_dir = self.name + "-" + self.version
77         os.rename(extracted_dir, self._source_subfolder)
78 
79     def _build_visual(self):
80         sln_path = os.path.join(self.build_folder, self._source_subfolder, "builds", "msvc", self._vs_sln_folder, "libsodium.sln")
81 
82         msbuild = MSBuild(self)
83         msbuild.build(sln_path, upgrade_project=False, platforms={"x86": "Win32"}, build_type=self._vs_configuration)
84 
85     def _build_autotools_impl(self, configure_args):
86         win_bash = False
87         if self._is_mingw:
88             win_bash = True
89 
90         autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)
91         if self._is_mingw:
92             self.run("autoreconf -i", cwd=self._source_subfolder, win_bash=win_bash)
93         autotools.configure(args=configure_args, configure_dir=self._source_subfolder, host=False)
94         autotools.make(args=["-j%s" % str(tools.cpu_count())])
95         autotools.install()
96 
97     def _build_autotools_linux(self, configure_args):
98         self._build_autotools_impl(configure_args)
99 
100     def _build_autotools_emscripten(self, configure_args):
101         self.run("./dist-build/emscripten.sh --standard", cwd=self._source_subfolder)
102 
103     def _build_autotools_android(self, configure_args):
104         host_arch = "%s-linux-%s" % (tools.to_android_abi(self.settings.arch), self._android_id_str)
105         configure_args.append("--host=%s" % host_arch)
106         self._build_autotools_impl(configure_args)
107 
108     def _build_autotools_mingw(self, configure_args):
109         arch = "i686" if self.settings.arch == "x86" else self.settings.arch
110         host_arch = "%s-w64-mingw32" % arch
111         configure_args.append("--host=%s" % host_arch)
112         self._build_autotools_impl(configure_args)
113 
114     def _build_autotools_darwin(self, configure_args):
115         os = "ios" if self.settings.os == "iOS" else "darwin"
116         host_arch = "%s-apple-%s" % (self.settings.arch, os)
117         configure_args.append("--host=%s" % host_arch)
118         self._build_autotools_impl(configure_args)
119 
120     def _build_autotools_neutrino(self, configure_args):
121         neutrino_archs = {"x86_64":"x86_64-pc", "x86":"i586-pc", "armv7":"arm-unknown", "armv8": "aarch64-unknown"}
122         if self.settings.os.version == "7.0" and str(self.settings.arch) in neutrino_archs:
123             host_arch = "%s-nto-qnx7.0.0" % neutrino_archs[str(self.settings.arch)]
124             if self.settings.arch == "armv7":
125                 host_arch += "eabi"
126         else:
127             raise ConanInvalidConfiguration(f"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}")
128         configure_args.append("--host=%s" % host_arch)
129         self._build_autotools_impl(configure_args)
130 
131     def _build_autotools(self):
132         absolute_install_dir = os.path.abspath(os.path.join(".", "install"))
133         absolute_install_dir = absolute_install_dir.replace("\\", "/")
134         configure_args = self._get_configure_args(absolute_install_dir)
135 
136         if self.settings.os == "Linux":
137             self._build_autotools_linux(configure_args)
138         elif self.settings.os == "Emscripten":
139             self._build_autotools_emscripten(configure_args)
140         elif self.settings.os == "Android":
141             self._build_autotools_android(configure_args)
142         elif tools.is_apple_os(self.settings.os):
143             self._build_autotools_darwin(configure_args)
144         elif self._is_mingw:
145             self._build_autotools_mingw(configure_args)
146         elif self.settings.os == "Neutrino":
147             self._build_autotools_neutrino(configure_args)
148         else:
149             raise ConanInvalidConfiguration(f"Unsupported os for libsodium: {self.settings.os}")
150 
151     def build(self):
152         for patch in self.conan_data["patches"][self.version]:
153             tools.patch(**patch)
154         if self.settings.os == "Macos":
155             tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), r"-install_name \$rpath/", "-install_name ")
156         if self.settings.compiler != "Visual Studio":
157             self._build_autotools()
158         else:
159             self._build_visual()
160 
161     def package(self):
162         self.copy("*LICENSE", dst="licenses", keep_path=False)
163         if self.settings.compiler == "Visual Studio":
164             self._package_visual()
165         else:
166             self._package_autotools()
167 
168     def package_info(self):
169         if self.settings.compiler == "Visual Studio":
170             if not self.options.shared:
171                 self.cpp_info.defines = ["SODIUM_STATIC=1"]
172         self.cpp_info.libs = tools.collect_libs(self)
173         if self.settings.os == "Linux":
174             self.cpp_info.system_libs = ["pthread"]
175 
176     def _package_autotools(self):
177         if self.settings.os == "Emscripten":
178             prefix = "%s/libsodium-js" % self._source_subfolder
179         else:
180             prefix = "install"
181         lib_folder = os.path.join(prefix, "lib")
182         self.copy("*.h", dst="include", src=os.path.join(prefix, "include"))
183         self.copy("*.a", dst="lib", src=lib_folder)
184         self.copy("*.so*", dst="lib", src=lib_folder, symlinks=True)
185         self.copy("*.dylib", dst="lib", src=lib_folder, symlinks=True)
186 
187     def _package_visual(self):
188         self.copy("*.lib", dst="lib", keep_path=False)
189         self.copy("*.dll", dst="bin", keep_path=False)
190         inc_src = os.path.join(self._source_subfolder, "src", self.name, "include")
191         self.copy("*.h", src=inc_src, dst="include", keep_path=True, excludes=("*/private/*"))
192 
193     def _autotools_bool_arg(self, arg_base_name, value):
194         prefix = "--enable-" if value else "--disable-"
195         return prefix + arg_base_name
196 
197     def _get_configure_args(self, absolute_install_dir):
198         args = [
199             "--prefix=%s" % absolute_install_dir,
200             self._autotools_bool_arg("shared", self.options.shared),
201             self._autotools_bool_arg("static", not self.options.shared),
202             self._autotools_bool_arg("soname-versions", self.options.use_soname),
203             self._autotools_bool_arg("pie", self.options.PIE)
204         ]
205         if self.options.get_safe("fPIC"):
206             args.append("--with-pic")
207         return args
208
```
--- 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/libsodium/1.0.18/conanfile.py b/recipes/libsodium/1.0.18/conanfile.py
--- a/recipes/libsodium/1.0.18/conanfile.py
+++ b/recipes/libsodium/1.0.18/conanfile.py
@@ -124,7 +124,7 @@
             if self.settings.arch == "armv7":
                 host_arch += "eabi"
         else:
-            raise ConanInvalidConfiguration(f"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}")
+            raise ConanInvalidConfiguration("Unsupported arch or Neutrino version for libsodium: {} {}".format(self.settings.os, self.settings.arch))
         configure_args.append("--host=%s" % host_arch)
         self._build_autotools_impl(configure_args)
 
@@ -146,7 +146,7 @@
         elif self.settings.os == "Neutrino":
             self._build_autotools_neutrino(configure_args)
         else:
-            raise ConanInvalidConfiguration(f"Unsupported os for libsodium: {self.settings.os}")
+            raise ConanInvalidConfiguration("Unsupported os for libsodium: {}".format(self.settings.os))
 
     def build(self):
         for patch in self.conan_data["patches"][self.version]:

{"golden_diff": "diff --git a/recipes/libsodium/1.0.18/conanfile.py b/recipes/libsodium/1.0.18/conanfile.py\n--- a/recipes/libsodium/1.0.18/conanfile.py\n+++ b/recipes/libsodium/1.0.18/conanfile.py\n@@ -124,7 +124,7 @@\n             if self.settings.arch == \"armv7\":\n                 host_arch += \"eabi\"\n         else:\n-            raise ConanInvalidConfiguration(f\"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}\")\n+            raise ConanInvalidConfiguration(\"Unsupported arch or Neutrino version for libsodium: {} {}\".format(self.settings.os, self.settings.arch))\n         configure_args.append(\"--host=%s\" % host_arch)\n         self._build_autotools_impl(configure_args)\n \n@@ -146,7 +146,7 @@\n         elif self.settings.os == \"Neutrino\":\n             self._build_autotools_neutrino(configure_args)\n         else:\n-            raise ConanInvalidConfiguration(f\"Unsupported os for libsodium: {self.settings.os}\")\n+            raise ConanInvalidConfiguration(\"Unsupported os for libsodium: {}\".format(self.settings.os))\n \n     def build(self):\n         for patch in self.conan_data[\"patches\"][self.version]:\n", "issue": "[libsodium] libsodium/1.0.18: Recipe broken on Python < 3.6\nThe use of f-strings in the Python recipe causes the package to not be installed with a Python version that is less than 3.6. This is a serious problem for using conan with older distributions, such as Ubuntu Xenial or CentOS. Instead of f-strings, the `.format(...)` or `%` interpolation methods should be used.\r\n\r\n### Package and Environment Details\r\n  * Package Name/Version: **libsodium/1.0.18**\r\n\r\n### Conan output\r\n```\r\nERROR: Error loading conanfile at '~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py': Unable to load conanfile in ~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py\r\n  File \"/usr/lib/python3.5/imp.py\", line 172, in load_source\r\n    module = _load(spec)\r\n  File \"<frozen importlib._bootstrap>\", line 693, in _load\r\n  File \"<frozen importlib._bootstrap>\", line 673, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap_external>\", line 661, in exec_module\r\n  File \"<frozen importlib._bootstrap_external>\", line 767, in get_code\r\n  File \"<frozen importlib._bootstrap_external>\", line 727, in source_to_code\r\n  File \"<frozen importlib._bootstrap>\", line 222, in _call_with_frames_removed\r\n  File \"~/.conan/data/libsodium/1.0.18/_/_/export/conanfile.py\", line 126\r\n    raise ConanInvalidConfiguration(f\"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}\")\r\n                                                                                                                                 ^\r\nSyntaxError: invalid syntax\r\n```\r\n\r\n### Locations in Recipe\r\n```\r\nlibsodium/1.0.18/conanfile.py\r\n126:            raise ConanInvalidConfiguration(f\"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}\")\r\n148:            raise ConanInvalidConfiguration(f\"Unsupported os for libsodium: {self.settings.os}\")\r\n```\r\n\r\nThis is as far as I can tell the only package in this repository that uses f-strings.\n", "before_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, tools, MSBuild\nfrom conans.errors import ConanInvalidConfiguration\nimport os\n\n\nclass LibsodiumConan(ConanFile):\n    name        = \"libsodium\"\n    description = \"A modern and easy-to-use crypto library.\"\n    license     = \"ISC\"\n    url         = \"https://github.com/conan-io/conan-center-index\"\n    homepage    = \"https://download.libsodium.org/doc/\"\n    exports_sources = [\"patches/**\"]\n    settings    = \"os\", \"compiler\", \"arch\", \"build_type\"\n    topics = (\"sodium\", \"libsodium\", \"encryption\", \"signature\", \"hashing\")\n    generators  = \"cmake\"\n    _source_subfolder = \"source_subfolder\"\n\n    options = {\n        \"shared\" : [True, False],\n        \"fPIC\": [True, False],\n        \"use_soname\" : [True, False],\n        \"PIE\"    : [True, False],\n    }\n\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"use_soname\": True,\n        \"PIE\": False,\n    }\n\n    @property\n    def _android_id_str(self):\n        return \"androideabi\" if str(self.settings.arch) in [\"armv6\", \"armv7\"] else \"android\"\n\n    @property\n    def _is_mingw(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\"\n\n    @property\n    def _vs_configuration(self):\n        configuration = \"\"\n        if self.options.shared:\n            configuration += \"Dyn\"\n        else:\n            configuration += \"Static\"\n        build_type = \"Debug\" if self.settings.build_type == \"Debug\" else \"Release\"\n        configuration += build_type\n        return configuration\n\n    @property\n    def _vs_sln_folder(self):\n        folder = {\"14\": \"vs2015\",\n                  \"15\": \"vs2017\",\n                  \"16\": \"vs2019\"}.get(str(self.settings.compiler.version), None)\n        if not folder:\n            raise ConanInvalidConfiguration(\"Unsupported msvc version: {}\".format(self.settings.compiler.version))\n        return folder\n\n    def configure(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def build_requirements(self):\n        # There are several unix tools used (bash scripts for Emscripten, autoreconf on MinGW, etc...)\n        if self.settings.compiler != \"Visual Studio\" and tools.os_info.is_windows and \\\n                not \"CONAN_BASH_PATH\" in os.environ and tools.os_info.detect_windows_subsystem() != \"Windows\":\n            self.build_requires(\"msys2/20190524\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _build_visual(self):\n        sln_path = os.path.join(self.build_folder, self._source_subfolder, \"builds\", \"msvc\", self._vs_sln_folder, \"libsodium.sln\")\n\n        msbuild = MSBuild(self)\n        msbuild.build(sln_path, upgrade_project=False, platforms={\"x86\": \"Win32\"}, build_type=self._vs_configuration)\n\n    def _build_autotools_impl(self, configure_args):\n        win_bash = False\n        if self._is_mingw:\n            win_bash = True\n\n        autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)\n        if self._is_mingw:\n            self.run(\"autoreconf -i\", cwd=self._source_subfolder, win_bash=win_bash)\n        autotools.configure(args=configure_args, configure_dir=self._source_subfolder, host=False)\n        autotools.make(args=[\"-j%s\" % str(tools.cpu_count())])\n        autotools.install()\n\n    def _build_autotools_linux(self, configure_args):\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_emscripten(self, configure_args):\n        self.run(\"./dist-build/emscripten.sh --standard\", cwd=self._source_subfolder)\n\n    def _build_autotools_android(self, configure_args):\n        host_arch = \"%s-linux-%s\" % (tools.to_android_abi(self.settings.arch), self._android_id_str)\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_mingw(self, configure_args):\n        arch = \"i686\" if self.settings.arch == \"x86\" else self.settings.arch\n        host_arch = \"%s-w64-mingw32\" % arch\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_darwin(self, configure_args):\n        os = \"ios\" if self.settings.os == \"iOS\" else \"darwin\"\n        host_arch = \"%s-apple-%s\" % (self.settings.arch, os)\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_neutrino(self, configure_args):\n        neutrino_archs = {\"x86_64\":\"x86_64-pc\", \"x86\":\"i586-pc\", \"armv7\":\"arm-unknown\", \"armv8\": \"aarch64-unknown\"}\n        if self.settings.os.version == \"7.0\" and str(self.settings.arch) in neutrino_archs:\n            host_arch = \"%s-nto-qnx7.0.0\" % neutrino_archs[str(self.settings.arch)]\n            if self.settings.arch == \"armv7\":\n                host_arch += \"eabi\"\n        else:\n            raise ConanInvalidConfiguration(f\"Unsupported arch or Neutrino version for libsodium: {self.settings.os} {self.settings.arch}\")\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools(self):\n        absolute_install_dir = os.path.abspath(os.path.join(\".\", \"install\"))\n        absolute_install_dir = absolute_install_dir.replace(\"\\\\\", \"/\")\n        configure_args = self._get_configure_args(absolute_install_dir)\n\n        if self.settings.os == \"Linux\":\n            self._build_autotools_linux(configure_args)\n        elif self.settings.os == \"Emscripten\":\n            self._build_autotools_emscripten(configure_args)\n        elif self.settings.os == \"Android\":\n            self._build_autotools_android(configure_args)\n        elif tools.is_apple_os(self.settings.os):\n            self._build_autotools_darwin(configure_args)\n        elif self._is_mingw:\n            self._build_autotools_mingw(configure_args)\n        elif self.settings.os == \"Neutrino\":\n            self._build_autotools_neutrino(configure_args)\n        else:\n            raise ConanInvalidConfiguration(f\"Unsupported os for libsodium: {self.settings.os}\")\n\n    def build(self):\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n        if self.settings.os == \"Macos\":\n            tools.replace_in_file(os.path.join(self._source_subfolder, \"configure\"), r\"-install_name \\$rpath/\", \"-install_name \")\n        if self.settings.compiler != \"Visual Studio\":\n            self._build_autotools()\n        else:\n            self._build_visual()\n\n    def package(self):\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n        if self.settings.compiler == \"Visual Studio\":\n            self._package_visual()\n        else:\n            self._package_autotools()\n\n    def package_info(self):\n        if self.settings.compiler == \"Visual Studio\":\n            if not self.options.shared:\n                self.cpp_info.defines = [\"SODIUM_STATIC=1\"]\n        self.cpp_info.libs = tools.collect_libs(self)\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs = [\"pthread\"]\n\n    def _package_autotools(self):\n        if self.settings.os == \"Emscripten\":\n            prefix = \"%s/libsodium-js\" % self._source_subfolder\n        else:\n            prefix = \"install\"\n        lib_folder = os.path.join(prefix, \"lib\")\n        self.copy(\"*.h\", dst=\"include\", src=os.path.join(prefix, \"include\"))\n        self.copy(\"*.a\", dst=\"lib\", src=lib_folder)\n        self.copy(\"*.so*\", dst=\"lib\", src=lib_folder, symlinks=True)\n        self.copy(\"*.dylib\", dst=\"lib\", src=lib_folder, symlinks=True)\n\n    def _package_visual(self):\n        self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n        self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n        inc_src = os.path.join(self._source_subfolder, \"src\", self.name, \"include\")\n        self.copy(\"*.h\", src=inc_src, dst=\"include\", keep_path=True, excludes=(\"*/private/*\"))\n\n    def _autotools_bool_arg(self, arg_base_name, value):\n        prefix = \"--enable-\" if value else \"--disable-\"\n        return prefix + arg_base_name\n\n    def _get_configure_args(self, absolute_install_dir):\n        args = [\n            \"--prefix=%s\" % absolute_install_dir,\n            self._autotools_bool_arg(\"shared\", self.options.shared),\n            self._autotools_bool_arg(\"static\", not self.options.shared),\n            self._autotools_bool_arg(\"soname-versions\", self.options.use_soname),\n            self._autotools_bool_arg(\"pie\", self.options.PIE)\n        ]\n        if self.options.get_safe(\"fPIC\"):\n            args.append(\"--with-pic\")\n        return args\n", "path": "recipes/libsodium/1.0.18/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, AutoToolsBuildEnvironment, tools, MSBuild\nfrom conans.errors import ConanInvalidConfiguration\nimport os\n\n\nclass LibsodiumConan(ConanFile):\n    name        = \"libsodium\"\n    description = \"A modern and easy-to-use crypto library.\"\n    license     = \"ISC\"\n    url         = \"https://github.com/conan-io/conan-center-index\"\n    homepage    = \"https://download.libsodium.org/doc/\"\n    exports_sources = [\"patches/**\"]\n    settings    = \"os\", \"compiler\", \"arch\", \"build_type\"\n    topics = (\"sodium\", \"libsodium\", \"encryption\", \"signature\", \"hashing\")\n    generators  = \"cmake\"\n    _source_subfolder = \"source_subfolder\"\n\n    options = {\n        \"shared\" : [True, False],\n        \"fPIC\": [True, False],\n        \"use_soname\" : [True, False],\n        \"PIE\"    : [True, False],\n    }\n\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"use_soname\": True,\n        \"PIE\": False,\n    }\n\n    @property\n    def _android_id_str(self):\n        return \"androideabi\" if str(self.settings.arch) in [\"armv6\", \"armv7\"] else \"android\"\n\n    @property\n    def _is_mingw(self):\n        return self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\"\n\n    @property\n    def _vs_configuration(self):\n        configuration = \"\"\n        if self.options.shared:\n            configuration += \"Dyn\"\n        else:\n            configuration += \"Static\"\n        build_type = \"Debug\" if self.settings.build_type == \"Debug\" else \"Release\"\n        configuration += build_type\n        return configuration\n\n    @property\n    def _vs_sln_folder(self):\n        folder = {\"14\": \"vs2015\",\n                  \"15\": \"vs2017\",\n                  \"16\": \"vs2019\"}.get(str(self.settings.compiler.version), None)\n        if not folder:\n            raise ConanInvalidConfiguration(\"Unsupported msvc version: {}\".format(self.settings.compiler.version))\n        return folder\n\n    def configure(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def build_requirements(self):\n        # There are several unix tools used (bash scripts for Emscripten, autoreconf on MinGW, etc...)\n        if self.settings.compiler != \"Visual Studio\" and tools.os_info.is_windows and \\\n                not \"CONAN_BASH_PATH\" in os.environ and tools.os_info.detect_windows_subsystem() != \"Windows\":\n            self.build_requires(\"msys2/20190524\")\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _build_visual(self):\n        sln_path = os.path.join(self.build_folder, self._source_subfolder, \"builds\", \"msvc\", self._vs_sln_folder, \"libsodium.sln\")\n\n        msbuild = MSBuild(self)\n        msbuild.build(sln_path, upgrade_project=False, platforms={\"x86\": \"Win32\"}, build_type=self._vs_configuration)\n\n    def _build_autotools_impl(self, configure_args):\n        win_bash = False\n        if self._is_mingw:\n            win_bash = True\n\n        autotools = AutoToolsBuildEnvironment(self, win_bash=win_bash)\n        if self._is_mingw:\n            self.run(\"autoreconf -i\", cwd=self._source_subfolder, win_bash=win_bash)\n        autotools.configure(args=configure_args, configure_dir=self._source_subfolder, host=False)\n        autotools.make(args=[\"-j%s\" % str(tools.cpu_count())])\n        autotools.install()\n\n    def _build_autotools_linux(self, configure_args):\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_emscripten(self, configure_args):\n        self.run(\"./dist-build/emscripten.sh --standard\", cwd=self._source_subfolder)\n\n    def _build_autotools_android(self, configure_args):\n        host_arch = \"%s-linux-%s\" % (tools.to_android_abi(self.settings.arch), self._android_id_str)\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_mingw(self, configure_args):\n        arch = \"i686\" if self.settings.arch == \"x86\" else self.settings.arch\n        host_arch = \"%s-w64-mingw32\" % arch\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_darwin(self, configure_args):\n        os = \"ios\" if self.settings.os == \"iOS\" else \"darwin\"\n        host_arch = \"%s-apple-%s\" % (self.settings.arch, os)\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools_neutrino(self, configure_args):\n        neutrino_archs = {\"x86_64\":\"x86_64-pc\", \"x86\":\"i586-pc\", \"armv7\":\"arm-unknown\", \"armv8\": \"aarch64-unknown\"}\n        if self.settings.os.version == \"7.0\" and str(self.settings.arch) in neutrino_archs:\n            host_arch = \"%s-nto-qnx7.0.0\" % neutrino_archs[str(self.settings.arch)]\n            if self.settings.arch == \"armv7\":\n                host_arch += \"eabi\"\n        else:\n            raise ConanInvalidConfiguration(\"Unsupported arch or Neutrino version for libsodium: {} {}\".format(self.settings.os, self.settings.arch))\n        configure_args.append(\"--host=%s\" % host_arch)\n        self._build_autotools_impl(configure_args)\n\n    def _build_autotools(self):\n        absolute_install_dir = os.path.abspath(os.path.join(\".\", \"install\"))\n        absolute_install_dir = absolute_install_dir.replace(\"\\\\\", \"/\")\n        configure_args = self._get_configure_args(absolute_install_dir)\n\n        if self.settings.os == \"Linux\":\n            self._build_autotools_linux(configure_args)\n        elif self.settings.os == \"Emscripten\":\n            self._build_autotools_emscripten(configure_args)\n        elif self.settings.os == \"Android\":\n            self._build_autotools_android(configure_args)\n        elif tools.is_apple_os(self.settings.os):\n            self._build_autotools_darwin(configure_args)\n        elif self._is_mingw:\n            self._build_autotools_mingw(configure_args)\n        elif self.settings.os == \"Neutrino\":\n            self._build_autotools_neutrino(configure_args)\n        else:\n            raise ConanInvalidConfiguration(\"Unsupported os for libsodium: {}\".format(self.settings.os))\n\n    def build(self):\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n        if self.settings.os == \"Macos\":\n            tools.replace_in_file(os.path.join(self._source_subfolder, \"configure\"), r\"-install_name \\$rpath/\", \"-install_name \")\n        if self.settings.compiler != \"Visual Studio\":\n            self._build_autotools()\n        else:\n            self._build_visual()\n\n    def package(self):\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n        if self.settings.compiler == \"Visual Studio\":\n            self._package_visual()\n        else:\n            self._package_autotools()\n\n    def package_info(self):\n        if self.settings.compiler == \"Visual Studio\":\n            if not self.options.shared:\n                self.cpp_info.defines = [\"SODIUM_STATIC=1\"]\n        self.cpp_info.libs = tools.collect_libs(self)\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs = [\"pthread\"]\n\n    def _package_autotools(self):\n        if self.settings.os == \"Emscripten\":\n            prefix = \"%s/libsodium-js\" % self._source_subfolder\n        else:\n            prefix = \"install\"\n        lib_folder = os.path.join(prefix, \"lib\")\n        self.copy(\"*.h\", dst=\"include\", src=os.path.join(prefix, \"include\"))\n        self.copy(\"*.a\", dst=\"lib\", src=lib_folder)\n        self.copy(\"*.so*\", dst=\"lib\", src=lib_folder, symlinks=True)\n        self.copy(\"*.dylib\", dst=\"lib\", src=lib_folder, symlinks=True)\n\n    def _package_visual(self):\n        self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n        self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n        inc_src = os.path.join(self._source_subfolder, \"src\", self.name, \"include\")\n        self.copy(\"*.h\", src=inc_src, dst=\"include\", keep_path=True, excludes=(\"*/private/*\"))\n\n    def _autotools_bool_arg(self, arg_base_name, value):\n        prefix = \"--enable-\" if value else \"--disable-\"\n        return prefix + arg_base_name\n\n    def _get_configure_args(self, absolute_install_dir):\n        args = [\n            \"--prefix=%s\" % absolute_install_dir,\n            self._autotools_bool_arg(\"shared\", self.options.shared),\n            self._autotools_bool_arg(\"static\", not self.options.shared),\n            self._autotools_bool_arg(\"soname-versions\", self.options.use_soname),\n            self._autotools_bool_arg(\"pie\", self.options.PIE)\n        ]\n        if self.options.get_safe(\"fPIC\"):\n            args.append(\"--with-pic\")\n        return args\n", "path": "recipes/libsodium/1.0.18/conanfile.py"}]}