build: Add disable_vagrant variable to build on the host.

This commit is contained in:
Rémi Bernon 2021-04-02 13:03:49 +02:00 committed by Andrew Eikum
parent 69ab8e9693
commit 4c6687efeb
2 changed files with 39 additions and 20 deletions

View File

@ -70,6 +70,7 @@ help:
@echo " Current build name: $(_build_name)" @echo " Current build name: $(_build_name)"
@echo " unstripped - Set to non-empty to avoid stripping installed library files." @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 " 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 " protonsdk_version - Version of the proton sdk image to use for building,"
@echo " use protonsdk_version=local to build it locally." @echo " use protonsdk_version=local to build it locally."
@echo "" @echo ""
@ -99,12 +100,21 @@ help:
@echo "" @echo ""
@echo "Running out of disk space in the VM? See resize-vagrant-disk.sh" @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_SHELL := vagrant ssh
VAGRANT_DIR := /vagrant
endif
vagrant: private SHELL := $(SHELL) vagrant: private SHELL := $(SHELL)
vagrant: vagrant:
ifneq ($(disable_vagrant),1)
vagrant up vagrant up
vagrant rsync debian10 vagrant rsync debian10
endif
clean: private SHELL := $(VAGRANT_SHELL) clean: private SHELL := $(VAGRANT_SHELL)
clean: vagrant clean: vagrant
@ -127,36 +137,43 @@ endif
downloads: private SHELL := $(VAGRANT_SHELL) downloads: private SHELL := $(VAGRANT_SHELL)
downloads: configure downloads: configure
ifneq ($(disable_vagrant),1)
make -C $(BUILD_DIR) downloads make -C $(BUILD_DIR) downloads
endif
proton: private SHELL := $(VAGRANT_SHELL) proton: private SHELL := $(VAGRANT_SHELL)
proton: downloads proton: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \ make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist && \
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build." 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: | vagrant_share/compatibilitytools.d/$(_build_name)
install-internal: private SHELL := $(VAGRANT_SHELL) install-internal: private SHELL := $(VAGRANT_SHELL)
install-internal: downloads 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 install: install-internal
ifneq ($(disable_vagrant),1)
mkdir -p $(STEAM_DIR)/compatibilitytools.d/ 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 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/ 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" echo "Proton installed to your local Steam installation"
redist: | vagrant_share/$(DEPLOY_DIR) redist: | vagrant_share/$(DEPLOY_DIR)
redist: private SHELL := $(VAGRANT_SHELL) redist: private SHELL := $(VAGRANT_SHELL)
redist: downloads redist: downloads
rm -rf /vagrant/$(DEPLOY_DIR)/* && \ rm -rf $(VAGRANT_DIR)/$(DEPLOY_DIR)/* && \
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) redist && cp -Rf $(BUILD_DIR)/redist/* /vagrant/$(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)" echo "Proton build available at vagrant_share/$(DEPLOY_DIR)"
deploy: | vagrant_share/$(DEPLOY_DIR)-deploy deploy: | vagrant_share/$(DEPLOY_DIR)-deploy
deploy: private SHELL := $(VAGRANT_SHELL) deploy: private SHELL := $(VAGRANT_SHELL)
deploy: downloads deploy: downloads
rm -rf /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/$(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" echo "Proton deployed to vagrant_share/$(DEPLOY_DIR)-deploy"
module: | vagrant_share/$(module)/lib/wine/ module: | vagrant_share/$(module)/lib/wine/
@ -164,50 +181,50 @@ module: | vagrant_share/$(module)/lib64/wine/
module: private SHELL := $(VAGRANT_SHELL) module: private SHELL := $(VAGRANT_SHELL)
module: downloads module: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) module=$(module) module && \ 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-wine32/dlls/$(module)/$(module)$(MODULE_SFX)* $(VAGRANT_DIR)/$(module)/lib/wine/ && \
cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module)$(MODULE_SFX)* /vagrant/$(module)/lib64/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/$(module)/lib/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/$(module)/lib64/wine/ && \ cp -f $(BUILD_DIR)/obj-wine64/dlls/$(module)/$(module).so $(VAGRANT_DIR)/$(module)/lib64/wine/ && \
rm -f /vagrant/$(module)/lib*/wine/*.fake rm -f $(VAGRANT_DIR)/$(module)/lib*/wine/*.fake
dxvk: | vagrant_share/dxvk/lib/wine/dxvk dxvk: | vagrant_share/dxvk/lib/wine/dxvk
dxvk: | vagrant_share/dxvk/lib64/wine/dxvk dxvk: | vagrant_share/dxvk/lib64/wine/dxvk
dxvk: private SHELL := $(VAGRANT_SHELL) dxvk: private SHELL := $(VAGRANT_SHELL)
dxvk: downloads dxvk: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dxvk && \ 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/lib/wine/dxvk/*.dll $(VAGRANT_DIR)/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/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/lib/wine/vkd3d-proton
vkd3d-proton: | vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton vkd3d-proton: | vagrant_share/vkd3d-proton/lib64/wine/vkd3d-proton
vkd3d-proton: private SHELL := $(VAGRANT_SHELL) vkd3d-proton: private SHELL := $(VAGRANT_SHELL)
vkd3d-proton: downloads vkd3d-proton: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vkd3d-proton && \ 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/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/vkd3d-proton/lib64/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/lib/wine
lsteamclient: | vagrant_share/lsteamclient/lib64/wine lsteamclient: | vagrant_share/lsteamclient/lib64/wine
lsteamclient: private SHELL := $(VAGRANT_SHELL) lsteamclient: private SHELL := $(VAGRANT_SHELL)
lsteamclient: downloads lsteamclient: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) lsteamclient && \ 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/lib/wine/lsteamclient.dll.so $(VAGRANT_DIR)/lsteamclient/lib/wine && \
cp -f $(BUILD_DIR)/dist/files/lib64/wine/lsteamclient.dll.so /vagrant/lsteamclient/lib64/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/lib/wine
vrclient: | vagrant_share/vrclient/lib64/wine vrclient: | vagrant_share/vrclient/lib64/wine
vrclient: private SHELL := $(VAGRANT_SHELL) vrclient: private SHELL := $(VAGRANT_SHELL)
vrclient: downloads vrclient: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) vrclient && \ 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/lib/wine/vrclient.dll.so $(VAGRANT_DIR)/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/lib64/wine/vrclient_x64.dll.so $(VAGRANT_DIR)/vrclient/lib64/wine
wineopenxr: | vagrant_share/wineopenxr/lib/wine wineopenxr: | vagrant_share/wineopenxr/lib/wine
wineopenxr: | vagrant_share/wineopenxr/lib64/wine wineopenxr: | vagrant_share/wineopenxr/lib64/wine
wineopenxr: private SHELL := $(VAGRANT_SHELL) wineopenxr: private SHELL := $(VAGRANT_SHELL)
wineopenxr: downloads wineopenxr: downloads
make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) wineopenxr && \ 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/%: vagrant_share/%:
mkdir -p $@ 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 describe how we create the build environment for the production builds of
Proton. For reproducibility and security reasons, we will be setting up a Proton. For reproducibility and security reasons, we will be setting up a
Debian virtual machine. However, you should be able to follow these 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 Proton provides a Vagrantfile, which will automatically set up the Debian VM
for you. After installing [Vagrant](https://www.vagrantup.com/), initialize the for you. After installing [Vagrant](https://www.vagrantup.com/), initialize the