Skip to content

Commit 3d5022d

Browse files
aeikumivyl
authored andcommitted
Don't ship proton dist files in a tarball anymore
1 parent ab1db89 commit 3d5022d

File tree

4 files changed

+34
-55
lines changed

4 files changed

+34
-55
lines changed

Makefile

+15-14
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ proton: configure
129129
echo "Proton built locally. Use 'install', 'deploy' or 'redist' targets."
130130

131131
install: configure
132+
rm -rf $(STEAM_DIR)/compatibilitytools.d/$(_build_name)/files/ #remove proton's internal files, but preserve user_settings etc from top-level
132133
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) install
133134
echo "Proton installed to your local Steam installation"
134135

@@ -169,8 +170,8 @@ any $(CONTAINERGOALS): configure
169170
dxvk: | $(BUILD_ROOT)/dxvk/lib/wine/dxvk
170171
dxvk: | $(BUILD_ROOT)/dxvk/lib64/wine/dxvk
171172
dxvk: any
172-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib/wine/dxvk/ && \
173-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib64/wine/dxvk/
173+
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib/wine/dxvk/ && \
174+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll $(BUILD_ROOT)/dxvk/lib64/wine/dxvk/
174175

175176
dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib/wine/nvapi
176177
dxvk-nvapi: | $(BUILD_ROOT)/dxvk-nvapi/lib64/wine/nvapi
@@ -181,34 +182,34 @@ dxvk-nvapi: any
181182
vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton
182183
vkd3d-proton: | $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton
183184
vkd3d-proton: any
184-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton/ && \
185-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton/
185+
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib/wine/vkd3d-proton/ && \
186+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll $(BUILD_ROOT)/vkd3d-proton/lib64/wine/vkd3d-proton/
186187

187188
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows
188189
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix
189190
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows
190191
lsteamclient: | $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix
191192
lsteamclient: any
192-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows/ && \
193-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix/ && \
194-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows/ && \
195-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix/
193+
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib/wine/i386-windows/ && \
194+
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib/wine/i386-unix/ && \
195+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/lsteamclient.dll $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-windows/ && \
196+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/lsteamclient.dll.so $(BUILD_ROOT)/lsteamclient/lib64/wine/x86_64-unix/
196197

197198
vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-windows
198199
vrclient: | $(BUILD_ROOT)/vrclient/lib/wine/i386-unix
199200
vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows
200201
vrclient: | $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix
201202
vrclient: any
202-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-windows/vrclient.dll $(BUILD_ROOT)/vrclient/lib/wine/i386-windows/ && \
203-
cp -f $(BUILD_DIR)/dist/dist/lib/wine/i386-unix/vrclient.dll.so $(BUILD_ROOT)/vrclient/lib/wine/i386-unix/ && \
204-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/vrclient_x64.dll $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows/ && \
205-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/vrclient_x64.dll.so $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix/
203+
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-windows/vrclient.dll $(BUILD_ROOT)/vrclient/lib/wine/i386-windows/ && \
204+
cp -f $(BUILD_DIR)/dist/files/lib/wine/i386-unix/vrclient.dll.so $(BUILD_ROOT)/vrclient/lib/wine/i386-unix/ && \
205+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/vrclient_x64.dll $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-windows/ && \
206+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/vrclient_x64.dll.so $(BUILD_ROOT)/vrclient/lib64/wine/x86_64-unix/
206207

207208
wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows
208209
wineopenxr: | $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix
209210
wineopenxr: any
210-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-windows/wineopenxr.dll $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows/ && \
211-
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/x86_64-unix/wineopenxr.dll.so $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix/
211+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-windows/wineopenxr.dll $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-windows/ && \
212+
cp -f $(BUILD_DIR)/dist/files/lib64/wine/x86_64-unix/wineopenxr.dll.so $(BUILD_ROOT)/wineopenxr/lib64/wine/x86_64-unix/
212213

213214
battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-windows
214215
battleye: | $(BUILD_ROOT)/battleye/v1/lib/wine/i386-unix

Makefile.in

+3-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ifeq ($(SRCDIR),)
3131
endif
3232

3333
DST_BASE := $(OBJ)/dist
34-
DST_DIR := $(DST_BASE)/dist
34+
DST_DIR := $(DST_BASE)/files
3535
DST_LIBDIR32 := $(DST_DIR)/lib
3636
DST_LIBDIR64 := $(DST_DIR)/lib64
3737
DIST_PREFIX := $(DST_DIR)/share/default_pfx/
@@ -1087,9 +1087,7 @@ all-dist:
10871087
.PHONY: deploy
10881088
deploy: all
10891089
mkdir -p $(DEPLOY_DIR) && \
1090-
rsync --delete --exclude dist --exclude compatibilitytool.vdf -arx $(DST_BASE)/ $(DEPLOY_DIR)
1091-
tar -C $(DST_DIR) -c . > $(DEPLOY_DIR)/proton_dist.tar
1092-
@echo "Created deployment archive at "$(DEPLOY_DIR)"/proton_dist.tar"
1090+
rsync --delete --exclude compatibilitytool.vdf -arx $(DST_BASE)/ $(DEPLOY_DIR)
10931091

10941092

