Vagrantfile: Drop Arch chroot in favor of local mingw-w64 build

This commit is contained in:
Andrew Eikum 2019-10-07 14:14:58 -05:00
parent 3ad34a0b3f
commit ba72758ff7
4 changed files with 19 additions and 63 deletions

View File

@ -33,8 +33,7 @@ endif
CONFIGURE_CMD := ../proton/configure.sh \
--steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32 \
--steam-runtime="$$HOME"/steam-runtime/runtime/ \
--build-name="$(_build_name)" \
--docker-opts=-v\ /srv/chroot:/srv/chroot\ -v\ /etc/schroot/chroot.d/proton_crosscc:/etc/schroot/chroot.d/proton_crosscc\ -v\ /home/vagrant/rbind_fstab:/etc/schroot/default/fstab
--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')"
@ -93,7 +92,7 @@ clean: vagrant
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
configure: vagrant
@vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then if ! schroot -i -c proton_crosscc >/dev/null 2>&1; then echo !!!! You must run \"vagrant provision\" !!!!; exit 1; fi; mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads'
@vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads'
proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ dist'

32
Vagrantfile vendored
View File

@ -75,7 +75,16 @@ Vagrant.configure(2) do |config|
#install host build-time dependencies
apt-get update
apt-get install -y gpgv2 gnupg2 g++ g++-multilib git docker-ce docker-ce-cli containerd.io fontforge-nox python-debian schroot python-pip meson
apt-get install -y gpgv2 gnupg2 git docker-ce docker-ce-cli containerd.io \
fontforge-nox python-debian python-pip meson libmpc-dev libmpc-dev:i386 \
gcc g++ gcc-i686-linux-gnu g++-i686-linux-gnu binutils-i686-linux-gnu \
gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 \
g++-mingw-w64-i686 g++-mingw-w64-x86-64
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`
#install adobe font devkit to build source san hans
pip install afdko
@ -83,27 +92,6 @@ Vagrant.configure(2) do |config|
#allow vagrant user to run docker
adduser vagrant docker
if ! schroot -i -c proton_crosscc >/dev/null 2>&1; then
#download build of recent mingw-w64 with dwarf2 exceptions enabled
wget --progress=dot -O /root/proton_crosscc.tar.xz 'http://repo.steampowered.com/proton_mingw/proton_mingw-9.1-1.tar.xz'
unxz -T0 /root/proton_crosscc.tar.xz
mkdir -p /srv/chroot/proton_crosscc/
tar -xf /root/proton_crosscc.tar -C /srv/chroot/proton_crosscc/
#install proton_crosscc schroot
cat > /etc/schroot/chroot.d/proton_crosscc <<EOF
[proton_crosscc]
description=Special mingw-w64 for building DXVK
type=directory
directory=/srv/chroot/proton_crosscc/
users=vagrant
personality=linux
preserve-environment=true
EOF
fi
# unprivileged shell still runs as root for some reason
# the script below will set up the steam-runtime docker containers
sudo -u vagrant /home/vagrant/proton/vagrant-user-setup.sh
SHELL

View File

@ -14,8 +14,7 @@ set -xe
apt-get install -y gcc-5 g++-5 g++-5-multilib flex libosmesa6-dev libpcap-dev \
libhal-dev libsane-dev libv4l-dev libgphoto2-2-dev libcapi20-dev \
libgsm1-dev libmpg123-dev libvulkan-dev libxslt1-dev nasm yasm ccache \
schroot
libgsm1-dev libmpg123-dev libvulkan-dev libxslt1-dev nasm yasm ccache
update-alternatives --install "$(command -v gcc)" gcc "$(command -v gcc-5)" 50
update-alternatives --set gcc "$(command -v gcc-5)"
update-alternatives --install "$(command -v g++)" g++ "$(command -v g++-5)" 50

View File

@ -8,40 +8,10 @@ if [ ! -e "$HOME/steam-runtime" ]; then
(cd steam-runtime && ./build-runtime.py --verbose --output=./runtime/)
fi
if [ ! -e "$HOME/bin/schroot_wrapper" ]; then
#create schroot wrapper scripts, for winebuild and winegcc to find in PATH
mkdir -p $HOME/bin/
cat > $HOME/bin/schroot_wrapper <<EOF
#!/bin/bash
schroot -c proton_crosscc -- /usr/bin/\$(basename \$0) \$@
EOF
chmod 755 $HOME/bin/schroot_wrapper
for a in x86_64 i686
do
for f in \
w64-mingw32-ar \
w64-mingw32-as \
w64-mingw32-dlltool \
w64-mingw32-gcc \
w64-mingw32-g++ \
w64-mingw32-ld \
w64-mingw32-nm \
w64-mingw32-ranlib \
w64-mingw32-strip \
w64-mingw32-windres
do
ln -s schroot_wrapper $HOME/bin/$a-$f
done
done
# docker mounts /home/vagrant, not /home, so we need rbind instead of bind
# for $HOME to get mounted in the schroot when called from within the docker
cat > /home/vagrant/rbind_fstab << EOF
/proc /proc none rw,bind 0 0
/sys /sys none rw,bind 0 0
/dev /dev none rw,bind 0 0
/dev/pts /dev/pts none rw,bind 0 0
/home /home none rw,rbind 0 0
/tmp /tmp none rw,rbind 0 0
EOF
#build and install recent mingw-w64
if [ ! -e "$HOME/.local/bin/x86_64-w64-mingw32-gcc" ]; then
mkdir -p $HOME/mingw-w64-build/
(cd $HOME/mingw-w64-build && $HOME/proton/build-mingw-w64.sh "$HOME/.local/")
#clean up the build tree, this takes up like 6GB
rm -rf $HOME/mingw-w64-build/
fi