From ecd8f1fcb5e7738f6296fa97465a5d3fe0c9e456 Mon Sep 17 00:00:00 2001 From: opacam Date: Wed, 12 Dec 2018 00:19:24 +0100 Subject: [PATCH 1/2] Remove hardcoded python2 flags, shorten ldflags and grants python3 compatibility for the pymunk recipe --- pythonforandroid/recipes/pymunk/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pythonforandroid/recipes/pymunk/__init__.py b/pythonforandroid/recipes/pymunk/__init__.py index 3352b38f4c..86570451bf 100644 --- a/pythonforandroid/recipes/pymunk/__init__.py +++ b/pythonforandroid/recipes/pymunk/__init__.py @@ -1,3 +1,4 @@ +from os.path import join from pythonforandroid.recipe import CompiledComponentsPythonRecipe @@ -5,17 +6,16 @@ class PymunkRecipe(CompiledComponentsPythonRecipe): name = "pymunk" version = '5.2.0' url = 'https://pypi.python.org/packages/5e/bd/e67edcffdee3d0a1e3ebf0050bb9746a61d616f5502ceedddf0f7fd0a896/pymunk-5.2.0.zip' - depends = [('python2', 'python3crystax'), 'cffi', 'setuptools'] + depends = ['cffi', 'setuptools'] call_hostpython_via_targetpython = False def get_recipe_env(self, arch): env = super(PymunkRecipe, self).get_recipe_env(arch) env['PYTHON_ROOT'] = self.ctx.get_python_install_dir() - arch_noeabi = arch.arch.replace('eabi', '') env['LDFLAGS'] += " -shared -llog" - env['LDFLAGS'] += " -landroid -lpython2.7" - env['LDFLAGS'] += " --sysroot={ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}".format( - ctx=self.ctx, arch_noeabi=arch_noeabi) + env['LDFLAGS'] += " -landroid" + env['LDFLAGS'] += ' -L{}'.format(join(self.ctx.ndk_platform, 'usr', 'lib')) + env['LDFLAGS'] += " --sysroot={}".format(self.ctx.ndk_platform) return env From e8852b7a4d994ee9eaa2ecbdbd94ad25299961d5 Mon Sep 17 00:00:00 2001 From: opacam Date: Tue, 15 Jan 2019 16:16:35 +0100 Subject: [PATCH 2/2] Move libraries from LDFLAGS to LIBS for pymunk recipe Because this is how you are supposed to do it, you must use LDFLAGS for linker flags and LDLIBS (or the equivalent LOADLIBES) for the libraries --- pythonforandroid/recipes/pymunk/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/pymunk/__init__.py b/pythonforandroid/recipes/pymunk/__init__.py index 86570451bf..7aeb366c05 100644 --- a/pythonforandroid/recipes/pymunk/__init__.py +++ b/pythonforandroid/recipes/pymunk/__init__.py @@ -13,9 +13,9 @@ def get_recipe_env(self, arch): env = super(PymunkRecipe, self).get_recipe_env(arch) env['PYTHON_ROOT'] = self.ctx.get_python_install_dir() env['LDFLAGS'] += " -shared -llog" - env['LDFLAGS'] += " -landroid" env['LDFLAGS'] += ' -L{}'.format(join(self.ctx.ndk_platform, 'usr', 'lib')) env['LDFLAGS'] += " --sysroot={}".format(self.ctx.ndk_platform) + env['LIBS'] = env.get('LIBS', '') + ' -landroid' return env