@@ -15,16 +15,41 @@ class KivyRecipe(CythonRecipe):
15
15
16
16
# patches = ['setargv.patch']
17
17
18
+ def cythonize_build (self , env , build_dir = '.' ):
19
+ super (KivyRecipe , self ).cythonize_build (env , build_dir = build_dir )
20
+
21
+ if not exists (join (build_dir , 'kivy' , 'include' )):
22
+ return
23
+
24
+ # If kivy is new enough to use the include dir, copy it
25
+ # manually to the right location as we bypass this stage of
26
+ # the build
27
+ with current_directory (build_dir ):
28
+ build_libs_dirs = glob .glob (join ('build' , 'lib.*' ))
29
+
30
+ for dirn in build_libs_dirs :
31
+ shprint (sh .cp , '-r' , join ('kivy' , 'include' ),
32
+ join (dirn , 'kivy' ))
33
+
18
34
def get_recipe_env (self , arch ):
19
35
env = super (KivyRecipe , self ).get_recipe_env (arch )
20
36
if 'sdl2' in self .ctx .recipe_build_order :
37
+ env ['CUR_ARCH' ] = arch .arch
21
38
env ['USE_SDL2' ] = '1'
22
39
env ['KIVY_SDL2_PATH' ] = ':' .join ([
23
40
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL' , 'include' ),
24
41
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_image' ),
25
42
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_mixer' ),
26
43
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_ttf' ),
27
44
])
45
+
46
+ # Set include dir for pxi files - Kivy normally handles this
47
+ # in the setup.py invocation, but we skip this
48
+ build_dir = self .get_build_dir (arch .arch )
49
+ self .cython_args = ['-I{}' .format (join (build_dir , 'kivy' , 'include' ))]
50
+
51
+ env ['CFLAGS' ] += ' -I{}' .format (join (build_dir , 'kivy' , 'include' ))
52
+
28
53
return env
29
54
30
55
recipe = KivyRecipe ()
0 commit comments