From d0bbf643d90597f218be0337a468081ce5eabea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 13 Jan 2025 00:31:39 +0100 Subject: [PATCH] proton: Use WINEDLLPATH for vkd3d DLLs instead of copying them. --- default_pfx.py | 7 +++---- proton | 23 +++++++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/default_pfx.py b/default_pfx.py index 38400944..fdbbc0bf 100755 --- a/default_pfx.py +++ b/default_pfx.py @@ -119,14 +119,13 @@ def fixup_drive_links(default_pfx_dir): def make_default_pfx(default_pfx_dir, dist_dir): local_env = dict(os.environ) + libdir = dist_dir + '/lib/' - ld_path = dist_dir + "/lib/x86_64-linux-gnu:" + dist_dir + "/lib/i386-linux-gnu" - dll_path = dist_dir + "/lib/vkd3d/x86_64-windows:" + dist_dir + "/lib/vkd3d/i386-windows" - + ld_path = ':'.join([libdir + "x86_64-linux-gnu", libdir + "i386-linux-gnu"]) local_env["LD_LIBRARY_PATH"] = ld_path local_env["WINEPREFIX"] = default_pfx_dir local_env["WINEDEBUG"] = "-all" - local_env["WINEDLLPATH"] = dll_path + local_env["WINEDLLPATH"] = libdir + "vkd3d" runtime_args = [] subprocess.run(runtime_args + ["/bin/bash", "-c", diff --git a/proton b/proton index c6c790cc..d39502a6 100755 --- a/proton +++ b/proton @@ -40,7 +40,7 @@ from random import randrange #To enable debug logging, copy "user_settings.sample.py" to "user_settings.py" #and edit it if needed. -CURRENT_PREFIX_VERSION="10.0-103" +CURRENT_PREFIX_VERSION="10.0-104" PFX="Proton: " ld_path_var = "LD_LIBRARY_PATH" @@ -742,6 +742,15 @@ class CompatData: log("Removing stale builtin " + builtin) os.remove(builtin) + stale_vkd3d = [self.prefix_dir + "/drive_c/windows/system32/libvkd3d-1.dll", + self.prefix_dir + "/drive_c/windows/syswow64/libvkd3d-1.dll", + self.prefix_dir + "/drive_c/windows/system32/libvkd3d-shader-1.dll", + self.prefix_dir + "/drive_c/windows/syswow64/libvkd3d-shader-1.dll" ] + for dll in stale_vkd3d: + if file_exists(dll, follow_symlinks=False): + log("Removing stale vkd3d dll " + dll) + os.remove(dll) + except ValueError: log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.") #Just let the Wine upgrade happen and hope it works... @@ -1036,16 +1045,6 @@ class CompatData: try_copy(g_proton.default_pfx_dir + "drive_c/openxr/wineopenxr64.json", "drive_c/openxr", prefix=self.prefix_dir, track_file=tracked_files, link_debug=True) - #copy vkd3d files into place - try_copy(g_proton.lib_dir + "vkd3d/x86_64-windows/libvkd3d-1.dll", "drive_c/windows/system32", - prefix=self.prefix_dir, track_file=tracked_files, link_debug=True) - try_copy(g_proton.lib_dir + "vkd3d/i386-windows/libvkd3d-1.dll", "drive_c/windows/syswow64", - prefix=self.prefix_dir, track_file=tracked_files, link_debug=True) - try_copy(g_proton.lib_dir + "vkd3d/x86_64-windows/libvkd3d-shader-1.dll", "drive_c/windows/system32", - prefix=self.prefix_dir, track_file=tracked_files, link_debug=True) - try_copy(g_proton.lib_dir + "vkd3d/i386-windows/libvkd3d-shader-1.dll", "drive_c/windows/syswow64", - prefix=self.prefix_dir, track_file=tracked_files, link_debug=True) - if use_wined3d: dxvkfiles = [] vkd3d_protonfiles = [] @@ -1439,7 +1438,7 @@ class Session: prepend_to_env_str(self.env, ld_path_var, g_proton.lib_dir + "x86_64-linux-gnu:" + g_proton.lib_dir + "i386-linux-gnu", ":") - self.env["WINEDLLPATH"] = g_proton.lib_dir + "wine" + self.env["WINEDLLPATH"] = ':'.join([g_proton.lib_dir + "vkd3d", g_proton.lib_dir + "wine"]) self.env["GST_PLUGIN_SYSTEM_PATH_1_0"] = g_proton.lib_dir + "x86_64-linux-gnu/gstreamer-1.0" + ":" + g_proton.lib_dir + "i386-linux-gnu/gstreamer-1.0" self.env["WINE_GST_REGISTRY_DIR"] = g_compatdata.path("gstreamer-1.0/")