@@ -730,7 +730,7 @@ class PythonRecipe(Recipe):
730730 def __init__ (self , * args , ** kwargs ):
731731 super (PythonRecipe , self ).__init__ (* args , ** kwargs )
732732 depends = self .depends
733- depends .append (('python2' , 'python2legacy' , ' python3' , 'python3crystax' ))
733+ depends .append (('python2' , 'python3' , 'python3crystax' ))
734734 depends = list (set (depends ))
735735 self .depends = depends
736736
@@ -753,7 +753,7 @@ def real_hostpython_location(self):
753753 host_build = Recipe .get_recipe (host_name , self .ctx ).get_build_dir ()
754754 if host_name in ['hostpython2' , 'hostpython3' ]:
755755 return join (host_build , 'native-build' , 'python' )
756- elif host_name in ['hostpython3crystax' , 'hostpython2legacy' ]:
756+ elif host_name in ['hostpython3crystax' ]:
757757 return join (host_build , 'hostpython' )
758758 else :
759759 python_recipe = self .ctx .python_recipe
@@ -795,10 +795,6 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
795795 self .ctx .python_recipe .major_minor_version_string )
796796 if python_name == 'python3' :
797797 env ['LDFLAGS' ] += 'm'
798- elif python_name == 'python2legacy' :
799- env ['PYTHON_ROOT' ] = join (
800- self .ctx .python_recipe .get_build_dir (
801- arch .arch ), 'python-install' )
802798 else :
803799 ndk_dir_python = join (self .ctx .ndk_dir , 'sources' ,
804800 'python' , python_version )
@@ -850,27 +846,11 @@ def install_python_package(self, arch, name=None, env=None, is_dir=True):
850846
851847 with current_directory (self .get_build_dir (arch .arch )):
852848 hostpython = sh .Command (self .hostpython_location )
853-
854- if self .ctx .python_recipe .name != 'python2legacy' :
855- hpenv = env .copy ()
856- shprint (hostpython , 'setup.py' , 'install' , '-O2' ,
857- '--root={}' .format (self .ctx .get_python_install_dir ()),
858- '--install-lib=.' ,
859- _env = hpenv , * self .setup_extra_args )
860- elif self .call_hostpython_via_targetpython :
861- shprint (hostpython , 'setup.py' , 'install' , '-O2' , _env = env ,
862- * self .setup_extra_args )
863- else : # python2legacy
864- hppath = join (dirname (self .hostpython_location ), 'Lib' , 'site-packages' )
865- hpenv = env .copy ()
866- if 'PYTHONPATH' in hpenv :
867- hpenv ['PYTHONPATH' ] = ':' .join ([hppath ] + hpenv ['PYTHONPATH' ].split (':' ))
868- else :
869- hpenv ['PYTHONPATH' ] = hppath
870- shprint (hostpython , 'setup.py' , 'install' , '-O2' ,
871- '--root={}' .format (self .ctx .get_python_install_dir ()),
872- '--install-lib=lib/python2.7/site-packages' ,
873- _env = hpenv , * self .setup_extra_args )
849+ hpenv = env .copy ()
850+ shprint (hostpython , 'setup.py' , 'install' , '-O2' ,
851+ '--root={}' .format (self .ctx .get_python_install_dir ()),
852+ '--install-lib=.' ,
853+ _env = hpenv , * self .setup_extra_args )
874854
875855 # If asked, also install in the hostpython build dir
876856 if self .install_in_hostpython :
@@ -974,7 +954,7 @@ class CythonRecipe(PythonRecipe):
974954 def __init__ (self , * args , ** kwargs ):
975955 super (CythonRecipe , self ).__init__ (* args , ** kwargs )
976956 depends = self .depends
977- depends .append (('python2' , 'python2legacy' , ' python3' , 'python3crystax' ))
957+ depends .append (('python2' , 'python3' , 'python3crystax' ))
978958 depends = list (set (depends ))
979959 self .depends = depends
980960
@@ -1022,18 +1002,12 @@ def strip_object_files(self, arch, env, build_dir=None):
10221002 build_dir = self .get_build_dir (arch .arch )
10231003 with current_directory (build_dir ):
10241004 info ('Stripping object files' )
1025- if self .ctx .python_recipe .name == 'python2legacy' :
1026- info ('Stripping object files' )
1027- build_lib = glob .glob ('./build/lib*' )
1028- shprint (sh .find , build_lib [0 ], '-name' , '*.o' , '-exec' ,
1029- env ['STRIP' ], '{}' , ';' , _env = env )
1030- else :
1031- shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1032- '/usr/bin/echo' , '{}' , ';' , _env = env )
1033- shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1034- env ['STRIP' ].split (' ' )[0 ], '--strip-unneeded' ,
1035- # '/usr/bin/strip', '--strip-unneeded',
1036- '{}' , ';' , _env = env )
1005+ shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1006+ '/usr/bin/echo' , '{}' , ';' , _env = env )
1007+ shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1008+ env ['STRIP' ].split (' ' )[0 ], '--strip-unneeded' ,
1009+ # '/usr/bin/strip', '--strip-unneeded',
1010+ '{}' , ';' , _env = env )
10371011
10381012 def cythonize_file (self , env , build_dir , filename ):
10391013 short_filename = filename
@@ -1071,10 +1045,7 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
10711045 env ['LDFLAGS' ] = (env ['LDFLAGS' ] +
10721046 ' -L{}' .format (join (self .ctx .bootstrap .build_dir , 'libs' , arch .arch )))
10731047
1074- if self .ctx .python_recipe .name == 'python2legacy' :
1075- env ['LDSHARED' ] = join (self .ctx .root_dir , 'tools' , 'liblink.sh' )
1076- else :
1077- env ['LDSHARED' ] = env ['CC' ] + ' -shared'
1048+ env ['LDSHARED' ] = env ['CC' ] + ' -shared'
10781049 # shprint(sh.whereis, env['LDSHARED'], _env=env)
10791050 env ['LIBLINK' ] = 'NOTNONE'
10801051 env ['NDKPLATFORM' ] = self .ctx .ndk_platform
0 commit comments