2018-10-25 21:55:20 +03:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
# Vagrant file for setting up a build environment for Proton.
|
|
|
|
|
|
|
|
Vagrant.configure(2) do |config|
|
|
|
|
config.vm.box = "generic/debian9"
|
|
|
|
|
2018-11-02 20:36:24 +03:00
|
|
|
config.vm.provider "virtualbox" do |v|
|
|
|
|
v.cpus = `nproc`.to_i
|
|
|
|
# meminfo shows KB and we need to convert to MB
|
|
|
|
v.memory = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 2
|
|
|
|
end
|
2018-10-25 21:55:20 +03:00
|
|
|
|
2018-11-19 22:08:55 +03:00
|
|
|
#set up shared and rsynced folders
|
2018-11-05 18:55:16 +03:00
|
|
|
config.vm.synced_folder "./vagrant_share/", "/vagrant/", id: "share", create: true
|
2018-12-11 21:59:15 +03:00
|
|
|
config.vm.synced_folder ".", "/home/vagrant/proton", id: "proton", type: "rsync", rsync__exclude: ["/output/", "vagrant_share"], rsync__args: ["--verbose", "--archive", "-z", "--links", "--update"]
|
2018-10-25 21:55:20 +03:00
|
|
|
|
2018-12-05 20:21:36 +03:00
|
|
|
#this is where the VM is initialized on first setup
|
2018-10-25 21:55:20 +03:00
|
|
|
config.vm.provision "shell", privileged: "true", inline: <<-SHELL
|
2018-12-05 20:21:36 +03:00
|
|
|
#install docker and steam-runtime dependencies
|
2018-10-25 21:55:20 +03:00
|
|
|
dpkg --add-architecture i386
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
|
2018-11-19 22:08:55 +03:00
|
|
|
|
2018-10-25 21:55:20 +03:00
|
|
|
#add winehq repo
|
|
|
|
curl -fsSL https://dl.winehq.org/wine-builds/Release.key | apt-key add -
|
|
|
|
echo 'deb http://dl.winehq.org/wine-builds/debian stretch main' > /etc/apt/sources.list.d/winehq.list
|
2018-11-19 22:08:55 +03:00
|
|
|
|
2018-10-25 21:55:20 +03:00
|
|
|
#add docker repo
|
|
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
|
|
|
|
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable"
|
2018-11-19 22:08:55 +03:00
|
|
|
|
2018-12-05 20:21:36 +03:00
|
|
|
#add backports
|
|
|
|
echo 'deb http://ftp.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list
|
|
|
|
|
2018-11-19 22:08:55 +03:00
|
|
|
#install host build-time dependencies
|
2018-10-25 21:55:20 +03:00
|
|
|
apt-get update
|
2018-12-05 20:21:36 +03:00
|
|
|
apt-get install -y gpgv2 gnupg2 g++ g++-6-multilib mingw-w64 git docker-ce fontforge-nox
|
2018-10-25 21:55:20 +03:00
|
|
|
apt-get -y -t stretch-backports install meson
|
2018-11-19 22:08:55 +03:00
|
|
|
|
2018-12-05 20:21:36 +03:00
|
|
|
#winehq-devel is installed to pull in dependencies to run Wine
|
|
|
|
apt-get install -y --install-recommends winehq-devel
|
|
|
|
|
2018-11-19 22:08:55 +03:00
|
|
|
#remove system Wine installation to ensure no accidental leakage
|
|
|
|
apt-get remove -y winehq-devel
|
|
|
|
|
|
|
|
#configure posix mingw-w64 alternative for DXVK
|
2018-10-25 21:55:20 +03:00
|
|
|
update-alternatives --set x86_64-w64-mingw32-gcc `which x86_64-w64-mingw32-gcc-posix`
|
|
|
|
update-alternatives --set x86_64-w64-mingw32-g++ `which x86_64-w64-mingw32-g++-posix`
|
|
|
|
update-alternatives --set i686-w64-mingw32-gcc `which i686-w64-mingw32-gcc-posix`
|
|
|
|
update-alternatives --set i686-w64-mingw32-g++ `which i686-w64-mingw32-g++-posix`
|
2018-11-19 22:08:55 +03:00
|
|
|
|
|
|
|
#allow vagrant user to run docker
|
2018-10-25 21:55:20 +03:00
|
|
|
adduser vagrant docker
|
|
|
|
SHELL
|
|
|
|
|
|
|
|
config.vm.provision "shell", privileged: "true", inline: <<-SHELL
|
|
|
|
# unprivileged shell still runs as root for some reason
|
2018-12-05 20:21:36 +03:00
|
|
|
|
|
|
|
# the script below will set up the steam-runtime docker containers
|
2018-10-25 21:55:20 +03:00
|
|
|
sudo -u vagrant /home/vagrant/proton/vagrant-user-setup.sh
|
|
|
|
SHELL
|
|
|
|
end
|