#NEWLINE# def create_fat_binaries( b32 , b64 , bfat ) : #NEWLINE# #INDENT# print ( 'Creating fat binaries' ) #NEWLINE# if os . path . exists ( bfat ) : #NEWLINE# #INDENT# shutil . rmtree ( bfat ) #NEWLINE# #UNINDENT# os . mkdir ( bfat ) #NEWLINE# res = os . system ( 'cp -rf {}/* {}/' . format ( b64 , bfat ) ) #NEWLINE# assert ( res == 0 ) #NEWLINE# files = os . listdir ( b32 ) #NEWLINE# for fbase in files : #NEWLINE# #INDENT# if ( not ( fbase . endswith ( '.dylib' ) or fbase . endswith ( '.so' ) or fbase . endswith ( 'subprocess' ) ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# fname32 = os . path . join ( b32 , fbase ) #NEWLINE# fname64 = os . path . join ( b64 , fbase ) #NEWLINE# fnamefat = os . path . join ( bfat , fbase ) #NEWLINE# print ( 'Creating fat binary: {}' . format ( fbase ) ) #NEWLINE# res = os . system ( 'lipo {} {} -create -output {}' . format ( fname32 , fname64 , fnamefat ) ) #NEWLINE# assert ( res == 0 )