Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ public void keepActive() {
public void removeLoadingScreen() {
runOnUiThread(new Runnable() {
public void run() {
if (PythonActivity.mImageView != null) {
if (PythonActivity.mImageView != null &&
PythonActivity.mImageView.getParent() != null) {
((ViewGroup)PythonActivity.mImageView.getParent()).removeView(
PythonActivity.mImageView);
PythonActivity.mImageView = null;
Expand Down
37 changes: 37 additions & 0 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,43 @@ def rebuild_compiled_components(self, arch, 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'
env['CFLAGS'] += " -I{pyroot}/include/python2.7 " \
" -I{ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}/usr/include" \
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/include" \
" -I{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/include".format(**keys)
env['CXXFLAGS'] = env['CFLAGS'] + ' -frtti -fexceptions'
env['LDFLAGS'] += " -L{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}" \
" -lpython2.7" \
" -lgnustl_shared".format(**keys)


return env

def build_compiled_components(self,arch):
super(CppCompiledComponentsPythonRecipe, self).build_compiled_components(arch)

# Copy libgnustl_shared.so
with current_directory(self.get_build_dir(arch.arch)):
sh.cp(
"{ctx.ndk_dir}/sources/cxx-stl/gnu-libstdc++/{ctx.toolchain_version}/libs/{arch.arch}/libgnustl_shared.so".format(ctx=self.ctx,arch=arch),
self.ctx.get_libs_dir(arch.arch)
)




class CythonRecipe(PythonRecipe):
pre_build_ext = False
Expand Down
9 changes: 9 additions & 0 deletions pythonforandroid/recipes/atom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe

class AtomRecipe(CppCompiledComponentsPythonRecipe):
site_packages_name = 'atom'
version = '0.3.10'
url = 'https://github.com/nucleic/atom/archive/master.zip'
depends = ['python2','setuptools']

recipe = AtomRecipe()
25 changes: 25 additions & 0 deletions pythonforandroid/recipes/enaml/0001-Update-setup.py.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 156a0426f7350bf49bdfae1aad555e13c9494b9a Mon Sep 17 00:00:00 2001
From: frmdstryr <frmdstryr@gmail.com>
Date: Thu, 23 Jun 2016 22:04:32 -0400
Subject: [PATCH] Update setup.py

---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 3bfd2a2..99817e5 100644
--- a/setup.py
+++ b/setup.py
@@ -72,7 +72,7 @@ setup(
url='https://github.com/nucleic/enaml',
description='Declarative DSL for building rich user interfaces in Python',
long_description=open('README.rst').read(),
- requires=['atom', 'PyQt', 'ply', 'kiwisolver'],
+ requires=['atom', 'ply', 'kiwisolver'],
install_requires=['distribute', 'atom >= 0.3.8', 'kiwisolver >= 0.1.2', 'ply >= 3.4'],
packages=find_packages(),
package_data={
--
2.7.4

10 changes: 10 additions & 0 deletions pythonforandroid/recipes/enaml/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe

class EnamlRecipe(CppCompiledComponentsPythonRecipe):
site_packages_name = 'enaml'
version = '0.9.8'
url = 'https://github.com/nucleic/enaml/archive/master.zip'
patches = ['0001-Update-setup.py.patch'] # Remove PyQt dependency
depends = ['python2','setuptools','atom','kiwisolver']

recipe = EnamlRecipe()
9 changes: 9 additions & 0 deletions pythonforandroid/recipes/kiwisolver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe

class KiwiSolverRecipe(CppCompiledComponentsPythonRecipe):
site_packages_name = 'kiwisolver'
version = '0.1.3'
url = 'https://github.com/nucleic/kiwi/archive/master.zip'
depends = ['python2']

recipe = KiwiSolverRecipe()