1
- import os
2
1
from pythonforandroid .recipe import CythonRecipe
3
2
4
3
5
4
class ScryptRecipe (CythonRecipe ):
6
5
7
6
version = '0.8.6'
8
7
url = 'https://bitbucket.org/mhallin/py-scrypt/get/v{version}.zip'
9
- depends = [( 'python2' , 'python3crystax' ), 'setuptools' , 'openssl' ]
8
+ depends = ['setuptools' , 'openssl' ]
10
9
call_hostpython_via_targetpython = False
11
10
patches = ["remove_librt.patch" ]
12
11
@@ -15,23 +14,12 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
15
14
Adds openssl recipe to include and library path.
16
15
"""
17
16
env = super (ScryptRecipe , self ).get_recipe_env (arch , with_flags_in_cc )
18
- openssl_build_dir = self .get_recipe (
19
- 'openssl' , self .ctx ).get_build_dir (arch .arch )
20
- env ['CFLAGS' ] += ' -I{}' .format (os .path .join (openssl_build_dir , 'include' ))
21
- env ['LDFLAGS' ] += ' -L{}' .format (
22
- self .ctx .get_libs_dir (arch .arch ) +
23
- '-L{}' .format (self .ctx .libs_dir )) + ' -L{}' .format (
24
- openssl_build_dir )
25
- # required additional library and path for Crystax
26
- if self .ctx .ndk == 'crystax' :
27
- # only keeps major.minor (discards patch)
28
- python_version = self .ctx .python_recipe .version [0 :3 ]
29
- ndk_dir_python = os .path .join (self .ctx .ndk_dir , 'sources/python/' , python_version )
30
- env ['LDFLAGS' ] += ' -L{}' .format (os .path .join (ndk_dir_python , 'libs' , arch .arch ))
31
- env ['LDFLAGS' ] += ' -lpython{}m' .format (python_version )
32
- # until `pythonforandroid/archs.py` gets merged upstream:
33
- # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
34
- env ['CFLAGS' ] += ' -I{}/include/python/' .format (ndk_dir_python )
17
+ openssl_recipe = self .get_recipe ('openssl' , self .ctx )
18
+ env ['CFLAGS' ] += openssl_recipe .include_flags (arch )
19
+ env ['LDFLAGS' ] += ' -L{}' .format (self .ctx .get_libs_dir (arch .arch ))
20
+ env ['LDFLAGS' ] += ' -L{}' .format (self .ctx .libs_dir )
21
+ env ['LDFLAGS' ] += openssl_recipe .link_dirs_flags (arch )
22
+ env ['LIBS' ] = env .get ('LIBS' , '' ) + openssl_recipe .link_libs_flags ()
35
23
return env
36
24
37
25
0 commit comments