1
1
2
- from toolchain import PythonRecipe , shprint
2
+ from toolchain import PythonRecipe , shprint , ArchAndroid , current_directory
3
3
from os .path import exists , join
4
4
import sh
5
5
@@ -13,10 +13,39 @@ def prebuild_armeabi(self):
13
13
if exists (join (self .get_build_dir ('armeabi' ), '.patched' )):
14
14
print ('Pygame already patched, skipping.' )
15
15
return
16
+ shprint (sh .cp , join (self .get_recipe_dir (), 'Setup' ),
17
+ join (self .get_actual_build_dir ('armeabi' ), 'Setup' ))
16
18
self .apply_patch (join ('patches' , 'fix-surface-access.patch' ))
17
19
self .apply_patch (join ('patches' , 'fix-array-surface.patch' ))
18
20
shprint (sh .touch , join (self .get_build_dir ('armeabi' ), '.patched' ))
19
21
22
+ def build_armeabi (self ):
23
+ # AND: I'm going to ignore any extra pythonrecipe or cythonrecipe behaviour for now
24
+
25
+ env = ArchAndroid (self .ctx ).get_env ()
26
+
27
+ env ['CFLAGS' ] = env ['CFLAGS' ] + ' -I{jni_path}/png -I{jni_path}/jpeg' .format (
28
+ jni_path = join (self .ctx .bootstrap .build_dir , 'jni' ))
29
+ env ['CFLAGS' ] = env ['CFLAGS' ] + ' -I{jni_path}/sdl/include -I{jni_path}/sdl_mixer' .format (
30
+ jni_path = join (self .ctx .bootstrap .build_dir , 'jni' ))
31
+ env ['CFLAGS' ] = env ['CFLAGS' ] + ' -I{jni_path}/sdl_ttf -I{jni_path}/sdl_image' .format (
32
+ jni_path = join (self .ctx .bootstrap .build_dir , 'jni' ))
33
+ print ('pygame cflags' , env ['CFLAGS' ])
34
+
35
+
36
+ env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -L{libs_path} -L{src_path}/obj/local/{arch} -lm -lz' .format (
37
+ libs_path = self .ctx .libs_dir , src_path = self .ctx .bootstrap .build_dir , arch = env ['ARCH' ])
38
+ print ('pygame ldflags' , env ['LDFLAGS' ])
39
+
40
+ env ['LDSHARED' ] = env ['LIBLINK' ]
41
+
42
+ with current_directory (self .get_actual_build_dir ('armeabi' )):
43
+ print ('hostpython is' , self .ctx .hostpython )
44
+ hostpython = sh .Command (self .ctx .hostpython )
45
+ shprint (hostpython , 'setup.py' , 'install' , '-O2' , _env = env )
46
+
47
+ print ('strip is' , env ['STRIP' ])
48
+ exit (1 )
20
49
21
50
22
51
recipe = PygameRecipe ()
0 commit comments