How to use the python-for-android.pythonforandroid.recipe.CompiledComponentsPythonRecipe function in python-for-android

To help you get started, we’ve selected a few python-for-android examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codelv / enaml-native-cli / python-for-android / pythonforandroid / recipe.py View on Github external
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)
github codelv / enaml-native / python-for-android / pythonforandroid / recipe.py View on Github external
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)
github codelv / enaml-native / python-for-android / pythonforandroid / recipe.py View on Github external
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)
github codelv / enaml-native-cli / python-for-android / pythonforandroid / recipe.py View on Github external
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)

python-for-android

A development tool that packages Python apps into binaries that can run on Android devices.

MIT
Latest version published 10 months ago

Package Health Score

76 / 100
Full package analysis

Similar packages