Beispiel #1
0
def get_system_paths():
    """Return paths of system libraries"""
    paths = []
    # This prioritizes system libraries over
    # the Lutris and Steam runtimes.
    for lib_paths in LINUX_SYSTEM.iter_lib_folders():
        for index, _arch in enumerate(LINUX_SYSTEM.runtime_architectures):
            paths.append(lib_paths[index])
    return paths
Beispiel #2
0
def get_system_paths():
    """Return paths of system libraries"""
    paths = []
    # This prioritizes system libraries over
    # the Lutris and Steam runtimes.
    for lib_paths in LINUX_SYSTEM.iter_lib_folders():
        for path in lib_paths:
            paths.append(path)
    return paths
Beispiel #3
0
def get_paths(prefer_system_libs=True, wine_path=None):
    """Return a list of paths containing the runtime libraries."""
    paths = []

    if not RUNTIME_DISABLED:
        runtime_paths = [
            "lib32",
            "steam/i386/lib/i386-linux-gnu",
            "steam/i386/lib",
            "steam/i386/usr/lib/i386-linux-gnu",
            "steam/i386/usr/lib",
        ]

        if system.LINUX_SYSTEM.is_64_bit:
            runtime_paths += [
                "lib64",
                "steam/amd64/lib/x86_64-linux-gnu",
                "steam/amd64/lib",
                "steam/amd64/usr/lib/x86_64-linux-gnu",
                "steam/amd64/usr/lib",
            ]

        if prefer_system_libs:
            paths = []
            # Prioritize libwine.so.1 for lutris builds
            if system.path_exists(wine_path):
                paths.append(os.path.join(wine_path, "lib"))
                lib64_path = os.path.join(wine_path, "lib64")
                if system.path_exists(lib64_path):
                    paths.append(lib64_path)

            # This prioritizes system libraries over
            # the Lutris and Steam runtimes.
            for lib_paths in LINUX_SYSTEM.iter_lib_folders():
                for index, _arch in enumerate(
                        LINUX_SYSTEM.runtime_architectures):
                    paths.append(lib_paths[index])

        # Then resolve absolute paths for the runtime
        paths += [os.path.join(RUNTIME_DIR, path) for path in runtime_paths]

    if os.environ.get("LD_LIBRARY_PATH"):
        paths.append(os.environ["LD_LIBRARY_PATH"])

    return paths
Beispiel #4
0
def get_runtime_paths(version=None, prefer_system_libs=True, wine_path=None):
    """Return Lutris runtime paths"""
    version = version or DEFAULT_RUNTIME
    if version.startswith("Ubuntu"):
        lutris_runtime_path = "%s-i686" % version
    elif version == "legacy":
        lutris_runtime_path = "lib32"
    else:
        raise ValueError("Invalid runtime version %s" % version)

    runtime_paths = [
        lutris_runtime_path,
        "steam/i386/lib/i386-linux-gnu",
        "steam/i386/lib",
        "steam/i386/usr/lib/i386-linux-gnu",
        "steam/i386/usr/lib",
    ]

    if system.LINUX_SYSTEM.is_64_bit:
        if version == "legacy":
            lutris_runtime_path = "lib64"
        else:
            lutris_runtime_path = "%s-x86_64" % version
        runtime_paths += [
            lutris_runtime_path,
            "steam/amd64/lib/x86_64-linux-gnu",
            "steam/amd64/lib",
            "steam/amd64/usr/lib/x86_64-linux-gnu",
            "steam/amd64/usr/lib",
        ]

    paths = []
    if prefer_system_libs:
        if wine_path:
            paths += get_winelib_paths(wine_path)
        paths += list(LINUX_SYSTEM.iter_lib_folders())
    # Then resolve absolute paths for the runtime
    paths += [
        os.path.join(settings.RUNTIME_DIR, path) for path in runtime_paths
    ]
    return paths