From 3d5022de711a6a7636707043a0bf9fc34d1faee5 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 28 May 2021 12:04:30 +0200 Subject: [PATCH] Don't ship proton dist files in a tarball anymore --- Makefile | 29 ++++++++++++++-------------- Makefile.in | 11 +++-------- proton | 47 +++++++++++++++------------------------------ symstore/symstore.c | 2 +- 4 files changed, 34 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index 9f9812b9..30289bca 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,7 @@ proton: configure echo "Proton built locally. Use 'install', 'deploy' or 'redist' targets." install: configure + rm -rf $(STEAM_DIR)/compatibilitytools.d/$(_build_name)/files/ #remove proton's internal files, but preserve user_settings etc from top-level $(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) install echo "Proton installed to your local Steam installation" @@ -169,8 +170,8 @@ any $(CONTAINERGOALS): configure dxvk: | $(BUILD_ROOT)/dxvk/lib/wine/dxvk dxvk: | $(BUILD_ROOT)/dxvk/lib64/wine/dxvk dxvk: any - cp -f $(BUILD_DIR)/dist/dist/lib/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib/wine/dxvk/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib64/wine/dxvk/ + cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib/wine/dxvk/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib64/wine/dxvk/ dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib/wine/nvapi dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib64/wine/nvapi @@ -181,34 +182,34 @@ dxvk-nvapi: any vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton vkd3d-proton: any - cp -f $(BUILD_DIR)/dist/dist/lib/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton/ + cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton/ lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix lsteamclient: any - cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix/ + cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows/ && \ + cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix/ vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-windows vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-unix vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix vrclient: any - cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-windows/vrclient.dll $(BUILD_ROOT)/vrclient/lib/wine/i386-windows/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-unix/vrclient.dll.so $(BUILD_ROOT)/vrclient/lib/wine/i386-unix/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/vrclient_x64.dll $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/vrclient_x64.dll.so $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix/ + cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/vrclient.dll $(BUILD_ROOT)/vrclient/lib/wine/i386-windows/ && \ + cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/vrclient.dll.so $(BUILD_ROOT)/vrclient/lib/wine/i386-unix/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/vrclient_x64.dll $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/vrclient_x64.dll.so $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix/ wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix wineopenxr: any - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/wineopenxr.dll $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows/ && \ - cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/wineopenxr.dll.so $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix/ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/wineopenxr.dll $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows/ && \ + cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/wineopenxr.dll.so $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix/ battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-windows battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-unix diff --git a/Makefile.in b/Makefile.in index 18db8f82..c58d936f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,7 +31,7 @@ ifeq ($(SRCDIR),) endif DST_BASE := $(OBJ)/dist -DST_DIR := $(DST_BASE)/dist +DST_DIR := $(DST_BASE)/files DST_LIBDIR32 := $(DST_DIR)/lib DST_LIBDIR64 := $(DST_DIR)/lib64 DIST_PREFIX := $(DST_DIR)/share/default_pfx/ @@ -1087,9 +1087,7 @@ all-dist: .PHONY: deploy deploy: all mkdir -p $(DEPLOY_DIR) && \ - rsync --delete --exclude dist --exclude compatibilitytool.vdf -arx $(DST_BASE)/ $(DEPLOY_DIR) - tar -C $(DST_DIR) -c . > $(DEPLOY_DIR)/proton_dist.tar - @echo "Created deployment archive at "$(DEPLOY_DIR)"/proton_dist.tar" + rsync --delete --exclude compatibilitytool.vdf -arx $(DST_BASE)/ $(DEPLOY_DIR) ## @@ -1099,9 +1097,7 @@ deploy: all .PHONY: redist redist: all mkdir -p $(REDIST_DIR) - rsync --delete --exclude dist -arx $(DST_BASE)/ $(REDIST_DIR) - tar -C $(DST_DIR) -c . | gzip -c -1 > $(REDIST_DIR)/proton_dist.tar.gz - @echo "Created redistribution tarball at "$(REDIST_DIR)"/proton_dist.tar.gz" + rsync --delete -arx $(DST_BASE)/ $(REDIST_DIR) ## @@ -1169,7 +1165,6 @@ install: all if [ ! -d $(STEAM_DIR) ]; then echo >&2 "!! "$(STEAM_DIR)" does not exist, cannot install"; return 1; fi mkdir -p $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME) rsync --delete -arx $(DST_BASE)/* $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME) - cp -f $(DIST_VERSION) $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)/dist/ @echo "Installed Proton to "$(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME) @echo "You may need to restart Steam to select this tool" diff --git a/proton b/proton index 9f906fee..616c41b0 100755 --- a/proton +++ b/proton @@ -410,15 +410,15 @@ def set_dir_casefold_bit(dir_path): class Proton: def __init__(self, base_dir): self.base_dir = base_dir + "/" - self.dist_dir = self.path("dist/") - self.bin_dir = self.path("dist/bin/") - self.lib_dir = self.path("dist/lib/") - self.lib64_dir = self.path("dist/lib64/") - self.fonts_dir = self.path("dist/share/fonts/") - self.wine_fonts_dir = self.path("dist/share/wine/fonts/") - self.wine_inf = self.path("dist/share/wine/wine.inf") + self.dist_dir = self.path("files/") + self.bin_dir = self.path("files/bin/") + self.lib_dir = self.path("files/lib/") + self.lib64_dir = self.path("files/lib64/") + self.fonts_dir = self.path("files/share/fonts/") + self.wine_fonts_dir = self.path("files/share/wine/fonts/") + self.wine_inf = self.path("files/share/wine/wine.inf") self.version_file = self.path("version") - self.default_pfx_dir = self.path("dist/share/default_pfx/") + self.default_pfx_dir = self.path("files/share/default_pfx/") self.user_settings_file = self.path("user_settings.py") self.wine_bin = self.bin_dir + "wine" self.wine64_bin = self.bin_dir + "wine64" @@ -428,28 +428,12 @@ class Proton: def path(self, d): return self.base_dir + d - def need_tarball_extraction(self): - '''Checks if the proton_dist tarball archive must be extracted. Returns true if extraction is needed, false otherwise''' - return not file_exists(self.dist_dir, follow_symlinks=True) or \ - not file_exists(self.path("dist/version"), follow_symlinks=True) or \ - not filecmp.cmp(self.version_file, self.path("dist/version")) - - def extract_tarball(self): - with self.dist_lock: - if self.need_tarball_extraction(): - if file_exists(self.dist_dir, follow_symlinks=True): - shutil.rmtree(self.dist_dir) - tar = None - for sf in ["", ".xz", ".bz2", ".gz"]: - if file_exists(self.path("proton_dist.tar" + sf), follow_symlinks=True): - tar = tarfile.open(self.path("proton_dist.tar" + sf), mode="r:*") - break - if not tar: - log("No proton_dist tarball??") - sys.exit(1) - tar.extractall(path=self.dist_dir) - tar.close() - try_copy(self.version_file, self.dist_dir) + def cleanup_legacy_dist(self): + old_dist_dir = self.path("dist/") + if file_exists(old_dist_dir, follow_symlinks=True): + with self.dist_lock: + if file_exists(old_dist_dir, follow_symlinks=True): + shutil.rmtree(old_dist_dir) def missing_default_prefix(self): '''Check if the default prefix dir is missing. Returns true if missing, false if present''' @@ -1563,8 +1547,7 @@ if __name__ == "__main__": g_proton = Proton(os.path.dirname(sys.argv[0])) - if g_proton.need_tarball_extraction(): - g_proton.extract_tarball() + g_proton.cleanup_legacy_dist() g_compatdata = CompatData(os.environ["STEAM_COMPAT_DATA_PATH"]) diff --git a/symstore/symstore.c b/symstore/symstore.c index 98dae86e..91347ae8 100644 --- a/symstore/symstore.c +++ b/symstore/symstore.c @@ -158,7 +158,7 @@ static BOOL validate_proton_dist(const char* src) snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "version"); allgood = stat(buffer, &st) == 0 && (st.st_mode & S_IFMT) == S_IFREG; - snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "dist"); + snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "files"); allgood = allgood && stat(buffer, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR; return allgood;