@@ -818,7 +818,6 @@ def install_python_package(self, arch, name=None, env=None, is_dir=True):
818818
819819 with current_directory (self .get_build_dir (arch .arch )):
820820 hostpython = sh .Command (self .hostpython_location )
821- # hostpython = sh.Command('python3.5')
822821
823822
824823 if self .ctx .python_recipe .from_crystax :
@@ -986,15 +985,13 @@ def build_cython_components(self, arch):
986985 site_packages_dirs = command (
987986 '-c' , 'import site; print("\\ n".join(site.getsitepackages()))' )
988987 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'
990988 if 'PYTHONPATH' in env :
991989 env ['PYTHONPATH' ] = env + ':{}' .format (':' .join (site_packages_dirs ))
992990 else :
993991 env ['PYTHONPATH' ] = ':' .join (site_packages_dirs )
994992
995993 with current_directory (self .get_build_dir (arch .arch )):
996994 hostpython = sh .Command (self .ctx .hostpython )
997- # hostpython = sh.Command('python3.5')
998995 shprint (hostpython , '-c' , 'import sys; print(sys.path)' , _env = env )
999996 print ('cwd is' , realpath (curdir ))
1000997 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):
10891086 self .ctx .python_recipe .version , 'include' ,
10901087 'python' )) + env ['CFLAGS' ]
10911088
1092- # Temporarily hardcode the -lpython3.5 as this does not
1089+ # Temporarily hardcode the -lpython3.x as this does not
10931090 # get applied automatically in some environments. This
10941091 # will need generalising, along with the other hardcoded
10951092 # py3.5 references, to support other python3 or crystax
10961093 # 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 )
10981097
10991098 return env
11001099
0 commit comments