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 23
23
import jinja2
24
24
25
25
26
- def get_bootstrap_name ( ):
26
+ def get_dist_info_for ( key ):
27
27
try :
28
28
with open (join (dirname (__file__ ), 'dist_info.json' ), 'r' ) as fileh :
29
29
info = json .load (fileh )
30
- bootstrap = str (info ["bootstrap" ])
30
+ value = str (info [key ])
31
31
except (OSError , KeyError ) as e :
32
- print ("BUILD FAILURE: Couldn't extract bootstrap name " +
32
+ print ("BUILD FAILURE: Couldn't extract the key `" + key + "` " +
33
33
"from dist_info.json: " + str (e ))
34
34
sys .exit (1 )
35
- return bootstrap
35
+ return value
36
+
37
+
38
+ def get_hostpython ():
39
+ return get_dist_info_for ('hostpython' )
40
+
41
+
42
+ def get_bootstrap_name ():
43
+ return get_dist_info_for ('bootstrap' )
36
44
37
45
38
46
if os .name == 'nt' :
@@ -44,9 +52,8 @@ def get_bootstrap_name():
44
52
45
53
curdir = dirname (__file__ )
46
54
47
- # Try to find a host version of Python that matches our ARM version.
48
- PYTHON = join (curdir , 'python-install' , 'bin' , 'python.host' )
49
- if not exists (PYTHON ):
55
+ PYTHON = get_hostpython ()
56
+ if PYTHON is not None and not exists (PYTHON ):
50
57
PYTHON = None
51
58
52
59
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