@@ -16,6 +16,22 @@ class KivyRecipe(CythonRecipe):
16
16
17
17
# patches = ['setargv.patch']
18
18
19
+ def cythonize_build (self , env , build_dir = '.' ):
20
+ super (KivyRecipe , self ).cythonize_build (env , build_dir = build_dir )
21
+
22
+ if not exists (join (build_dir , 'kivy' , 'include' )):
23
+ return
24
+
25
+ # If kivy is new enough to use the include dir, copy it
26
+ # manually to the right location as we bypass this stage of
27
+ # the build
28
+ with current_directory (build_dir ):
29
+ build_libs_dirs = glob .glob (join ('build' , 'lib.*' ))
30
+
31
+ for dirn in build_libs_dirs :
32
+ shprint (sh .cp , '-r' , join ('kivy' , 'include' ),
33
+ join (dirn , 'kivy' ))
34
+
19
35
def get_recipe_env (self , arch ):
20
36
env = super (KivyRecipe , self ).get_recipe_env (arch )
21
37
if 'sdl2' in self .ctx .recipe_build_order :
@@ -26,6 +42,14 @@ def get_recipe_env(self, arch):
26
42
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_mixer' ),
27
43
join (self .ctx .bootstrap .build_dir , 'jni' , 'SDL2_ttf' ),
28
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
+
29
53
return env
30
54
31
55
recipe = KivyRecipe ()
0 commit comments