File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 22
22
import jinja2
23
23
24
24
25
- def get_bootstrap_name ( ):
25
+ def get_dist_info_for ( key ):
26
26
try :
27
27
with open (join (dirname (__file__ ), 'dist_info.json' ), 'r' ) as fileh :
28
28
info = json .load (fileh )
29
- bootstrap = str (info ["bootstrap" ])
29
+ value = str (info [key ])
30
30
except (OSError , KeyError ) as e :
31
- print ("BUILD FAILURE: Couldn't extract bootstrap name " +
31
+ print ("BUILD FAILURE: Couldn't extract the key `" + key + "` " +
32
32
"from dist_info.json: " + str (e ))
33
33
sys .exit (1 )
34
- return bootstrap
34
+ return value
35
+
36
+
37
+ def get_hostpython ():
38
+ return get_dist_info_for ('hostpython' )
39
+
40
+
41
+ def get_bootstrap_name ():
42
+ return get_dist_info_for ('bootstrap' )
35
43
36
44
37
45
if os .name == 'nt' :
@@ -43,9 +51,8 @@ def get_bootstrap_name():
43
51
44
52
curdir = dirname (__file__ )
45
53
46
- # Try to find a host version of Python that matches our ARM version.
47
- PYTHON = join (curdir , 'python-install' , 'bin' , 'python.host' )
48
- if not exists (PYTHON ):
54
+ PYTHON = get_hostpython ()
55
+ if PYTHON is not None and not exists (PYTHON ):
49
56
PYTHON = None
50
57
51
58
BLACKLIST_PATTERNS = [
Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ def save_info(self, dirn):
216
216
'bootstrap' : self .ctx .bootstrap .name ,
217
217
'archs' : [arch .arch for arch in self .ctx .archs ],
218
218
'ndk_api' : self .ctx .ndk_api ,
219
- 'recipes' : self .ctx .recipe_build_order + self .ctx .python_modules },
219
+ 'recipes' : self .ctx .recipe_build_order + self .ctx .python_modules ,
220
+ 'hostpython' : self .ctx .hostpython ,
221
+ 'python_version' : self .ctx .python_recipe .major_minor_version_string },
220
222
fileh )
221
223
222
224
You can’t perform that action at this time.
0 commit comments