We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[request]  sqlcipher/4.4.3
### Package Details
  * Package Name/Version: ** sqlcipher/4.4.3**
  * Changelog: **https://github.com/sqlcipher/sqlcipher/blob/master/CHANGELOG.md**
----
  * works on Mac Catalyst 

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/sqlcipher/all/conanfile.py`
Content:
```
1 from conans import tools, ConanFile, AutoToolsBuildEnvironment, RunEnvironment
2 import platform
3 import sys
4 import os
5 
6 
7 class SqlcipherConan(ConanFile):
8     name = "sqlcipher"
9     license = "BSD-3-Clause"
10     url = "https://github.com/conan-io/conan-center-index"
11     homepage = "https://www.zetetic.net/sqlcipher/"
12     description = "SQLite extension that provides 256 bit AES encryption of database files."
13     settings = "os", "compiler", "build_type", "arch"
14     options = {
15                 "shared": [True, False],
16                 "fPIC": [True, False],
17                 "crypto_library": ["openssl", "libressl"],
18                 "with_largefile": [True, False],
19                 "temporary_store": ["always_file", "default_file", "default_memory", "always_memory"]
20               }
21     default_options = {
22                         "shared": False,
23                         "fPIC": True,
24                         "crypto_library": "openssl",
25                         "with_largefile": True,
26                         "temporary_store": "default_memory"
27                       }
28     topics = ("database", "encryption", "SQLite")
29     exports_sources = "patches/*"
30     generators = "cmake"
31     _source_subfolder = "source_subfolder"
32 
33 
34     def config_options(self):
35         del self.settings.compiler.libcxx
36         del self.settings.compiler.cppstd
37         if self.settings.os != "Linux":
38             del self.options.with_largefile
39         if self.settings.os == "Windows":
40             del self.options.fPIC
41 
42     def build_requirements(self):
43         # It is possible to have a MinGW cross-build toolchain (Linux to Windows)
44         # Only require msys2 when building on an actual Windows system
45         if self.settings.os == "Windows" and self.settings.compiler == "gcc" and tools.os_info.is_windows:
46             self.build_requires("msys2/20190524")
47         self.build_requires("tcl/8.6.10")
48 
49     def requirements(self):
50         if self.options.crypto_library == "openssl":
51             self.requires("openssl/1.1.1h")
52         else:
53             self.requires("libressl/3.2.0")
54 
55     def source(self):
56         tools.get(**self.conan_data["sources"][self.version])
57         extracted_dir = self.name + "-" + self.version
58         os.rename(extracted_dir, self._source_subfolder)
59 
60     @property
61     def _temp_store_nmake_value(self):
62         return {"always_file": "0",
63                 "default_file": "1",
64                 "default_memory": "2",
65                 "always_memory": "3"}.get(str(self.options.temporary_store))
66 
67     @property
68     def _temp_store_autotools_value(self):
69         return {"always_file": "never",
70                 "default_file": "no",
71                 "default_memory": "yes",
72                 "always_memory": "always"}.get(str(self.options.temporary_store))
73 
74     def _build_visual(self):
75         crypto_dep = self.deps_cpp_info[str(self.options.crypto_library)]
76         crypto_incdir = crypto_dep.include_paths[0]
77         crypto_libdir = crypto_dep.lib_paths[0]
78         libs = map(lambda lib : lib + ".lib", crypto_dep.libs)
79         system_libs = map(lambda lib : lib + ".lib", crypto_dep.system_libs)
80 
81         nmake_flags = [
82                 "TLIBS=\"%s %s\"" % (" ".join(libs), " ".join(system_libs)),
83                 "LTLIBPATHS=/LIBPATH:%s" % crypto_libdir,
84                 "OPTS=\"-I%s -DSQLITE_HAS_CODEC\"" % (crypto_incdir),
85                 "NO_TCL=1",
86                 "USE_AMALGAMATION=1",
87                 "OPT_FEATURE_FLAGS=-DSQLCIPHER_CRYPTO_OPENSSL",
88                 "SQLITE_TEMP_STORE=%s" % self._temp_store_nmake_value,
89                 "TCLSH_CMD=%s" % self.deps_env_info.TCLSH,
90                 ]
91 
92         main_target = "dll" if self.options.shared else "sqlcipher.lib"
93 
94         if self.settings.compiler.runtime in ["MD", "MDd"]:
95             nmake_flags.append("USE_CRT_DLL=1")
96         if self.settings.build_type == "Debug":
97             nmake_flags.append("DEBUG=2")
98         nmake_flags.append("FOR_WIN10=1")
99         platforms = {"x86": "x86", "x86_64": "x64"}
100         nmake_flags.append("PLATFORM=%s" % platforms[self.settings.arch.value])
101         vcvars = tools.vcvars_command(self.settings)
102         self.run("%s && nmake /f Makefile.msc %s %s" % (vcvars, main_target, " ".join(nmake_flags)), cwd=self._source_subfolder)
103 
104     def _build_autotools(self):
105         self.run('chmod +x configure', cwd=self._source_subfolder)
106         absolute_install_dir = os.path.abspath(os.path.join(".", "install"))
107         absolute_install_dir = absolute_install_dir.replace("\\", "/")
108         autotools_env = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
109         if self.settings.os == "Linux":
110             autotools_env.libs.append("dl")
111             if not self.options.with_largefile:
112                 autotools_env.defines.append("SQLITE_DISABLE_LFS=1")
113         autotools_env.defines.extend(["SQLITE_HAS_CODEC", "SQLCIPHER_CRYPTO_OPENSSL"])
114 
115         # sqlcipher config.sub does not contain android configurations...
116         # elf is the most basic `os' for Android
117         host = None
118         if self.settings.os == "Android":
119             host = "%s-linux-elf" % self._arch_id_str_compiler
120         elif self.settings.os == "Windows":
121             arch = str(self.settings.arch)
122             if arch == "x86":
123                 arch = "i386"
124             host = "%s-pc-mingw32" % arch
125         elif self.settings.os == "iOS":
126             host = "%s-apple-darwin" % self.settings.arch
127 
128         configure_args = self._get_configure_args(absolute_install_dir)
129         with tools.chdir(self._source_subfolder):
130             # Hack, uname -p returns i386, configure guesses x86_64, we must force i386 so that cross-compilation is correctly detected.
131             # Otherwise host/build are the same, and configure tries to launch a sample executable, and fails miserably.
132             env_vars = autotools_env.vars
133             if self.settings.os == "iOS":
134                 build = "i386-apple-darwin"
135             # same for mingw...
136             elif self.settings.os == "Windows":
137                 build = "x86_64-linux"
138                 env_vars["config_TARGET_EXEEXT"] = ".exe"
139             else:
140                 build = None
141             tclsh_cmd = self.deps_env_info.TCLSH
142             env_vars["TCLSH_CMD"] = tclsh_cmd.replace("\\", "/")
143             autotools_env.configure(args=configure_args, host=host, build=build, vars=env_vars)
144             if self.settings.os == "Windows":
145                 # sqlcipher will create .exe for the build machine, which we defined to Linux...
146                 tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, "Makefile"), "BEXE = .exe", "BEXE = ")
147             autotools_env.make(args=["install"])
148 
149     @property
150     def _arch_id_str_compiler(self):
151         return {"x86": "i686",
152                 "armv6": "arm",
153                 "armv7": "arm",
154                 "armv7hf": "arm",
155                 # Hack: config.guess of sqlcipher does not like aarch64
156                 "armv8": "armv8",
157                 "mips64": "mips64"}.get(str(self.settings.arch),
158                                         str(self.settings.arch))
159 
160     def _get_configure_args(self, absolute_install_dir):
161         args = [
162             "--prefix=%s" % absolute_install_dir,
163 
164             self._autotools_bool_arg("shared", self.options.shared),
165             self._autotools_bool_arg("static", not self.options.shared),
166             "--enable-tempstore=%s" % self._temp_store_autotools_value,
167             "--disable-tcl",
168         ]
169         if self.settings.os == "Windows":
170             args.extend(["config_BUILD_EXEEXT='.exe'", "config_TARGET_EXEEXT='.exe'"])
171         return args
172 
173     def _autotools_bool_arg(self, arg_base_name, value):
174         prefix = "--enable-" if value else "--disable-"
175 
176         return prefix + arg_base_name
177 
178     def build(self):
179         for patch in self.conan_data["patches"][self.version]:
180             tools.patch(**patch)
181         if self.settings.os == "Macos":
182             tools.replace_in_file(os.path.join(self._source_subfolder, "configure"), r"-install_name \$rpath/", "-install_name ")
183 
184         if self.settings.compiler == "Visual Studio":
185             self._build_visual()
186         else:
187             self._build_autotools()
188 
189     def _package_unix(self):
190         self.copy("*sqlite3.h", src="install")
191         self.copy("*.so*", dst="lib", src="install", keep_path=False, symlinks=True)
192         self.copy("*.a", dst="lib", src="install", keep_path=False)
193         self.copy("*.lib", dst="lib", src="install", keep_path=False)
194         self.copy("*.dll", dst="bin", src="install", keep_path=False)
195         self.copy("*.dylib", dst="lib", src="install", keep_path=False)
196         self.copy("*LICENSE", dst="licenses", keep_path=False)
197 
198     def _package_visual(self):
199         self.copy("*.dll", dst="bin", keep_path=False)
200         self.copy("*.lib", dst="lib", keep_path=False)
201         self.copy("*LICENSE", dst="licenses", keep_path=False)
202         self.copy("sqlite3.h", src=self._source_subfolder, dst=os.path.join("include", "sqlcipher"))
203 
204     def package(self):
205         if self.settings.compiler == "Visual Studio":
206             self._package_visual()
207         else:
208             self._package_unix()
209 
210     def package_info(self):
211         self.cpp_info.libs = ["sqlcipher"]
212         if self.settings.os == "Linux":
213             self.cpp_info.system_libs.extend(["pthread", "dl"])
214         self.cpp_info.defines = ["SQLITE_HAS_CODEC", 'SQLCIPHER_CRYPTO_OPENSSL', 'SQLITE_TEMP_STORE=%s' % self._temp_store_nmake_value]
215         # Allow using #include <sqlite3.h> even with sqlcipher (for libs like sqlpp11-connector-sqlite3)
216         self.cpp_info.includedirs.append(os.path.join("include", "sqlcipher"))
217
```
--- 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/sqlcipher/all/conanfile.py b/recipes/sqlcipher/all/conanfile.py
--- a/recipes/sqlcipher/all/conanfile.py
+++ b/recipes/sqlcipher/all/conanfile.py
@@ -39,6 +39,10 @@
         if self.settings.os == "Windows":
             del self.options.fPIC
 
+    def configure(self):
+        if self.options.shared:
+            del self.options.fPIC
+
     def build_requirements(self):
         # It is possible to have a MinGW cross-build toolchain (Linux to Windows)
         # Only require msys2 when building on an actual Windows system
@@ -48,7 +52,7 @@
 
     def requirements(self):
         if self.options.crypto_library == "openssl":
-            self.requires("openssl/1.1.1h")
+            self.requires("openssl/1.1.1k")
         else:
             self.requires("libressl/3.2.0")

{"golden_diff": "diff --git a/recipes/sqlcipher/all/conanfile.py b/recipes/sqlcipher/all/conanfile.py\n--- a/recipes/sqlcipher/all/conanfile.py\n+++ b/recipes/sqlcipher/all/conanfile.py\n@@ -39,6 +39,10 @@\n         if self.settings.os == \"Windows\":\n             del self.options.fPIC\n \n+    def configure(self):\n+        if self.options.shared:\n+            del self.options.fPIC\n+\n     def build_requirements(self):\n         # It is possible to have a MinGW cross-build toolchain (Linux to Windows)\n         # Only require msys2 when building on an actual Windows system\n@@ -48,7 +52,7 @@\n \n     def requirements(self):\n         if self.options.crypto_library == \"openssl\":\n-            self.requires(\"openssl/1.1.1h\")\n+            self.requires(\"openssl/1.1.1k\")\n         else:\n             self.requires(\"libressl/3.2.0\")\n", "issue": "[request]  sqlcipher/4.4.3\n### Package Details\r\n  * Package Name/Version: ** sqlcipher/4.4.3**\r\n  * Changelog: **https://github.com/sqlcipher/sqlcipher/blob/master/CHANGELOG.md**\r\n----\r\n  * works on Mac Catalyst \r\n\r\nThe above mentioned version is newly released by the upstream project and not yet available as a recipe. Please add this version.\r\n\n", "before_files": [{"content": "from conans import tools, ConanFile, AutoToolsBuildEnvironment, RunEnvironment\nimport platform\nimport sys\nimport os\n\n\nclass SqlcipherConan(ConanFile):\n    name = \"sqlcipher\"\n    license = \"BSD-3-Clause\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://www.zetetic.net/sqlcipher/\"\n    description = \"SQLite extension that provides 256 bit AES encryption of database files.\"\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\n                \"shared\": [True, False],\n                \"fPIC\": [True, False],\n                \"crypto_library\": [\"openssl\", \"libressl\"],\n                \"with_largefile\": [True, False],\n                \"temporary_store\": [\"always_file\", \"default_file\", \"default_memory\", \"always_memory\"]\n              }\n    default_options = {\n                        \"shared\": False,\n                        \"fPIC\": True,\n                        \"crypto_library\": \"openssl\",\n                        \"with_largefile\": True,\n                        \"temporary_store\": \"default_memory\"\n                      }\n    topics = (\"database\", \"encryption\", \"SQLite\")\n    exports_sources = \"patches/*\"\n    generators = \"cmake\"\n    _source_subfolder = \"source_subfolder\"\n\n\n    def config_options(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n        if self.settings.os != \"Linux\":\n            del self.options.with_largefile\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def build_requirements(self):\n        # It is possible to have a MinGW cross-build toolchain (Linux to Windows)\n        # Only require msys2 when building on an actual Windows system\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\" and tools.os_info.is_windows:\n            self.build_requires(\"msys2/20190524\")\n        self.build_requires(\"tcl/8.6.10\")\n\n    def requirements(self):\n        if self.options.crypto_library == \"openssl\":\n            self.requires(\"openssl/1.1.1h\")\n        else:\n            self.requires(\"libressl/3.2.0\")\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    @property\n    def _temp_store_nmake_value(self):\n        return {\"always_file\": \"0\",\n                \"default_file\": \"1\",\n                \"default_memory\": \"2\",\n                \"always_memory\": \"3\"}.get(str(self.options.temporary_store))\n\n    @property\n    def _temp_store_autotools_value(self):\n        return {\"always_file\": \"never\",\n                \"default_file\": \"no\",\n                \"default_memory\": \"yes\",\n                \"always_memory\": \"always\"}.get(str(self.options.temporary_store))\n\n    def _build_visual(self):\n        crypto_dep = self.deps_cpp_info[str(self.options.crypto_library)]\n        crypto_incdir = crypto_dep.include_paths[0]\n        crypto_libdir = crypto_dep.lib_paths[0]\n        libs = map(lambda lib : lib + \".lib\", crypto_dep.libs)\n        system_libs = map(lambda lib : lib + \".lib\", crypto_dep.system_libs)\n\n        nmake_flags = [\n                \"TLIBS=\\\"%s %s\\\"\" % (\" \".join(libs), \" \".join(system_libs)),\n                \"LTLIBPATHS=/LIBPATH:%s\" % crypto_libdir,\n                \"OPTS=\\\"-I%s -DSQLITE_HAS_CODEC\\\"\" % (crypto_incdir),\n                \"NO_TCL=1\",\n                \"USE_AMALGAMATION=1\",\n                \"OPT_FEATURE_FLAGS=-DSQLCIPHER_CRYPTO_OPENSSL\",\n                \"SQLITE_TEMP_STORE=%s\" % self._temp_store_nmake_value,\n                \"TCLSH_CMD=%s\" % self.deps_env_info.TCLSH,\n                ]\n\n        main_target = \"dll\" if self.options.shared else \"sqlcipher.lib\"\n\n        if self.settings.compiler.runtime in [\"MD\", \"MDd\"]:\n            nmake_flags.append(\"USE_CRT_DLL=1\")\n        if self.settings.build_type == \"Debug\":\n            nmake_flags.append(\"DEBUG=2\")\n        nmake_flags.append(\"FOR_WIN10=1\")\n        platforms = {\"x86\": \"x86\", \"x86_64\": \"x64\"}\n        nmake_flags.append(\"PLATFORM=%s\" % platforms[self.settings.arch.value])\n        vcvars = tools.vcvars_command(self.settings)\n        self.run(\"%s && nmake /f Makefile.msc %s %s\" % (vcvars, main_target, \" \".join(nmake_flags)), cwd=self._source_subfolder)\n\n    def _build_autotools(self):\n        self.run('chmod +x configure', cwd=self._source_subfolder)\n        absolute_install_dir = os.path.abspath(os.path.join(\".\", \"install\"))\n        absolute_install_dir = absolute_install_dir.replace(\"\\\\\", \"/\")\n        autotools_env = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n        if self.settings.os == \"Linux\":\n            autotools_env.libs.append(\"dl\")\n            if not self.options.with_largefile:\n                autotools_env.defines.append(\"SQLITE_DISABLE_LFS=1\")\n        autotools_env.defines.extend([\"SQLITE_HAS_CODEC\", \"SQLCIPHER_CRYPTO_OPENSSL\"])\n\n        # sqlcipher config.sub does not contain android configurations...\n        # elf is the most basic `os' for Android\n        host = None\n        if self.settings.os == \"Android\":\n            host = \"%s-linux-elf\" % self._arch_id_str_compiler\n        elif self.settings.os == \"Windows\":\n            arch = str(self.settings.arch)\n            if arch == \"x86\":\n                arch = \"i386\"\n            host = \"%s-pc-mingw32\" % arch\n        elif self.settings.os == \"iOS\":\n            host = \"%s-apple-darwin\" % self.settings.arch\n\n        configure_args = self._get_configure_args(absolute_install_dir)\n        with tools.chdir(self._source_subfolder):\n            # Hack, uname -p returns i386, configure guesses x86_64, we must force i386 so that cross-compilation is correctly detected.\n            # Otherwise host/build are the same, and configure tries to launch a sample executable, and fails miserably.\n            env_vars = autotools_env.vars\n            if self.settings.os == \"iOS\":\n                build = \"i386-apple-darwin\"\n            # same for mingw...\n            elif self.settings.os == \"Windows\":\n                build = \"x86_64-linux\"\n                env_vars[\"config_TARGET_EXEEXT\"] = \".exe\"\n            else:\n                build = None\n            tclsh_cmd = self.deps_env_info.TCLSH\n            env_vars[\"TCLSH_CMD\"] = tclsh_cmd.replace(\"\\\\\", \"/\")\n            autotools_env.configure(args=configure_args, host=host, build=build, vars=env_vars)\n            if self.settings.os == \"Windows\":\n                # sqlcipher will create .exe for the build machine, which we defined to Linux...\n                tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, \"Makefile\"), \"BEXE = .exe\", \"BEXE = \")\n            autotools_env.make(args=[\"install\"])\n\n    @property\n    def _arch_id_str_compiler(self):\n        return {\"x86\": \"i686\",\n                \"armv6\": \"arm\",\n                \"armv7\": \"arm\",\n                \"armv7hf\": \"arm\",\n                # Hack: config.guess of sqlcipher does not like aarch64\n                \"armv8\": \"armv8\",\n                \"mips64\": \"mips64\"}.get(str(self.settings.arch),\n                                        str(self.settings.arch))\n\n    def _get_configure_args(self, absolute_install_dir):\n        args = [\n            \"--prefix=%s\" % absolute_install_dir,\n\n            self._autotools_bool_arg(\"shared\", self.options.shared),\n            self._autotools_bool_arg(\"static\", not self.options.shared),\n            \"--enable-tempstore=%s\" % self._temp_store_autotools_value,\n            \"--disable-tcl\",\n        ]\n        if self.settings.os == \"Windows\":\n            args.extend([\"config_BUILD_EXEEXT='.exe'\", \"config_TARGET_EXEEXT='.exe'\"])\n        return args\n\n    def _autotools_bool_arg(self, arg_base_name, value):\n        prefix = \"--enable-\" if value else \"--disable-\"\n\n        return prefix + arg_base_name\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\n        if self.settings.compiler == \"Visual Studio\":\n            self._build_visual()\n        else:\n            self._build_autotools()\n\n    def _package_unix(self):\n        self.copy(\"*sqlite3.h\", src=\"install\")\n        self.copy(\"*.so*\", dst=\"lib\", src=\"install\", keep_path=False, symlinks=True)\n        self.copy(\"*.a\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*.lib\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*.dll\", dst=\"bin\", src=\"install\", keep_path=False)\n        self.copy(\"*.dylib\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n\n    def _package_visual(self):\n        self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n        self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n        self.copy(\"sqlite3.h\", src=self._source_subfolder, dst=os.path.join(\"include\", \"sqlcipher\"))\n\n    def package(self):\n        if self.settings.compiler == \"Visual Studio\":\n            self._package_visual()\n        else:\n            self._package_unix()\n\n    def package_info(self):\n        self.cpp_info.libs = [\"sqlcipher\"]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"pthread\", \"dl\"])\n        self.cpp_info.defines = [\"SQLITE_HAS_CODEC\", 'SQLCIPHER_CRYPTO_OPENSSL', 'SQLITE_TEMP_STORE=%s' % self._temp_store_nmake_value]\n        # Allow using #include <sqlite3.h> even with sqlcipher (for libs like sqlpp11-connector-sqlite3)\n        self.cpp_info.includedirs.append(os.path.join(\"include\", \"sqlcipher\"))\n", "path": "recipes/sqlcipher/all/conanfile.py"}], "after_files": [{"content": "from conans import tools, ConanFile, AutoToolsBuildEnvironment, RunEnvironment\nimport platform\nimport sys\nimport os\n\n\nclass SqlcipherConan(ConanFile):\n    name = \"sqlcipher\"\n    license = \"BSD-3-Clause\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://www.zetetic.net/sqlcipher/\"\n    description = \"SQLite extension that provides 256 bit AES encryption of database files.\"\n    settings = \"os\", \"compiler\", \"build_type\", \"arch\"\n    options = {\n                \"shared\": [True, False],\n                \"fPIC\": [True, False],\n                \"crypto_library\": [\"openssl\", \"libressl\"],\n                \"with_largefile\": [True, False],\n                \"temporary_store\": [\"always_file\", \"default_file\", \"default_memory\", \"always_memory\"]\n              }\n    default_options = {\n                        \"shared\": False,\n                        \"fPIC\": True,\n                        \"crypto_library\": \"openssl\",\n                        \"with_largefile\": True,\n                        \"temporary_store\": \"default_memory\"\n                      }\n    topics = (\"database\", \"encryption\", \"SQLite\")\n    exports_sources = \"patches/*\"\n    generators = \"cmake\"\n    _source_subfolder = \"source_subfolder\"\n\n\n    def config_options(self):\n        del self.settings.compiler.libcxx\n        del self.settings.compiler.cppstd\n        if self.settings.os != \"Linux\":\n            del self.options.with_largefile\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n\n    def build_requirements(self):\n        # It is possible to have a MinGW cross-build toolchain (Linux to Windows)\n        # Only require msys2 when building on an actual Windows system\n        if self.settings.os == \"Windows\" and self.settings.compiler == \"gcc\" and tools.os_info.is_windows:\n            self.build_requires(\"msys2/20190524\")\n        self.build_requires(\"tcl/8.6.10\")\n\n    def requirements(self):\n        if self.options.crypto_library == \"openssl\":\n            self.requires(\"openssl/1.1.1k\")\n        else:\n            self.requires(\"libressl/3.2.0\")\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    @property\n    def _temp_store_nmake_value(self):\n        return {\"always_file\": \"0\",\n                \"default_file\": \"1\",\n                \"default_memory\": \"2\",\n                \"always_memory\": \"3\"}.get(str(self.options.temporary_store))\n\n    @property\n    def _temp_store_autotools_value(self):\n        return {\"always_file\": \"never\",\n                \"default_file\": \"no\",\n                \"default_memory\": \"yes\",\n                \"always_memory\": \"always\"}.get(str(self.options.temporary_store))\n\n    def _build_visual(self):\n        crypto_dep = self.deps_cpp_info[str(self.options.crypto_library)]\n        crypto_incdir = crypto_dep.include_paths[0]\n        crypto_libdir = crypto_dep.lib_paths[0]\n        libs = map(lambda lib : lib + \".lib\", crypto_dep.libs)\n        system_libs = map(lambda lib : lib + \".lib\", crypto_dep.system_libs)\n\n        nmake_flags = [\n                \"TLIBS=\\\"%s %s\\\"\" % (\" \".join(libs), \" \".join(system_libs)),\n                \"LTLIBPATHS=/LIBPATH:%s\" % crypto_libdir,\n                \"OPTS=\\\"-I%s -DSQLITE_HAS_CODEC\\\"\" % (crypto_incdir),\n                \"NO_TCL=1\",\n                \"USE_AMALGAMATION=1\",\n                \"OPT_FEATURE_FLAGS=-DSQLCIPHER_CRYPTO_OPENSSL\",\n                \"SQLITE_TEMP_STORE=%s\" % self._temp_store_nmake_value,\n                \"TCLSH_CMD=%s\" % self.deps_env_info.TCLSH,\n                ]\n\n        main_target = \"dll\" if self.options.shared else \"sqlcipher.lib\"\n\n        if self.settings.compiler.runtime in [\"MD\", \"MDd\"]:\n            nmake_flags.append(\"USE_CRT_DLL=1\")\n        if self.settings.build_type == \"Debug\":\n            nmake_flags.append(\"DEBUG=2\")\n        nmake_flags.append(\"FOR_WIN10=1\")\n        platforms = {\"x86\": \"x86\", \"x86_64\": \"x64\"}\n        nmake_flags.append(\"PLATFORM=%s\" % platforms[self.settings.arch.value])\n        vcvars = tools.vcvars_command(self.settings)\n        self.run(\"%s && nmake /f Makefile.msc %s %s\" % (vcvars, main_target, \" \".join(nmake_flags)), cwd=self._source_subfolder)\n\n    def _build_autotools(self):\n        self.run('chmod +x configure', cwd=self._source_subfolder)\n        absolute_install_dir = os.path.abspath(os.path.join(\".\", \"install\"))\n        absolute_install_dir = absolute_install_dir.replace(\"\\\\\", \"/\")\n        autotools_env = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)\n        if self.settings.os == \"Linux\":\n            autotools_env.libs.append(\"dl\")\n            if not self.options.with_largefile:\n                autotools_env.defines.append(\"SQLITE_DISABLE_LFS=1\")\n        autotools_env.defines.extend([\"SQLITE_HAS_CODEC\", \"SQLCIPHER_CRYPTO_OPENSSL\"])\n\n        # sqlcipher config.sub does not contain android configurations...\n        # elf is the most basic `os' for Android\n        host = None\n        if self.settings.os == \"Android\":\n            host = \"%s-linux-elf\" % self._arch_id_str_compiler\n        elif self.settings.os == \"Windows\":\n            arch = str(self.settings.arch)\n            if arch == \"x86\":\n                arch = \"i386\"\n            host = \"%s-pc-mingw32\" % arch\n        elif self.settings.os == \"iOS\":\n            host = \"%s-apple-darwin\" % self.settings.arch\n\n        configure_args = self._get_configure_args(absolute_install_dir)\n        with tools.chdir(self._source_subfolder):\n            # Hack, uname -p returns i386, configure guesses x86_64, we must force i386 so that cross-compilation is correctly detected.\n            # Otherwise host/build are the same, and configure tries to launch a sample executable, and fails miserably.\n            env_vars = autotools_env.vars\n            if self.settings.os == \"iOS\":\n                build = \"i386-apple-darwin\"\n            # same for mingw...\n            elif self.settings.os == \"Windows\":\n                build = \"x86_64-linux\"\n                env_vars[\"config_TARGET_EXEEXT\"] = \".exe\"\n            else:\n                build = None\n            tclsh_cmd = self.deps_env_info.TCLSH\n            env_vars[\"TCLSH_CMD\"] = tclsh_cmd.replace(\"\\\\\", \"/\")\n            autotools_env.configure(args=configure_args, host=host, build=build, vars=env_vars)\n            if self.settings.os == \"Windows\":\n                # sqlcipher will create .exe for the build machine, which we defined to Linux...\n                tools.replace_in_file(os.path.join(self.build_folder, self._source_subfolder, \"Makefile\"), \"BEXE = .exe\", \"BEXE = \")\n            autotools_env.make(args=[\"install\"])\n\n    @property\n    def _arch_id_str_compiler(self):\n        return {\"x86\": \"i686\",\n                \"armv6\": \"arm\",\n                \"armv7\": \"arm\",\n                \"armv7hf\": \"arm\",\n                # Hack: config.guess of sqlcipher does not like aarch64\n                \"armv8\": \"armv8\",\n                \"mips64\": \"mips64\"}.get(str(self.settings.arch),\n                                        str(self.settings.arch))\n\n    def _get_configure_args(self, absolute_install_dir):\n        args = [\n            \"--prefix=%s\" % absolute_install_dir,\n\n            self._autotools_bool_arg(\"shared\", self.options.shared),\n            self._autotools_bool_arg(\"static\", not self.options.shared),\n            \"--enable-tempstore=%s\" % self._temp_store_autotools_value,\n            \"--disable-tcl\",\n        ]\n        if self.settings.os == \"Windows\":\n            args.extend([\"config_BUILD_EXEEXT='.exe'\", \"config_TARGET_EXEEXT='.exe'\"])\n        return args\n\n    def _autotools_bool_arg(self, arg_base_name, value):\n        prefix = \"--enable-\" if value else \"--disable-\"\n\n        return prefix + arg_base_name\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\n        if self.settings.compiler == \"Visual Studio\":\n            self._build_visual()\n        else:\n            self._build_autotools()\n\n    def _package_unix(self):\n        self.copy(\"*sqlite3.h\", src=\"install\")\n        self.copy(\"*.so*\", dst=\"lib\", src=\"install\", keep_path=False, symlinks=True)\n        self.copy(\"*.a\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*.lib\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*.dll\", dst=\"bin\", src=\"install\", keep_path=False)\n        self.copy(\"*.dylib\", dst=\"lib\", src=\"install\", keep_path=False)\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n\n    def _package_visual(self):\n        self.copy(\"*.dll\", dst=\"bin\", keep_path=False)\n        self.copy(\"*.lib\", dst=\"lib\", keep_path=False)\n        self.copy(\"*LICENSE\", dst=\"licenses\", keep_path=False)\n        self.copy(\"sqlite3.h\", src=self._source_subfolder, dst=os.path.join(\"include\", \"sqlcipher\"))\n\n    def package(self):\n        if self.settings.compiler == \"Visual Studio\":\n            self._package_visual()\n        else:\n            self._package_unix()\n\n    def package_info(self):\n        self.cpp_info.libs = [\"sqlcipher\"]\n        if self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"pthread\", \"dl\"])\n        self.cpp_info.defines = [\"SQLITE_HAS_CODEC\", 'SQLCIPHER_CRYPTO_OPENSSL', 'SQLITE_TEMP_STORE=%s' % self._temp_store_nmake_value]\n        # Allow using #include <sqlite3.h> even with sqlcipher (for libs like sqlpp11-connector-sqlite3)\n        self.cpp_info.includedirs.append(os.path.join(\"include\", \"sqlcipher\"))\n", "path": "recipes/sqlcipher/all/conanfile.py"}]}