Skip to content

Commit ddb46f6

Browse files
opacamAndreMiras
authored andcommitted
[CORE UPDATE - PART IX] Pymunk for both versions of python and enhance flags (kivy#1550)
* Remove hardcoded python2 flags, shorten ldflags and grants python3 compatibility for the pymunk recipe * 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
1 parent 34a9d05 commit ddb46f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pythonforandroid/recipes/pymunk/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
from os.path import join
12
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
23

34

45
class PymunkRecipe(CompiledComponentsPythonRecipe):
56
name = "pymunk"
67
version = '5.2.0'
78
url = 'https://pypi.python.org/packages/5e/bd/e67edcffdee3d0a1e3ebf0050bb9746a61d616f5502ceedddf0f7fd0a896/pymunk-5.2.0.zip'
8-
depends = [('python2', 'python3crystax'), 'cffi', 'setuptools']
9+
depends = ['cffi', 'setuptools']
910
call_hostpython_via_targetpython = False
1011

1112
def get_recipe_env(self, arch):
1213
env = super(PymunkRecipe, self).get_recipe_env(arch)
1314
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
14-
arch_noeabi = arch.arch.replace('eabi', '')
1515
env['LDFLAGS'] += " -shared -llog"
16-
env['LDFLAGS'] += " -landroid -lpython2.7"
17-
env['LDFLAGS'] += " --sysroot={ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}".format(
18-
ctx=self.ctx, arch_noeabi=arch_noeabi)
16+
env['LDFLAGS'] += ' -L{}'.format(join(self.ctx.ndk_platform, 'usr', 'lib'))
17+
env['LDFLAGS'] += " --sysroot={}".format(self.ctx.ndk_platform)
18+
env['LIBS'] = env.get('LIBS', '') + ' -landroid'
1919
return env
2020

2121

0 commit comments

Comments
 (0)