@@ -818,7 +818,6 @@ def install_python_package(self, arch, name=None, env=None, is_dir=True):
818
818
819
819
with current_directory (self .get_build_dir (arch .arch )):
820
820
hostpython = sh .Command (self .hostpython_location )
821
- # hostpython = sh.Command('python3.5')
822
821
823
822
824
823
if self .ctx .python_recipe .from_crystax :
@@ -986,15 +985,13 @@ def build_cython_components(self, arch):
986
985
site_packages_dirs = command (
987
986
'-c' , 'import site; print("\\ n".join(site.getsitepackages()))' )
988
987
site_packages_dirs = site_packages_dirs .stdout .decode ('utf-8' ).split ('\n ' )
989
- # env['PYTHONPATH'] = '/usr/lib/python3.5/site-packages/:/usr/lib/python3.5'
990
988
if 'PYTHONPATH' in env :
991
989
env ['PYTHONPATH' ] = env + ':{}' .format (':' .join (site_packages_dirs ))
992
990
else :
993
991
env ['PYTHONPATH' ] = ':' .join (site_packages_dirs )
994
992
995
993
with current_directory (self .get_build_dir (arch .arch )):
996
994
hostpython = sh .Command (self .ctx .hostpython )
997
- # hostpython = sh.Command('python3.5')
998
995
shprint (hostpython , '-c' , 'import sys; print(sys.path)' , _env = env )
999
996
print ('cwd is' , realpath (curdir ))
1000
997
info ('Trying first build of {} to get cython files: this is '
@@ -1089,12 +1086,14 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
1089
1086
self .ctx .python_recipe .version , 'include' ,
1090
1087
'python' )) + env ['CFLAGS' ]
1091
1088
1092
- # Temporarily hardcode the -lpython3.5 as this does not
1089
+ # Temporarily hardcode the -lpython3.x as this does not
1093
1090
# get applied automatically in some environments. This
1094
1091
# will need generalising, along with the other hardcoded
1095
1092
# py3.5 references, to support other python3 or crystax
1096
1093
# python versions.
1097
- env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -lpython3.5m'
1094
+ python3_version = self .ctx .python_recipe .version
1095
+ python3_version = '.' .join (python3_version .split ('.' )[:2 ])
1096
+ env ['LDFLAGS' ] = env ['LDFLAGS' ] + ' -lpython{}m' .format (python3_version )
1098
1097
1099
1098
return env
1100
1099
0 commit comments