Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def install_hostpython_package(self, arch):
env = self.get_hostrecipe_env(arch)
self.rebuild_compiled_components(arch, env)
super(CompiledComponentsPythonRecipe, self).install_hostpython_package(arch)
def install_hostpython_package(self, arch):
env = self.get_hostrecipe_env(arch)
self.rebuild_compiled_components(arch, env)
super(CompiledComponentsPythonRecipe, self).install_hostpython_package(arch)
def install_hostpython_package(self, arch):
env = self.get_hostrecipe_env(arch)
self.rebuild_compiled_components(arch, env)
super(CompiledComponentsPythonRecipe, self).install_hostpython_package(arch)
def rebuild_compiled_components(self, arch, env):
info('Rebuilding compiled components in {}'.format(self.name))
hostpython = sh.Command(self.real_hostpython_location)
shprint(hostpython, 'setup.py', 'clean', '--all', _env=env)
shprint(hostpython, 'setup.py', self.build_cmd, '-v', _env=env,
*self.setup_extra_args)
class CppCompiledComponentsPythonRecipe(CompiledComponentsPythonRecipe):
""" Extensions that require the cxx-stl """
call_hostpython_via_targetpython = False
def get_recipe_env(self, arch):
env = super(CppCompiledComponentsPythonRecipe, self).get_recipe_env(arch)
keys = dict(
ctx=self.ctx,
arch=arch,
arch_noeabi=arch.arch.replace('eabi', ''),
pyroot=self.ctx.get_python_install_dir()
)
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
if 'python2crystax' in self.ctx.recipe_build_order:
env['CFLAGS'] +=" -I{ctx.ndk_dir}/sources/python/2.7/include/python/" \
" -I{ctx.ndk_dir}/platforms/android-{ctx.ndk_platform_version}/arch-{arch_noeabi}/usr/include" \
" -I{ctx.ndk_dir}/sources/cxx-stl/stlport/stlport".format(**keys)
def install_hostpython_package(self, arch):
env = self.get_hostrecipe_env(arch)
self.rebuild_compiled_components(arch, env)
super(CompiledComponentsPythonRecipe, self).install_hostpython_package(arch)
def rebuild_compiled_components(self, arch, env):
info('Rebuilding compiled components in {}'.format(self.name))
hostpython = sh.Command(self.real_hostpython_location)
shprint(hostpython, 'setup.py', 'clean', '--all', _env=env)
shprint(hostpython, 'setup.py', self.build_cmd, '-v', _env=env,
*self.setup_extra_args)
class CppCompiledComponentsPythonRecipe(CompiledComponentsPythonRecipe):
""" Extensions that require the cxx-stl """
call_hostpython_via_targetpython = False
def get_recipe_env(self, arch):
env = super(CppCompiledComponentsPythonRecipe, self).get_recipe_env(arch)
keys = dict(
ctx=self.ctx,
arch=arch,
arch_noeabi=arch.arch.replace('eabi', ''),
pyroot=self.ctx.get_python_install_dir()
)
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
if 'python2crystax' in self.ctx.recipe_build_order:
env['CFLAGS'] +=" -I{ctx.ndk_dir}/sources/python/2.7/include/python/" \
" -I{ctx.ndk_dir}/platforms/android-{ctx.ndk_platform_version}/arch-{arch_noeabi}/usr/include" \
" -I{ctx.ndk_dir}/sources/cxx-stl/stlport/stlport".format(**keys)