Skip to content

Commit 39c6b5b

Browse files
committed
Fix openssl dependant recipe: scrypt (and grants python3 compatibility)
Because since the python/openssl build system changed this recipe stopped to work.
1 parent 8493d5e commit 39c6b5b

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

pythonforandroid/recipes/scrypt/__init__.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import os
21
from pythonforandroid.recipe import CythonRecipe
32

43

54
class ScryptRecipe(CythonRecipe):
65

76
version = '0.8.6'
87
url = 'https://bitbucket.org/mhallin/py-scrypt/get/v{version}.zip'
9-
depends = [('python2', 'python3crystax'), 'setuptools', 'openssl']
8+
depends = ['setuptools', 'openssl']
109
call_hostpython_via_targetpython = False
1110
patches = ["remove_librt.patch"]
1211

@@ -15,23 +14,12 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
1514
Adds openssl recipe to include and library path.
1615
"""
1716
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()
3523
return env
3624

3725

0 commit comments

Comments
 (0)