8000 [CORE UPDATE - PART VI] Fix scrypt by opacam · Pull Request #1547 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

[CORE UPDATE - PART VI] Fi 8000 x scrypt #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions pythonforandroid/recipes/scrypt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os
from pythonforandroid.recipe import CythonRecipe


class ScryptRecipe(CythonRecipe):

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

Expand All @@ -15,23 +14,12 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
Adds openssl recipe to include and library path.
"""
env = super(ScryptRecipe, self).get_recipe_env(arch, with_flags_in_cc)
openssl_build_dir = self.get_recipe(
'openssl', self.ctx).get_build_dir(arch.arch)
env['CFLAGS'] += ' -I{}'.format(os.path.join(openssl_build_dir, 'include'))
env['LDFLAGS'] += ' -L{}'.format(
self.ctx.get_libs_dir(arch.arch) +
'-L{}'.format(self.ctx.libs_dir)) + ' -L{}'.format(
openssl_build_dir)
# required additional library and path for Crystax
if self.ctx.ndk == 'crystax':
# only keeps major.minor (discards patch)
python_version = self.ctx.python_recipe.version[0:3]
ndk_dir_python = os.path.join(self.ctx.ndk_dir, 'sources/python/', python_version)
env['LDFLAGS'] += ' -L{}'.format(os.path.join(ndk_dir_python, 'libs', arch.arch))
env['LDFLAGS'] += ' -lpython{}m'.format(python_version)
# until `pythonforandroid/archs.py` gets merged upstream:
# https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
env['CFLAGS'] += ' -I{}/include/python/'.format(ndk_dir_python)
openssl_recipe = self.get_recipe('openssl', self.ctx)
env['CFLAGS'] += openssl_recipe.include_flags(arch)
env['LDFLAGS'] += ' -L{}'.format(self.ctx.get_libs_dir(arch.arch))
env['LDFLAGS'] += ' -L{}'.format(self.ctx.libs_dir)
env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch)
env['LIBS'] = env.get('LIBS', '') + openssl_recipe.link_libs_flags()
return env


Expand Down
0