Example #1
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        if self.ctx.python_recipe.from_crystax:
            info('Python was loaded from CrystaX, skipping strip')
            return
        env = arch.get_env()
        strip = which('arm-linux-androideabi-strip', env['PATH'])
        if strip is None:
            warning('Can\'t find strip in PATH...')
            return
        strip = sh.Command(strip)

        libs_dir = join(self.dist_dir, '_python_bundle',
                        '_python_bundle', 'modules')
        if self.ctx.python_recipe.name == 'python2legacy':
            libs_dir = join(self.dist_dir, 'private')
        filens = shprint(sh.find, libs_dir, join(self.dist_dir, 'libs'),
                         '-iname', '*.so', _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Example #2
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        env = arch.get_env()
        tokens = shlex.split(env['STRIP'])
        strip = sh.Command(tokens[0])
        if len(tokens) > 1:
            strip = strip.bake(tokens[1:])

        libs_dir = join(self.dist_dir, '_python_bundle', '_python_bundle',
                        'modules')
        filens = shprint(sh.find,
                         libs_dir,
                         join(self.dist_dir, 'libs'),
                         '-iname',
                         '*.so',
                         _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            if not filen:
                continue  # skip the last ''
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Example #3
0
    def strip_libraries(self, arch):
        info('Stripping libraries')
        if self.ctx.python_recipe.from_crystax:
            info('Python was loaded from CrystaX, skipping strip')
            return
        env = arch.get_env()
        tokens = shlex.split(env['STRIP'])
        strip = sh.Command(tokens[0])
        if len(tokens) > 1:
            strip = strip.bake(tokens[1:])

        libs_dir = join(self.dist_dir, '_python_bundle',
                        '_python_bundle', 'modules')
        if self.ctx.python_recipe.name == 'python2legacy':
            libs_dir = join(self.dist_dir, 'private')
        filens = shprint(sh.find, libs_dir, join(self.dist_dir, 'libs'),
                         '-iname', '*.so', _env=env).stdout.decode('utf-8')

        logger.info('Stripping libraries in private dir')
        for filen in filens.split('\n'):
            if not filen:
                continue  # skip the last ''
            try:
                strip(filen, _env=env)
            except sh.ErrorReturnCode_1:
                logger.debug('Failed to strip ' + filen)
Example #4
0
def current_directory(new_dir):
    cur_dir = getcwd()
    logger.info(''.join(
        (Err_Fore.CYAN, '-> directory context ', new_dir, Err_Fore.RESET)))
    chdir(new_dir)
    yield
    logger.info(''.join(
        (Err_Fore.CYAN, '<- directory context ', cur_dir, Err_Fore.RESET)))
    chdir(cur_dir)
Example #5
0
def current_directory(new_dir):
    cur_dir = getcwd()
    logger.info(''.join((Err_Fore.CYAN, '-> directory context ', new_dir,
                         Err_Fore.RESET)))
    chdir(new_dir)
    yield
    logger.info(''.join((Err_Fore.CYAN, '<- directory context ', cur_dir,
                         Err_Fore.RESET)))
    chdir(cur_dir)
 def strip_libraries(self, arch):
     info('Stripping libraries')
     env = arch.get_env()
     strip = which('arm-linux-androideabi-strip', env['PATH'])
     if strip is None:
         warning('Can\'t find strip in PATH...')
         return
     strip = sh.Command(strip)
     filens = shprint(sh.find, join(self.dist_dir, 'private'),
                      join(self.dist_dir, 'libs'),
                      '-iname', '*.so', _env=env).stdout.decode('utf-8')
     logger.info('Stripping libraries in private dir')
     for filen in filens.split('\n'):
         try:
             strip(filen, _env=env)
         except sh.ErrorReturnCode_1:
             logger.debug('Failed to strip ' + filen)
 def strip_libraries(self, arch):
     info('Stripping libraries')
     env = arch.get_env()
     strip = which('arm-linux-androideabi-strip', env['PATH'])
     if strip is None:
         warning('Can\'t find strip in PATH...')
         return
     strip = sh.Command(strip)
     filens = shprint(sh.find,
                      join(self.dist_dir, 'private'),
                      join(self.dist_dir, 'libs'),
                      '-iname',
                      '*.so',
                      _env=env).stdout.decode('utf-8')
     logger.info('Stripping libraries in private dir')
     for filen in filens.split('\n'):
         try:
             strip(filen, _env=env)
         except sh.ErrorReturnCode_1:
             logger.debug('Failed to strip ' + filen)