Skip to content

Commit 8985199

Browse files
committed
Recipe for Pymunk
1 parent 3c2825b commit 8985199

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from pythonforandroid.toolchain import PythonRecipe
2+
from pythonforandroid.toolchain import CythonRecipe
3+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
4+
from pythonforandroid.logger import info
5+
6+
import os.path
7+
8+
class PymunkRecipe(CompiledComponentsPythonRecipe):
9+
name = "pymunk"
10+
version = '5.2.0'
11+
url = 'https://pypi.python.org/packages/5e/bd/e67edcffdee3d0a1e3ebf0050bb9746a61d616f5502ceedddf0f7fd0a896/pymunk-5.2.0.zip'
12+
depends = [('python2', 'python3crystax'), 'cffi', 'setuptools']
13+
call_hostpython_via_targetpython = False
14+
15+
def get_recipe_env(self, arch):
16+
env = super(PymunkRecipe, self).get_recipe_env(arch)
17+
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
18+
arch_noeabi = arch.arch.replace('eabi', '')
19+
env['LDFLAGS'] += " -shared -llog"
20+
env['LDFLAGS'] += " -landroid -lpython2.7"
21+
env['LDFLAGS'] += " --sysroot={ctx.ndk_dir}/platforms/android-{ctx.android_api}/arch-{arch_noeabi}".format(
22+
ctx=self.ctx, arch_noeabi=arch_noeabi)
23+
return env
24+
25+
recipe = PymunkRecipe()

0 commit comments

Comments
 (0)