diff --git a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java index 6fd88565da..02ee0435e2 100644 --- a/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java +++ b/pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java @@ -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; diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index 5456b49d9b..3cf8f9ba49 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -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 diff --git a/pythonforandroid/recipes/atom/__init__.py b/pythonforandroid/recipes/atom/__init__.py new file mode 100644 index 0000000000..57d363bec8 --- /dev/null +++ b/pythonforandroid/recipes/atom/__init__.py @@ -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() diff --git a/pythonforandroid/recipes/enaml/0001-Update-setup.py.patch b/pythonforandroid/recipes/enaml/0001-Update-setup.py.patch new file mode 100644 index 0000000000..c84f892dc6 --- /dev/null +++ b/pythonforandroid/recipes/enaml/0001-Update-setup.py.patch @@ -0,0 +1,25 @@ +From 156a0426f7350bf49bdfae1aad555e13c9494b9a Mon Sep 17 00:00:00 2001 +From: frmdstryr +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 + diff --git a/pythonforandroid/recipes/enaml/__init__.py b/pythonforandroid/recipes/enaml/__init__.py new file mode 100644 index 0000000000..89c070081e --- /dev/null +++ b/pythonforandroid/recipes/enaml/__init__.py @@ -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() diff --git a/pythonforandroid/recipes/kiwisolver/__init__.py b/pythonforandroid/recipes/kiwisolver/__init__.py new file mode 100644 index 0000000000..7d6b570e1a --- /dev/null +++ b/pythonforandroid/recipes/kiwisolver/__init__.py @@ -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() \ No newline at end of file