Beispiel #1
0
def osx_ch_link(path, link):
    assert path.startswith(build_prefix + '/')
    reldir = utils.rel_lib(path[len(build_prefix) + 1:])

    if link.startswith((build_prefix + '/lib', 'lib', '@executable_path/')):
        return '@loader_path/%s/%s' % (reldir, basename(link))

    if link == '/usr/local/lib/libgcc_s.1.dylib':
        return '/usr/lib/libgcc_s.1.dylib'
Beispiel #2
0
def osx_ch_link(path, link):
    assert path.startswith(build_prefix + "/")
    reldir = utils.rel_lib(path[len(build_prefix) + 1 :])

    if link.startswith((build_prefix + "/lib", "lib", "@executable_path/")):
        return "@loader_path/%s/%s" % (reldir, basename(link))

    if link == "/usr/local/lib/libgcc_s.1.dylib":
        return "/usr/lib/libgcc_s.1.dylib"
Beispiel #3
0
def osx_ch_link(path, link):
    assert path.startswith(build_prefix + '/')
    reldir = utils.rel_lib(path[len(build_prefix) + 1:])

    if link.startswith((build_prefix + '/lib', 'lib', '@executable_path/')):
        return '@loader_path/%s/%s' % (reldir, basename(link))

    if link == '/usr/local/lib/libgcc_s.1.dylib':
        return '/usr/lib/libgcc_s.1.dylib'
Beispiel #4
0
def mk_relative(f):
    assert sys.platform != "win32"
    if f.startswith("bin/"):
        fix_shebang(f)

    path = join(build_prefix, f)
    if sys.platform.startswith("linux") and is_obj(path):
        rpath = "$ORIGIN/" + utils.rel_lib(f)
        chrpath = external.find_executable("chrpath")
        call([chrpath, "-r", rpath, path])

    if sys.platform == "darwin" and is_obj(path):
        mk_relative_osx(path)
Beispiel #5
0
def mk_relative(f):
    assert sys.platform != 'win32'
    if f.startswith('bin/'):
        fix_shebang(f)

    path = join(build_prefix, f)
    if sys.platform.startswith('linux') and is_obj(path):
        rpath = '$ORIGIN/' + utils.rel_lib(f)
        current_rpath = _get_rpath(path)
        if "$ORIGIN" in current_rpath:
            print("skipping relative rpath", current_rpath)
            return
        chrpath = external.find_executable('chrpath')
        call([chrpath, '-r', rpath, path])

    if sys.platform == 'darwin' and is_obj(path):
        mk_relative_osx(path)
Beispiel #6
0
def _get_new_rpath(path, rpath):
    root_path = utils.get_root_path((path, rpath))
    rel_path = path.replace(root_path, '')
    rel_rpath = rpath.replace(root_path, '')
    lib_path = '%s/lib' % build_prefix
    if rpath == lib_path:
        new_rpath = '$ORIGIN/%s' % normpath(rel_path.count('/') * '../')
    else:
        # .so is linking to somewhere outside of $PREFIX/lib; alter RPATH to
        # point to that location first, then $PREFIX/lib second.
        rel_file = path.replace(build_prefix, '')[1:]
        rel_lib_path = utils.rel_lib(rel_file)
        new_rpath = '$ORIGIN/%s/%s:$ORIGIN/%s' % (
            normpath(rel_path.count('/') * '../'),
            rel_rpath,
            rel_lib_path,
        )
    return new_rpath
Beispiel #7
0
def mk_relative(f):
    assert sys.platform != 'win32'
    if f.startswith('bin/'):
        fix_shebang(f)

    path = join(build_prefix, f)
    if sys.platform == 'linux2' and is_obj(path):
        runpath = '$ORIGIN/' + utils.rel_lib(f)
        chrpath = external.find_executable('chrpath')
        if chrpath is None:
            sys.exit("""\
Error:
    Did not find 'chrpath' in: %s
    'chrpath' is necessary for building conda packages on Linux with
    relocatable ELF libraries.  You can install chrpath using apt-get,
    yum or conda.
""" % (os.pathsep.join(external.dir_paths)))
        call([chrpath, '-c', '-r', runpath, path])

    if sys.platform == 'darwin' and is_obj(path):
        mk_relative_osx(path)
Beispiel #8
0
def mk_relative(f):
    assert sys.platform != "win32"
    if f.startswith("bin/"):
        fix_shebang(f)

    path = join(build_prefix, f)
    if sys.platform == "linux2" and is_obj(path):
        rpath = "$ORIGIN/" + utils.rel_lib(f)
        chrpath = external.find_executable("chrpath")
        if chrpath is None:
            sys.exit(
                """\
Error:
    Did not find 'chrpath' in: %s
    'chrpath' is necessary for building conda packages on Linux with
    relocatable ELF libraries.  You can install chrpath using apt-get,
    yum or conda.
"""
                % (os.pathsep.join(external.dir_paths))
            )
        call([chrpath, "-r", rpath, path])

    if sys.platform == "darwin" and is_obj(path):
        mk_relative_osx(path)