Skip to content

Commit 4786e42

Browse files
committed
Added pygame_sdl2 recipe
1 parent 3faf827 commit 4786e42

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchAndroid
3+
from os.path import exists, join
4+
import sh
5+
import glob
6+
7+
8+
class PygameSDL2Recipe(CythonRecipe):
9+
# version = 'stable'
10+
version = 'master'
11+
url = 'https://github.com/renpy/pygame_sdl2/archive/{version}.zip'
12+
name = 'pygame_sdl2'
13+
14+
depends = ['sdl2']
15+
conflicts = ['pygame']
16+
17+
def get_recipe_env(self, arch):
18+
env = super(PygameSDL2Recipe, self).get_recipe_env(arch)
19+
env['CFLAGS'] = (env['CFLAGS'] +
20+
' -I{}'.format(join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include')) +
21+
' -I{}'.format(join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_image')) +
22+
' -I{}'.format(join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer')) +
23+
' -I{}'.format(join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf')) +
24+
' -LSDL2 -LSDL2_image -LSDL2_mixer -LSDL2_ttf')
25+
env['CXXFLAGS'] = env['CFLAGS']
26+
env['PYGAME_SDL2_ANDROID'] = 'yes'
27+
return env
28+
29+
recipe = PygameSDL2Recipe()

0 commit comments

Comments
 (0)