How to use the auditwheel.wheeltools.add_platforms function in auditwheel

To help you get started, we’ve selected a few auditwheel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse / xacc / tools / wheels / fix_xacc_rpaths.py View on Github external
# we grafted in a bunch of libraries and modifed their sonames, but
        # they may have internal dependencies (DT_NEEDED) on one another, so
        # we need to update those records so each now knows about the new
        # name of the other.
        for old_soname, (new_soname, path) in soname_map.items():
            needed = elf_read_dt_needed(path)
            for n in needed:
                if n in soname_map:
                    check_call(['patchelf', '--replace-needed', n, soname_map[n][0], path])


        check_call(['patchelf', '--force-rpath', '--set-rpath', '$ORIGIN/.libs:$ORIGIN/lib', 'xacc/_pyxacc.so'])

        if update_tags:
            ctx.out_wheel = add_platforms(ctx, [abi],
                                          get_replace_platforms(abi))
    return ctx.out_wheel
github pypa / auditwheel / auditwheel / repair.py View on Github external
new_rpath = os.path.relpath(dest_dir, os.path.dirname(fn))
                new_rpath = os.path.join('$ORIGIN', new_rpath)
                append_rpath_within_wheel(fn, new_rpath, ctx.name, patcher)

        # we grafted in a bunch of libraries and modified their sonames, but
        # they may have internal dependencies (DT_NEEDED) on one another, so
        # we need to update those records so each now knows about the new
        # name of the other.
        for old_soname, (new_soname, path) in soname_map.items():
            needed = elf_read_dt_needed(path)
            for n in needed:
                if n in soname_map:
                    patcher.replace_needed(path, n, soname_map[n][0])

        if update_tags:
            ctx.out_wheel = add_platforms(ctx, [abi],
                                          get_replace_platforms(abi))
    return ctx.out_wheel
github pypa / auditwheel / auditwheel / main_addtag.py View on Github external
logger.info('%s receives the following tag: "%s".',
                basename(args.WHEEL_FILE), wheel_abi.overall_tag)
    logger.info('Use ``auditwheel show`` for more details')

    if wheel_abi.overall_tag in in_fname_tags:
        logger.info('No tags to be added. Exiting.')
        return 1

    # todo: move more of this logic to separate file
    if not exists(args.WHEEL_DIR):
        os.makedirs(args.WHEEL_DIR)

    with InWheelCtx(args.WHEEL_FILE) as ctx:
        try:
            out_wheel = add_platforms(ctx, [wheel_abi.overall_tag])
        except WheelToolsError as e:
            logger.exception('\n%s.', repr(e))
            return 1

        if out_wheel:
            # tell context manager to write wheel on exit with
            # the proper output directory
            ctx.out_wheel = join(args.WHEEL_DIR, basename(out_wheel))
            logger.info('\nUpdated wheel written to %s', out_wheel)
    return 0
github chopralab / lemon / scripts / tag_manylinux.py View on Github external
@click.command()
@click.argument('wheel',  type=click.Path(exists=True))
def main(wheel):
  dir = os.path.dirname(os.path.abspath(wheel))
  with InWheelCtx(wheel) as ctx:
    try:
      new_wheel = add_platforms(ctx, ['manylinux1_x86_64'], remove_platforms=('linux_x86_64',))
    except WheelToolsError as e:
      click.echo(str(e), err=True)
      raise
    if new_wheel:
      ctx.out_wheel = os.path.normpath(os.path.join(dir, new_wheel))
      click.echo('Updated wheel written to %s' % ctx.out_wheel)