mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
fix(fex): supply current Wayland libraries in the shared runtime (#2426)
* fix(fex): supply current Wayland libraries in the shared runtime * fix(fex): provide current FreeType runtime libraries * fix(fex): fall back when provider links are broken * fix(fex): require ffi for provider Wayland libraries * fix(fex): keep Wayland cursor with its provider client * fix(fex): preserve cursor compatibility and refresh runtime cache * fix(fex): provide current GBM runtime libraries
This commit is contained in:
1 parent
7852098e63
commit
913cb85c92
2 files changed
+351
-3
No files matched your search
@@ -38,7 +38,7 @@ RUNTIMES = {SNIPER_APPID: ("sniper_platform_", "Steam Linux Runtime 3.0 (sniper"
|
||||
SLR4_APPID: ("steamrt4_platform_", "Steam Linux Runtime 4.0 (steamrt4")}
|
||||
MARKER = ".droiddeck-fex"
|
||||
LAYOUT = 1
|
||||
ROOTFS_LAYOUT = 4
|
||||
ROOTFS_LAYOUT = 10
|
||||
BLOB_DIRS = re.compile(r"^(?:\.ref|[0-9a-f]{2})$")
|
||||
ROOTFS_LIBRARY_DIRS = ("lib", "lib64")
|
||||
ARCH_DIRS = ("x86_64-linux-gnu", "i386-linux-gnu")
|
||||
@@ -49,7 +49,15 @@ PROVIDED = frozenset((
|
||||
"libnss_compat.so.2", "libnss_dns.so.2", "libnss_files.so.2", "libnss_hesiod.so.2", "libthread_db.so.1",
|
||||
"libmemusage.so", "libpcprofile.so", "libc_malloc_debug.so.0", "gconv", "libstdc++.so.6", "libgcc_s.so.1",
|
||||
"libssl.so.3", "libcrypto.so.3",
|
||||
"libfreetype.so.6", "libpng16.so.16", "libbrotlidec.so.1", "libbrotlicommon.so.1", "libbz2.so.1.0", "libz.so.1",
|
||||
"libwayland-client.so.0", "libwayland-egl.so.1", "libwayland-server.so.0", "libffi.so.8",
|
||||
"libgbm.so.1", "libdrm.so.2", "libexpat.so.1",
|
||||
))
|
||||
PROVIDED_NEEDS = {
|
||||
"libwayland-client.so.0": ("libffi.so.8",),
|
||||
"libwayland-server.so.0": ("libffi.so.8",),
|
||||
"libgbm.so.1": ("libdrm.so.2", "libexpat.so.1"),
|
||||
}
|
||||
GLIBC_BUILD = re.compile(r"^(?:ld|lib[A-Za-z_]+)-2\.[0-9]+\.so$|^libSegFault\.so$")
|
||||
GUEST_LIBDIRS = (("x86_64", "lib/x86_64-linux-gnu"), ("i386", "lib/i386-linux-gnu"))
|
||||
PRELOAD_NAMES = ("libblsession.so", "libfakeinput.so")
|
||||
@@ -343,10 +351,14 @@ def stays_in_libraries(root, target, link):
|
||||
|
||||
|
||||
def mirror(source, provider, name, target, root):
|
||||
if provider and name in PROVIDED and os.path.lexists(os.path.join(provider, name)):
|
||||
usable_provider = provider and all(os.path.exists(os.path.join(provider, needed))
|
||||
for needed in (name,) + PROVIDED_NEEDS.get(name, ()))
|
||||
if name in PROVIDED and usable_provider:
|
||||
clone(os.path.join(provider, name), os.path.join(target, name))
|
||||
return
|
||||
path = os.path.join(source, name)
|
||||
if not os.path.lexists(path):
|
||||
return
|
||||
link = os.readlink(path) if os.path.islink(path) else None
|
||||
if link and GLIBC_BUILD.match(os.path.basename(link)):
|
||||
if name not in INTERPRETERS:
|
||||
@@ -365,6 +377,16 @@ def build_rootfs(base, provider):
|
||||
rootfs = os.path.join(STATE, "rootfs")
|
||||
stamp = "%d\n%s\n%s%s\n%s" % (ROOTFS_LAYOUT, os.path.realpath(base), read_text(os.path.join(base_files, MARKER)) or "",
|
||||
os.path.realpath(provider), read_text(os.path.join(provider_files, MARKER)) or "")
|
||||
for top in ("lib", "lib64"):
|
||||
for arch in ARCH_DIRS:
|
||||
for name in sorted(PROVIDED):
|
||||
path = os.path.join(provider_files, top, arch, name)
|
||||
try:
|
||||
info = os.stat(path)
|
||||
stamp += "\n%s %s %d %d %d %d" % (path, os.path.realpath(path), info.st_ino, info.st_size,
|
||||
info.st_mtime_ns, info.st_ctime_ns)
|
||||
except OSError:
|
||||
stamp += "\n%s missing" % path
|
||||
if read_text(os.path.join(rootfs, MARKER)) == stamp:
|
||||
return False
|
||||
for entry in os.listdir(STATE):
|
||||
@@ -384,7 +406,7 @@ def build_rootfs(base, provider):
|
||||
if entry in ARCH_DIRS and os.path.isdir(path) and not os.path.islink(path):
|
||||
provided = os.path.join(provider_files, top, entry)
|
||||
os.makedirs(os.path.join(tmp, top, entry))
|
||||
for name in set(os.listdir(path)) | {name for name in PROVIDED if os.path.lexists(os.path.join(provided, name))}:
|
||||
for name in set(os.listdir(path)) | {name for name in PROVIDED if os.path.exists(os.path.join(provided, name))}:
|
||||
mirror(path, provided, name, os.path.join(tmp, top, entry), tmp)
|
||||
else:
|
||||
mirror(source, None, entry, os.path.join(tmp, top), tmp)
|
||||
|
||||
Reference in new issue
Block a user