10951093
##
@@ -1099,9 +1097,7 @@ deploy: all
10991097
.PHONY: redist
11001098
redist: all
11011099
mkdir -p $(REDIST_DIR)
1102-
rsync --delete --exclude dist -arx $(DST_BASE)/ $(REDIST_DIR)
1103-
tar -C $(DST_DIR) -c . | gzip -c -1 > $(REDIST_DIR)/proton_dist.tar.gz
1104-
@echo "Created redistribution tarball at "$(REDIST_DIR)"/proton_dist.tar.gz"
1100+
rsync --delete -arx $(DST_BASE)/ $(REDIST_DIR)
11051101

11061102

11071103
##
@@ -1169,7 +1165,6 @@ install: all
11691165
if [ ! -d $(STEAM_DIR) ]; then echo >&2 "!! "$(STEAM_DIR)" does not exist, cannot install"; return 1; fi
11701166
mkdir -p $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
11711167
rsync --delete -arx $(DST_BASE)/* $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
1172-
cp -f $(DIST_VERSION) $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)/dist/
11731168
@echo "Installed Proton to "$(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
11741169
@echo "You may need to restart Steam to select this tool"
11751170

proton

+15-32
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,15 @@ def set_dir_casefold_bit(dir_path):
410410
class Proton:
411411
def __init__(self, base_dir):
412412
self.base_dir = base_dir + "/"
413-
self.dist_dir = self.path("dist/")
414-
self.bin_dir = self.path("dist/bin/")
415-
self.lib_dir = self.path("dist/lib/")
416-
self.lib64_dir = self.path("dist/lib64/")
417-
self.fonts_dir = self.path("dist/share/fonts/")
418-
self.wine_fonts_dir = self.path("dist/share/wine/fonts/")
419-
self.wine_inf = self.path("dist/share/wine/wine.inf")
413+
self.dist_dir = self.path("files/")
414+
self.bin_dir = self.path("files/bin/")
415+
self.lib_dir = self.path("files/lib/")
416+
self.lib64_dir = self.path("files/lib64/")
417+
self.fonts_dir = self.path("files/share/fonts/")
418+
self.wine_fonts_dir = self.path("files/share/wine/fonts/")
419+
self.wine_inf = self.path("files/share/wine/wine.inf")
420420
self.version_file = self.path("version")
421-
self.default_pfx_dir = self.path("dist/share/default_pfx/")
421+
self.default_pfx_dir = self.path("files/share/default_pfx/")
422422
self.user_settings_file = self.path("user_settings.py")
423423
self.wine_bin = self.bin_dir + "wine"
424424
self.wine64_bin = self.bin_dir + "wine64"
@@ -428,28 +428,12 @@ class Proton:
428428
def path(self, d):
429429
return self.base_dir + d
430430

431-
def need_tarball_extraction(self):
432-
'''Checks if the proton_dist tarball archive must be extracted. Returns true if extraction is needed, false otherwise'''
433-
return not file_exists(self.dist_dir, follow_symlinks=True) or \
434-
not file_exists(self.path("dist/version"), follow_symlinks=True) or \
435-
not filecmp.cmp(self.version_file, self.path("dist/version"))
436-
437-
def extract_tarball(self):
438-
with self.dist_lock:
439-
if self.need_tarball_extraction():
440-
if file_exists(self.dist_dir, follow_symlinks=True):
441-
shutil.rmtree(self.dist_dir)
442-
tar = None
443-
for sf in ["", ".xz", ".bz2", ".gz"]:
444-
if file_exists(self.path("proton_dist.tar" + sf), follow_symlinks=True):
445-
tar = tarfile.open(self.path("proton_dist.tar" + sf), mode="r:*")
446-
break
447-
if not tar:
448-
log("No proton_dist tarball??")
449-
sys.exit(1)
450-
tar.extractall(path=self.dist_dir)
451-
tar.close()
452-
try_copy(self.version_file, self.dist_dir)
431+
def cleanup_legacy_dist(self):
432+
old_dist_dir = self.path("dist/")
433+
if file_exists(old_dist_dir, follow_symlinks=True):
434+
with self.dist_lock:
435+
if file_exists(old_dist_dir, follow_symlinks=True):
436+
shutil.rmtree(old_dist_dir)
453437

454438
def missing_default_prefix(self):
455439
'''Check if the default prefix dir is missing. Returns true if missing, false if present'''
@@ -1563,8 +1547,7 @@ if __name__ == "__main__":
15631547

15641548
g_proton = Proton(os.path.dirname(sys.argv[0]))
15651549

1566-
if g_proton.need_tarball_extraction():
1567-
g_proton.extract_tarball()
1550+
g_proton.cleanup_legacy_dist()
15681551

15691552
g_compatdata = CompatData(os.environ["STEAM_COMPAT_DATA_PATH"])
15701553

symstore/symstore.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static BOOL validate_proton_dist(const char* src)
158158
snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "version");
159159
allgood = stat(buffer, &st) == 0 && (st.st_mode & S_IFMT) == S_IFREG;
160160

161-
snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "dist");
161+
snprintf(buffer, ARRAYSIZE(buffer), "%s/%s", src, "files");
162162
allgood = allgood && stat(buffer, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR;
163163

164164
return allgood;

0 commit comments

Comments
 (0)