@@ -737,9 +737,7 @@ class PythonRecipe(Recipe):
737
737
738
738
def clean_build (self , arch = None ):
739
739
super (PythonRecipe , self ).clean_build (arch = arch )
740
- name = self .site_packages_name
741
- if name is None :
742
- name = self .name
740
+ name = self .folder_name
743
741
python_install_dirs = glob .glob (join (self .ctx .python_installs_dir , '*' ))
744
742
for python_install in python_install_dirs :
745
743
site_packages_dir = glob .glob (join (python_install , 'lib' , 'python*' ,
@@ -766,6 +764,14 @@ def hostpython_location(self):
766
764
return self .real_hostpython_location
767
765
return self .ctx .hostpython
768
766
767
+ @property
768
+ def folder_name (self ):
769
+ '''The name of the build folders containing this recipe.'''
770
+ name = self .site_packages_name
771
+ if name is None :
772
+ name = self .name
773
+ return name
774
+
769
775
def get_recipe_env (self , arch = None , with_flags_in_cc = True ):
770
776
env = super (PythonRecipe , self ).get_recipe_env (arch , with_flags_in_cc )
771
777
if not self .call_hostpython_via_targetpython :
@@ -782,10 +788,7 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
782
788
return env
783
789
784
790
def should_build (self , arch ):
785
- print ('name is' , self .site_packages_name , type (self ))
786
- name = self .site_packages_name
787
- if name is None :
788
- name = self .name
791
+ name = self .folder_name
789
792
if self .ctx .has_package (name ):
790
793
info ('Python package already exists in site-packages' )
791
794
return False
@@ -1010,11 +1013,20 @@ def build_cython_components(self, arch):
1010
1013
info ('First build appeared to complete correctly, skipping manual'
1011
1014
'cythonising.' )
1012
1015
1013
- print ('stripping' )
1014
- build_lib = glob .glob ('./build/lib*' )
1015
- shprint (sh .find , build_lib [0 ], '-name' , '*.o' , '-exec' ,
1016
- env ['STRIP' ], '{}' , ';' , _env = env )
1017
- print ('stripped!?' )
1016
+ if 'python2' in self .ctx .recipe_build_order :
1017
+ info ('Stripping object files' )
1018
+ build_lib = glob .glob ('./build/lib*' )
1019
+ shprint (sh .find , build_lib [0 ], '-name' , '*.o' , '-exec' ,
1020
+ env ['STRIP' ], '{}' , ';' , _env = env )
1021
+
1022
+ if 'python3crystax' in self .ctx .recipe_build_order :
1023
+ info ('Stripping object files' )
1024
+ shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1025
+ '/usr/bin/echo' , '{}' , ';' , _env = env )
1026
+ shprint (sh .find , '.' , '-iname' , '*.so' , '-exec' ,
1027
+ env ['STRIP' ].split (' ' )[0 ], '--strip-unneeded' ,
1028
+ # '/usr/bin/strip', '--strip-unneeded',
1029
+ '{}' , ';' , _env = env )
1018
1030
1019
1031
def cythonize_file (self , env , build_dir , filename ):
1020
1032
short_filename = filename
0 commit comments