forked from kivy/python-for-android
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path__init__.py
More file actions
23 lines (17 loc) · 893 Bytes
/
__init__.py
File metadata and controls
23 lines (17 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from pythonforandroid.recipe import RustCompiledComponentsRecipe
from os.path import join
class CryptographyRecipe(RustCompiledComponentsRecipe):
name = 'cryptography'
version = '46.0.3'
url = 'https://github.com/pyca/cryptography/archive/refs/tags/{version}.tar.gz'
depends = ['openssl', 'cffi']
def get_recipe_env(self, arch, **kwargs):
env = super().get_recipe_env(arch, **kwargs)
openssl_build_dir = self.get_recipe('openssl', self.ctx).get_build_dir(arch.arch)
build_target = self.RUST_ARCH_CODES[arch.arch].upper().replace("-", "_")
openssl_include = "{}_OPENSSL_INCLUDE_DIR".format(build_target)
openssl_libs = "{}_OPENSSL_LIB_DIR".format(build_target)
env[openssl_include] = join(openssl_build_dir, 'include')
env[openssl_libs] = join(openssl_build_dir)
return env
recipe = CryptographyRecipe()