1
-
2
- from pythonforandroid .toolchain import Recipe , shprint , current_directory , info , warning
3
- from os .path import join , exists
4
- from os import chdir
1
+ from pythonforandroid .toolchain import Recipe , shprint
2
+ from os .path import join
5
3
import sh
6
4
7
5
@@ -13,14 +11,32 @@ class Hostpython3Recipe(Recipe):
13
11
14
12
conflicts = ['hostpython2' ]
15
13
14
+ def get_build_container_dir (self , arch = None ):
15
+ choices = self .check_recipe_choices ()
16
+ dir_name = '-' .join ([self .name ] + choices )
17
+ return join (self .ctx .build_dir , 'other_builds' , dir_name , 'desktop' )
18
+
16
19
# def prebuild_armeabi(self):
17
20
# # Override hostpython Setup?
18
21
# shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'),
19
22
# join(self.get_build_dir('armeabi'), 'Modules', 'Setup'))
20
23
24
+ def get_build_dir (self , arch = None ):
25
+ return join (self .get_build_container_dir (), self .name )
26
+
21
27
def build_arch (self , arch ):
28
+ """
29
+ Creates expected build and symlinks system Python version.
30
+ """
22
31
self .ctx .hostpython = '/usr/bin/false'
23
32
self .ctx .hostpgen = '/usr/bin/false'
33
+ # creates the sub buildir (used by other recipes)
34
+ # https://github.com/kivy/python-for-android/issues/1154
35
+ sub_build_dir = join (self .get_build_dir (), 'build' )
36
+ shprint (sh .mkdir , '-p' , sub_build_dir )
37
+ system_python = sh .which ("python" + self .version )
38
+ link_dest = join (self .get_build_dir (), 'hostpython' )
39
+ shprint (sh .ln , '-sf' , system_python , link_dest )
24
40
25
41
26
42
recipe = Hostpython3Recipe ()
0 commit comments