Compare commits

...

15 Commits

Author SHA1 Message Date
Andrew Eikum
de31ece2f8 update wine 2021-04-07 11:52:54 -05:00
Rémi Bernon
7249a0ddf1 build: Pass -j flags and overrides to sub-make inside Vagrant. 2021-04-07 11:52:54 -05:00
Rémi Bernon
8e66b8c636 build: Pass -j flags to ninja build steps too. 2021-04-07 11:52:54 -05:00
Rémi Bernon
4c6687efeb build: Add disable_vagrant variable to build on the host. 2021-04-07 11:52:54 -05:00
Rémi Bernon
69ab8e9693 build: Use a separate rule for downloads. 2021-04-07 11:50:04 -05:00
Rémi Bernon
cb323a6820 build: Use SHELL variable to execute commands in Vagrant. 2021-04-07 11:50:04 -05:00
Rémi Bernon
fd01826ab7 build: Split non-vagrant commands from install rule. 2021-04-07 11:50:04 -05:00
Rémi Bernon
76cce1e947 build: Use a rule to create the vagrant_share/* directories. 2021-04-07 11:50:04 -05:00
Rémi Bernon
309a17c3b9 build: Pass make flags and parallel flags to module rule. 2021-04-07 11:50:04 -05:00
Rémi Bernon
8ec7071225 build: Make sure that module target triggers wine-configure. 2021-04-07 11:50:04 -05:00
Rémi Bernon
978a2d95b2 build: Add specified modules to the container build list.
And not only when ending with 32/64.
2021-04-07 11:50:04 -05:00
Rémi Bernon
4daa676d0f build: Remove duplicate BUILD_DIR variable. 2021-04-07 11:50:04 -05:00
Andrew Eikum
20a8e3dff7 Handle steampipe quirks in deploy builds 2021-04-07 11:50:04 -05:00
Andrew Eikum
87d9c65a5b Don't ship filenames with colons in them 2021-04-07 11:50:04 -05:00
Andrew Eikum
7a1714cab1 Don't ship proton dist files in a tarball anymore 2021-04-07 11:50:04 -05:00
9 changed files with 295 additions and 103 deletions

156
Makefile
View File

@ -13,8 +13,9 @@ endif
# remove special chars
override _build_name := $(shell echo $(_build_name) | tr -dc '[:alnum:] ._-')
# make doesn't handle spaces well... replace them with underscores in paths
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
STEAM_DIR := $(HOME)/.steam/root
BUILD_DIR := $(_build_name)
ifeq ($(build_name),)
DEPLOY_DIR := $(shell git describe --tags --always)
@ -45,8 +46,6 @@ CONFIGURE_CMD := ../proton/configure.sh \
--steam-runtime-image=registry.gitlab.steamos.cloud/proton/soldier/sdk:$(protonsdk_version) \
--build-name="$(_build_name)"
# make doesn't handle spaces well... replace them with underscores in paths
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
all: help
@ -71,6 +70,7 @@ help:
@echo " Current build name: $(_build_name)"
@echo " unstripped - Set to non-empty to avoid stripping installed library files."
@echo " enable_ccache - Enabled by default, set to 0 to disable ccache."
@echo " disable_vagrant - Set to 1 to disable vagrant and build directly on the host."
@echo " protonsdk_version - Version of the proton sdk image to use for building,"
@echo " use protonsdk_version=local to build it locally."
@echo ""
@ -100,83 +100,131 @@ help:
@echo ""
@echo "Running out of disk space in the VM? See resize-vagrant-disk.sh"
ifeq ($(disable_vagrant),1)
VAGRANT_SHELL := $(SHELL)
VAGRANT_DIR := vagrant_share
BUILD_DIR := ../$(BUILD_DIR)
else
VAGRANT_SHELL := vagrant ssh
VAGRANT_DIR := /vagrant
endif
vagrant: private SHELL := $(SHELL)
vagrant:
ifneq ($(disable_vagrant),1)
vagrant up
vagrant rsync debian10
endif
clean: private SHELL := $(VAGRANT_SHELL)
clean: vagrant
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
rm -rf $(BUILD_DIR)/
protonsdk: private SHELL := $(VAGRANT_SHELL)
protonsdk: vagrant
vagrant ssh -c 'make -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton'
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton
configure: private SHELL := $(VAGRANT_SHELL)
configure: vagrant
@vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads'
if [ ! -e $(BUILD_DIR)/Makefile ]; \
then mkdir -p $(BUILD_DIR); \
(cd $(BUILD_DIR) && $(CONFIGURE_CMD)); \
fi
ifeq ($(protonsdk_version),local)
configure: protonsdk
endif
proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist'
downloads: private SHELL := $(VAGRANT_SHELL)
downloads: configure
ifneq ($(disable_vagrant),1)
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR) downloads
endif
proton: private SHELL := $(VAGRANT_SHELL)
proton: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build."
install: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=/vagrant/ install'
ifneq ($(disable_vagrant),1)
install-internal: private STEAM_DIR := $(VAGRANT_DIR)/
endif
install-internal: | vagrant_share/compatibilitytools.d/$(_build_name)
install-internal: private SHELL := $(VAGRANT_SHELL)
install-internal: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=$(STEAM_DIR) install
install: install-internal
ifneq ($(disable_vagrant),1)
mkdir -p $(STEAM_DIR)/compatibilitytools.d/
rm -rf $(STEAM_DIR)/compatibilitytools.d/$(_build_name)/files/ #remove proton's internal files, but preserve user_settings etc from top-level
cp -Rf --no-dereference --preserve=mode,links vagrant_share/compatibilitytools.d/$(_build_name) $(STEAM_DIR)/compatibilitytools.d/
endif
echo "Proton installed to your local Steam installation"
redist: configure
mkdir -p vagrant_share/$(DEPLOY_DIR)
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR)'
redist: | vagrant_share/$(DEPLOY_DIR)
redist: private SHELL := $(VAGRANT_SHELL)
redist: downloads
rm -rf $(VAGRANT_DIR)/$(DEPLOY_DIR)/* && \
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp -Rf $(BUILD_DIR)/redist/* $(VAGRANT_DIR)/$(DEPLOY_DIR) && \
echo "Proton build available at vagrant_share/$(DEPLOY_DIR)"
deploy: configure
mkdir -p vagrant_share/$(DEPLOY_DIR)-deploy
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && cp $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy'
deploy: | vagrant_share/$(DEPLOY_DIR)-deploy
deploy: private SHELL := $(VAGRANT_SHELL)
deploy: downloads
rm -rf $(VAGRANT_DIR)/$(DEPLOY_DIR)-deploy/* && \
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && cp -Rf $(BUILD_DIR)/deploy/* $(VAGRANT_DIR)/$(DEPLOY_DIR)-deploy && \
echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)-deploy"
module: configure
mkdir -p vagrant_share/$(module)/lib/wine/ vagrant_share/$(module)/lib64/wine/
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/wine/ && \
if [ -e $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so ]; then \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module).so /vagrant/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so /vagrant/$(module)/lib64/wine/; \
fi'
rm -f vagrant_share/$(module)/lib*/wine/*.fake
module: | vagrant_share/$(module)/lib/wine/
module: | vagrant_share/$(module)/lib64/wine/
module: private SHELL := $(VAGRANT_SHELL)
module: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* $(VAGRANT_DIR)/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* $(VAGRANT_DIR)/$(module)/lib64/wine/ && \
cp -f $(BUILD_DIR)/obj-wine32/dlls/$(module)/$(module).so $(VAGRANT_DIR)/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so $(VAGRANT_DIR)/$(module)/lib64/wine/ && \
rm -f $(VAGRANT_DIR)/$(module)/lib*/wine/*.fake
dxvk: configure
mkdir -p vagrant_share/dxvk/lib/wine/dxvk/
mkdir -p vagrant_share/dxvk/lib64/wine/dxvk/
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/dxvk/'
dxvk: | vagrant_share/dxvk/lib/wine/dxvk
dxvk: | vagrant_share/dxvk/lib64/wine/dxvk
dxvk: private SHELL := $(VAGRANT_SHELL)
dxvk: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \
cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll $(VAGRANT_DIR)/dxvk/lib/wine/dxvk/ && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll $(VAGRANT_DIR)/dxvk/lib64/wine/dxvk/
vkd3d-proton: configure
mkdir -p vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton/
mkdir -p vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton/
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/vkd3d-proton/'
vkd3d-proton: | vagrant_share/vkd3d-proton/lib/wine/vkd3d-proton
vkd3d-proton: | vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton
vkd3d-proton: private SHELL := $(VAGRANT_SHELL)
vkd3d-proton: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \
cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll $(VAGRANT_DIR)/vkd3d-proton/lib/wine/vkd3d-proton/ && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll $(VAGRANT_DIR)/vkd3d-proton/lib64/wine/vkd3d-proton/
lsteamclient: configure
mkdir -p vagrant_share/lsteamclient/lib/wine
mkdir -p vagrant_share/lsteamclient/lib64/wine
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine'
lsteamclient: | vagrant_share/lsteamclient/lib/wine
lsteamclient: | vagrant_share/lsteamclient/lib64/wine
lsteamclient: private SHELL := $(VAGRANT_SHELL)
lsteamclient: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \
cp -f $(BUILD_DIR)/dist/files/lib/wine/lsteamclient.dll.so $(VAGRANT_DIR)/lsteamclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/lsteamclient.dll.so $(VAGRANT_DIR)/lsteamclient/lib64/wine
vrclient: configure
mkdir -p vagrant_share/vrclient/lib/wine
mkdir -p vagrant_share/vrclient/lib64/wine
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \
cp -f $(BUILD_DIR)/dist/dist/lib/wine/vrclient.dll.so /vagrant/vrclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine'
vrclient: | vagrant_share/vrclient/lib/wine
vrclient: | vagrant_share/vrclient/lib64/wine
vrclient: private SHELL := $(VAGRANT_SHELL)
vrclient: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \
cp -f $(BUILD_DIR)/dist/files/lib/wine/vrclient.dll.so $(VAGRANT_DIR)/vrclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/vrclient_x64.dll.so $(VAGRANT_DIR)/vrclient/lib64/wine
wineopenxr: configure
mkdir -p vagrant_share/wineopenxr/lib64/wine
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \
cp -f $(BUILD_DIR)/dist/dist/lib64/wine/wineopenxr.dll.so /vagrant/wineopenxr/lib64/wine'
wineopenxr: | vagrant_share/wineopenxr/lib/wine
wineopenxr: | vagrant_share/wineopenxr/lib64/wine
wineopenxr: private SHELL := $(VAGRANT_SHELL)
wineopenxr: downloads
$(MAKE) $(MFLAGS) $(MAKEOVERRIDES) -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/wineopenxr.dll.so $(VAGRANT_DIR)/wineopenxr/lib64/wine
vagrant_share/%:
mkdir -p $@

View File

@ -125,7 +125,9 @@ Proton has a lot of build-time dependencies. The following instructions
describe how we create the build environment for the production builds of
Proton. For reproducibility and security reasons, we will be setting up a
Debian virtual machine. However, you should be able to follow these
instructions on other distributions as well.
instructions on other distributions as well. If you are building outside of the
default Vagrant VM, you may find the `disable_vagrant` variable in the
top-level Makefile helpful. See `make help`.
Proton provides a Vagrantfile, which will automatically set up the Debian VM
for you. After installing [Vagrant](https://www.vagrantup.com/), initialize the

View File

@ -73,6 +73,7 @@ endif
MAKECMDGOALS32 := $(filter-out all32,$(filter %32,$(MAKECMDGOALS)))
MAKECMDGOALS64 := $(filter-out all64,$(filter %64,$(MAKECMDGOALS)))
CONTAINERGOALS := $(MAKECMDGOALS32) $(MAKECMDGOALS64)
all: all32 all64
.PHONY: all
@ -87,7 +88,7 @@ ifeq ($(CONTAINER),)
J := $(shell nproc)
container-build: private SHELL := $(CONTAINER_SHELL)
container-build:
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) -f $(firstword $(MAKEFILE_LIST)) $(MFLAGS) $(MAKEOVERRIDES) CONTAINER=1 $(MAKECMDGOALS32) $(MAKECMDGOALS64)
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) -f $(firstword $(MAKEFILE_LIST)) $(MFLAGS) $(MAKEOVERRIDES) CONTAINER=1 $(CONTAINERGOALS)
.PHONY: container-build
all32 $(MAKECMDGOALS32): container-build
@ -113,7 +114,7 @@ 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
DEPLOY_DIR := ./deploy
@ -155,6 +156,7 @@ CARGO_BUILD_ARG := --release
COMPAT_MANIFEST_TEMPLATE := $(SRCDIR)/compatibilitytool.vdf.template
LICENSE := $(SRCDIR)/dist.LICENSE
OFL_LICENSE := $(SRCDIR)/fonts/liberation-fonts/LICENSE
STEAMPIPE_FIXUPS_PY := $(SRCDIR)/steampipe_fixups.py
GECKO_VER := 2.47.2
GECKO32_TARBALL := wine-gecko-$(GECKO_VER)-x86.tar.xz
@ -241,8 +243,9 @@ DIST_TARGETS := $(DIST_COPY_TARGETS) $(DIST_OVR32) $(DIST_OVR64) \
$(DIST_GECKO32) $(DIST_GECKO64) $(DIST_WINEMONO) \
$(DIST_COMPAT_MANIFEST) $(DIST_LICENSE) $(DIST_TOOLMANIFEST) $(DIST_OFL_LICENSE) $(DIST_FONTS)
DEPLOY_COPY_TARGETS := $(DIST_COPY_TARGETS) $(DIST_VERSION) $(DIST_LICENSE) $(DIST_TOOLMANIFEST) $(DIST_OFL_LICENSE)
REDIST_COPY_TARGETS := $(DEPLOY_COPY_TARGETS) $(DIST_COMPAT_MANIFEST)
BASE_COPY_TARGETS := $(DIST_COPY_TARGETS) $(DIST_VERSION) $(DIST_LICENSE) $(DIST_TOOLMANIFEST) $(DIST_OFL_LICENSE) $(DST_DIR)
DEPLOY_COPY_TARGETS := $(BASE_COPY_TARGETS) $(STEAMPIPE_FIXUPS_PY)
REDIST_COPY_TARGETS := $(BASE_COPY_TARGETS) $(DIST_COMPAT_MANIFEST)
$(DIST_LICENSE): $(LICENSE)
cp -a $< $@
@ -331,35 +334,35 @@ dist: $(DIST_TARGETS) all-dist dist_wineopenxr | $(DST_DIR)
echo `date '+%s'` `GIT_DIR=$(abspath $(SRCDIR)/.git) git describe --tags` > $(DIST_VERSION)
deploy: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
mkdir -p $(DEPLOY_DIR) && \
cp -a $(DEPLOY_COPY_TARGETS) $(DEPLOY_DIR) && \
tar -C $(DST_DIR) -c . > $(DEPLOY_DIR)/proton_dist.tar
@echo "Created deployment archive at "$(DEPLOY_DIR)"/proton_dist.tar"
mkdir -p $(DEPLOY_DIR)
cp -af --no-dereference --preserve=mode,links $(DEPLOY_COPY_TARGETS) $(DEPLOY_DIR)
python3 $(STEAMPIPE_FIXUPS_PY) process $(DEPLOY_DIR)
install: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
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)
cp -rf --no-dereference --preserve=mode,links $(DST_BASE)/* $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
cp -f $(DIST_VERSION) $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)/dist/
cp -af --no-dereference --preserve=mode,links $(DST_BASE)/* $(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
@echo "Installed Proton to "$(STEAM_DIR)/compatibilitytools.d/$(BUILD_NAME)
@echo "You may need to restart Steam to select this tool"
redist: dist | $(filter-out dist deploy install redist,$(MAKECMDGOALS))
mkdir -p $(REDIST_DIR)
cp -a $(REDIST_COPY_TARGETS) $(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"
cp -af --no-dereference --preserve=mode,links $(REDIST_COPY_TARGETS) $(REDIST_DIR)
.PHONY: module32 module64 module
module32: private SHELL := $(CONTAINER_SHELL)
module32: all-source
+$(MAKE) -C $(WINE_OBJ32)/dlls/$(module)
module32: CONTAINERGOALS := $(CONTAINERGOALS) wine-configure32
module32: | all-source wine-configure32
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ32)/dlls/$(module)
module64: private SHELL := $(CONTAINER_SHELL)
module64: all-source
+$(MAKE) -C $(WINE_OBJ64)/dlls/$(module)
module64: CONTAINERGOALS := $(CONTAINERGOALS) wine-configure64
module64: | all-source wine-configure64
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ64)/dlls/$(module)
module: CONTAINERGOALS := $(CONTAINERGOALS) wine-configure
module: | all-source wine-configure
module: module32 module64
endif # ifeq ($(CONTAINER),)

View File

@ -70,6 +70,14 @@ def setup_dll_symlinks(default_pfx_dir, dist_dir):
os.unlink(filename)
make_relative_symlink(target, filename)
#steampipe can't handle filenames with colons, so we remove them here
#and restore them in the proton script
def fixup_drive_links(default_pfx_dir):
for walk_dir, dirs, files in os.walk(os.path.join(default_pfx_dir, "dosdevices")):
for dir_ in dirs:
if ":" in dir_:
os.remove(os.path.join(walk_dir, dir_))
def make_default_pfx(default_pfx_dir, dist_dir, runtime):
local_env = dict(os.environ)
@ -93,6 +101,7 @@ def make_default_pfx(default_pfx_dir, dist_dir, runtime):
env=local_env, check=True)
setup_dll_symlinks(default_pfx_dir, dist_dir)
fixup_drive_links(default_pfx_dir)
if __name__ == '__main__':
import sys

View File

@ -98,6 +98,8 @@ all$(3) $(1): $(1)$(3)
all: $(1)
.PHONY: all
CONTAINERGOALS := $(CONTAINERGOALS) $(filter $(1),$(MAKECMDGOALS))
$(2)_ENV$(3) = \
CARGO_HOME=$$(OBJ)/.cargo \

View File

@ -31,7 +31,7 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/meson.build
$$(OBJ)/.$(1)-build$(3):
@echo ":: building $(3)bit $(1)..." >&2
env $$($(2)_ENV$(3)) \
ninja -C "$$($(2)_OBJ$(3))" install
ninja $$(filter -j%,$$(MAKEFLAGS)) -C "$$($(2)_OBJ$(3))" install
touch $$@
endif
endef

70
proton
View File

@ -149,13 +149,13 @@ 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.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.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.wineserver_bin = self.bin_dir + "wineserver"
@ -164,28 +164,34 @@ 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 os.path.exists(self.dist_dir) or \
not os.path.exists(self.path("dist/version")) or \
not filecmp.cmp(self.version_file, self.path("dist/version"))
def cleanup_legacy_dist(self):
old_dist_dir = self.path("dist/")
if os.path.exists(old_dist_dir):
with self.dist_lock:
if os.path.exists(old_dist_dir):
shutil.rmtree(old_dist_dir)
def extract_tarball(self):
with self.dist_lock:
if self.need_tarball_extraction():
if os.path.exists(self.dist_dir):
shutil.rmtree(self.dist_dir)
tar = None
for sf in ["", ".xz", ".bz2", ".gz"]:
if os.path.exists(self.path("proton_dist.tar" + sf)):
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 do_steampipe_fixups(self):
fixups_json = self.path("steampipe_fixups.json")
fixups_mtime = self.path("files/steampipe_fixups_mtime")
if os.path.exists(fixups_json):
with self.dist_lock:
import steampipe_fixups
current_fixup_mtime = None
if os.path.exists(fixups_mtime):
with open(fixups_mtime, "r") as f:
current_fixup_mtime = f.readline().strip()
new_fixup_mtime = getmtimestr(fixups_json)
if current_fixup_mtime != new_fixup_mtime:
result_code = steampipe_fixups.do_restore(self.base_dir, fixups_json)
if result_code == 0:
with open(fixups_mtime, "w") as f:
f.write(new_fixup_mtime + "\n")
def missing_default_prefix(self):
'''Check if the default prefix dir is missing. Returns true if missing, false if present'''
@ -421,6 +427,12 @@ class CompatData:
if not os.path.exists(self.prefix_dir + "/user.reg"):
self.copy_pfx()
if not os.path.lexists(self.prefix_dir + "/dosdevices/c:"):
os.symlink("../drive_c", self.prefix_dir + "/dosdevices/c:")
if not os.path.lexists(self.prefix_dir + "/dosdevices/z:"):
os.symlink("/", self.prefix_dir + "/dosdevices/z:")
# collect configuration info
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in os.environ:
#modern steam client sets this
@ -949,8 +961,8 @@ 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_proton.do_steampipe_fixups()
g_compatdata = CompatData(os.environ["STEAM_COMPAT_DATA_PATH"])

116
steampipe_fixups.py Executable file
View File

@ -0,0 +1,116 @@
#!/usr/bin/env python3
#Steampipe doesn't support certain unix-y things which may be required by
#native Linux applications. This file will process a directory of Linux files
#and store the file properties into a manifest file. After a round trip through
#Steampipe, the original file properties can be restored using this same
#script.
import json
import os
import secrets
import stat
DEFAULT_MANIFEST_NAME = "steampipe_fixups.json"
def usage():
print("Usage:")
print("\t" + sys.argv[0] + "\tprepare\t<path to directory to process>\t[manifest output file]")
print("\t\tProcess the given path and output the manifest file to the given path, or <path/" + DEFAULT_MANIFEST_NAME + "> if unspecified.")
print("")
print("\t" + sys.argv[0] + "\trestore\t<path to directory to process>\t[manifest file]")
print("\t\tRestore the given path using the manifest file, or <path/" + DEFAULT_MANIFEST_NAME + "> if unspecified.")
empty_dirs = []
no_write_paths = []
def canonicalize(path, prefix):
return path.replace(prefix, "", 1).lstrip('/')
def process_dir(path):
for root, subdirs, files in os.walk(path):
if len(subdirs) == 0 and len(files) == 0:
empty_dirs.append(canonicalize(root, path))
for file_ in files:
this_file = os.path.join(root, file_)
stat_result = os.lstat(this_file)
if (stat_result.st_mode & stat.S_IWUSR) == 0:
no_write_paths.append(canonicalize(this_file, path))
return 0
def write_manifest(manifest):
out = open(manifest, "w")
json.dump(
{
"id": str(secrets.randbits(32)), #we need steampipe to update this file for every build
"empty_dirs": empty_dirs,
"no_write_paths": no_write_paths,
},
out,
indent = 4,
sort_keys = True
)
return 0
def do_process(path, manifest):
if os.path.exists(manifest):
os.remove(manifest)
ret = process_dir(path)
if ret != 0:
return ret
#output should be deterministic
empty_dirs.sort()
no_write_paths.sort()
ret = write_manifest(manifest)
if ret != 0:
return ret
return 0
def do_restore(path, manifest):
loaded = json.load(open(manifest, "r"))
empty_dirs = loaded["empty_dirs"]
no_write_paths = loaded["no_write_paths"]
for empty_dir in empty_dirs:
try:
os.makedirs(os.path.join(path, empty_dir))
except OSError:
#already exists
pass
for file_ in no_write_paths:
this_file = os.path.join(path, file_)
stat_result = os.lstat(this_file)
os.chmod(this_file,
stat_result.st_mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH))
return 0
if __name__ == '__main__':
import sys
if len(sys.argv) < 3 or len(sys.argv) > 4:
usage()
sys.exit(1)
verb = sys.argv[1]
path = sys.argv[2]
if len(sys.argv) >= 4:
manifest = sys.argv[3]
else:
manifest = os.path.join(path, DEFAULT_MANIFEST_NAME)
if verb == "process":
sys.exit(do_process(path, manifest))
if verb == "restore":
sys.exit(do_restore(path, manifest))
usage()
sys.exit(1)

2
wine

@ -1 +1 @@
Subproject commit 3da025c3b623c415f61e3200c4ec77554e1ab7d7
Subproject commit babf9778e721fefe4c2b0da271186765a26d7ac3