diff --git a/Makefile b/Makefile index 44ff1a2e..d0d32838 100644 --- a/Makefile +++ b/Makefile @@ -70,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 "" @@ -99,12 +100,21 @@ 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 @@ -127,36 +137,43 @@ endif downloads: private SHELL := $(VAGRANT_SHELL) downloads: configure +ifneq ($(disable_vagrant),1) make -C $(BUILD_DIR) downloads +endif proton: private SHELL := $(VAGRANT_SHELL) proton: downloads make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \ echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build." +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 -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) STEAM_DIR=/vagrant/ install + make -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: | vagrant_share/$(DEPLOY_DIR) redist: private SHELL := $(VAGRANT_SHELL) redist: downloads - rm -rf /vagrant/$(DEPLOY_DIR)/* && \ - make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp -Rf $(BUILD_DIR)/redist/* /vagrant/$(DEPLOY_DIR) && \ + rm -rf $(VAGRANT_DIR)/$(DEPLOY_DIR)/* && \ + make -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: | vagrant_share/$(DEPLOY_DIR)-deploy deploy: private SHELL := $(VAGRANT_SHELL) deploy: downloads - rm -rf /vagrant/$(DEPLOY_DIR)-deploy/* && \ - make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) deploy && cp -Rf $(BUILD_DIR)/deploy/* /vagrant/$(DEPLOY_DIR)-deploy && \ + rm -rf $(VAGRANT_DIR)/$(DEPLOY_DIR)-deploy/* && \ + make -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: | vagrant_share/$(module)/lib/wine/ @@ -164,50 +181,50 @@ module: | vagrant_share/$(module)/lib64/wine/ module: private SHELL := $(VAGRANT_SHELL) module: downloads 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/ && \ - 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/ && \ - rm -f /vagrant/$(module)/lib*/wine/*.fake + 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: | vagrant_share/dxvk/lib/wine/dxvk dxvk: | vagrant_share/dxvk/lib64/wine/dxvk dxvk: private SHELL := $(VAGRANT_SHELL) dxvk: downloads make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \ - cp -f $(BUILD_DIR)/dist/files/lib/wine/dxvk/*.dll /vagrant/dxvk/lib/wine/dxvk/ && \ - cp -f $(BUILD_DIR)/dist/files/lib64/wine/dxvk/*.dll /vagrant/dxvk/lib64/wine/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: | 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 -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \ - cp -f $(BUILD_DIR)/dist/files/lib/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib/wine/vkd3d-proton/ && \ - cp -f $(BUILD_DIR)/dist/files/lib64/wine/vkd3d-proton/*.dll /vagrant/vkd3d-proton/lib64/wine/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: | vagrant_share/lsteamclient/lib/wine lsteamclient: | vagrant_share/lsteamclient/lib64/wine lsteamclient: private SHELL := $(VAGRANT_SHELL) lsteamclient: downloads make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \ - cp -f $(BUILD_DIR)/dist/files/lib/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib/wine && \ - cp -f $(BUILD_DIR)/dist/files/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/wine + 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: | vagrant_share/vrclient/lib/wine vrclient: | vagrant_share/vrclient/lib64/wine vrclient: private SHELL := $(VAGRANT_SHELL) vrclient: downloads make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \ - cp -f $(BUILD_DIR)/dist/files/lib/wine/vrclient.dll.so /vagrant/vrclient/lib/wine && \ - cp -f $(BUILD_DIR)/dist/files/lib64/wine/vrclient_x64.dll.so /vagrant/vrclient/lib64/wine + 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: | vagrant_share/wineopenxr/lib/wine wineopenxr: | vagrant_share/wineopenxr/lib64/wine wineopenxr: private SHELL := $(VAGRANT_SHELL) wineopenxr: downloads make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \ - cp -f $(BUILD_DIR)/dist/files/lib64/wine/wineopenxr.dll.so /vagrant/wineopenxr/lib64/wine + cp -f $(BUILD_DIR)/dist/files/lib64/wine/wineopenxr.dll.so $(VAGRANT_DIR)/wineopenxr/lib64/wine vagrant_share/%: mkdir -p $@ diff --git a/README.md b/README.md index 2774dc14..502d3894 100644 --- a/README.md +++ b/README.md @@ -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