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 2323import jinja2
2424
2525
26- def get_bootstrap_name ( ):
26+ def get_dist_info_for ( key ):
2727 try :
2828 with open (join (dirname (__file__ ), 'dist_info.json' ), 'r' ) as fileh :
2929 info = json .load (fileh )
30- bootstrap = str (info ["bootstrap" ])
30+ value = str (info [key ])
3131 except (OSError , KeyError ) as e :
32- print ("BUILD FAILURE: Couldn't extract bootstrap name " +
32+ print ("BUILD FAILURE: Couldn't extract the key `" + key + "` " +
3333 "from dist_info.json: " + str (e ))
3434 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' )
3644
3745
3846if os .name == 'nt' :
@@ -44,9 +52,8 @@ def get_bootstrap_name():
4452
4553curdir = dirname (__file__ )
4654
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 ):
5057 PYTHON = None
5158
5259BLACKLIST_PATTERNS = [
Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ def save_info(self, dirn):
216216 'bootstrap' : self .ctx .bootstrap .name ,
217217 'archs' : [arch .arch for arch in self .ctx .archs ],
218218 '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 },
220222 fileh )
221223
222224
You can’t perform that action at this time.
0 commit comments