1
1
from pythonforandroid .recipe import CompiledComponentsPythonRecipe
2
2
from os .path import join
3
- from shutil import copyfile
4
3
from pythonforandroid .toolchain import current_directory
5
- import glob
4
+
6
5
7
6
class Pygame2Recipe (CompiledComponentsPythonRecipe ):
8
7
9
- version = '2.0.0-dev5 '
8
+ version = '2.0.0-dev7 '
10
9
url = 'https://github.com/pygame/pygame/archive/android.zip'
11
10
12
11
site_packages_name = 'pygame'
13
12
name = 'pygame2'
14
13
15
- depends = ['sdl2' , 'sdl2_image' , 'sdl2_mixer' , 'sdl2_ttf' , 'setuptools' ]
14
+ depends = ['sdl2' , 'sdl2_image' , 'sdl2_mixer' , 'sdl2_ttf' , 'setuptools' , 'jpeg' , 'freetype' , 'harfbuzz' , 'png' ]
16
15
call_hostpython_via_targetpython = False # Due to setuptools
17
16
install_in_hostpython = False
18
17
19
- def cythonize_file (self , env , build_dir , filename ):
20
- # We can ignore a few files that aren't important to the
21
- # android build, and may not work on Android anyway
22
- do_not_cythonize = []
23
- if basename (filename ) in do_not_cythonize :
24
- return
25
- super (Pygame2Recipe , self ).cythonize_file (env , build_dir , filename )
26
-
27
18
def prebuild_arch (self , arch ):
28
19
super (Pygame2Recipe , self ).prebuild_arch (arch )
29
20
with current_directory (self .get_build_dir (arch .arch )):
30
- setup_template = open (join ("buildconfig" , "Setup.Android.SDL2.in" )).read ()
31
- env = self .get_recipe_env (arch )
32
- setup_file = setup_template .format (
21
+ setup_template = open (join ("buildconfig" , "Setup.Android.SDL2.in" )).read ()
22
+ # env = self.get_recipe_env(arch)
23
+ setup_file = setup_template .format (
33
24
sdl_includes = (
34
25
" -I" + join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL' , 'include' ) +
35
26
" -L" + join (self .ctx .bootstrap .build_dir , "libs" , str (arch ))),
36
- sdl_ttf_includes = "-I" + join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_ttf' ),
27
+ sdl_ttf_includes = " -I" + join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_ttf' ),
37
28
sdl_image_includes = "-I" + join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_image' ),
38
29
sdl_mixer_includes = "-I" + join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_mixer' ))
39
30
open ("Setup" , "w" ).write (setup_file )
@@ -42,9 +33,9 @@ def get_recipe_env(self, arch):
42
33
env = super (Pygame2Recipe , self ).get_recipe_env (arch )
43
34
if 'sdl2' in self .ctx .recipe_build_order :
44
35
env ['USE_SDL2' ] = '1'
45
-
46
- env ["PYGAME_CROSS_COMPILE" ]= "TRUE"
47
- env ["PYGAME_ANDROID" ]= "TRUE"
36
+ env ["PYGAME_CROSS_COMPILE" ] = "TRUE"
37
+ env ["PYGAME_ANDROID" ] = "TRUE"
48
38
return env
49
-
39
+
40
+
50
41
recipe = Pygame2Recipe ()
0 commit comments