mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-03-27 12:49:10 +03:00
Vagrantfile: Drop Arch chroot in favor of local mingw-w64 build
This commit is contained in:
parent
3ad34a0b3f
commit
ba72758ff7
5
Makefile
5
Makefile
@ -33,8 +33,7 @@ endif
|
|||||||
CONFIGURE_CMD := ../proton/configure.sh \
|
CONFIGURE_CMD := ../proton/configure.sh \
|
||||||
--steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32 \
|
--steam-runtime64=docker:steam-proton-dev --steam-runtime32=docker:steam-proton-dev32 \
|
||||||
--steam-runtime="$$HOME"/steam-runtime/runtime/ \
|
--steam-runtime="$$HOME"/steam-runtime/runtime/ \
|
||||||
--build-name="$(_build_name)" \
|
--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
|
|
||||||
|
|
||||||
# make doesn't handle spaces well... replace them with underscores in paths
|
# make doesn't handle spaces well... replace them with underscores in paths
|
||||||
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
|
BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
|
||||||
@ -93,7 +92,7 @@ clean: vagrant
|
|||||||
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
|
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
|
||||||
|
|
||||||
configure: vagrant
|
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
|
proton: configure
|
||||||
vagrant ssh -c 'make -C $(BUILD_DIR)/ dist'
|
vagrant ssh -c 'make -C $(BUILD_DIR)/ dist'
|
||||||
|
32
Vagrantfile
vendored
32
Vagrantfile
vendored
@ -75,7 +75,16 @@ Vagrant.configure(2) do |config|
|
|||||||
|
|
||||||
#install host build-time dependencies
|
#install host build-time dependencies
|
||||||
apt-get update
|
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
|
#install adobe font devkit to build source san hans
|
||||||
pip install afdko
|
pip install afdko
|
||||||
@ -83,27 +92,6 @@ Vagrant.configure(2) do |config|
|
|||||||
#allow vagrant user to run docker
|
#allow vagrant user to run docker
|
||||||
adduser vagrant 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
|
# the script below will set up the steam-runtime docker containers
|
||||||
sudo -u vagrant /home/vagrant/proton/vagrant-user-setup.sh
|
sudo -u vagrant /home/vagrant/proton/vagrant-user-setup.sh
|
||||||
SHELL
|
SHELL
|
||||||
|
@ -14,8 +14,7 @@ set -xe
|
|||||||
|
|
||||||
apt-get install -y gcc-5 g++-5 g++-5-multilib flex libosmesa6-dev libpcap-dev \
|
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 \
|
libhal-dev libsane-dev libv4l-dev libgphoto2-2-dev libcapi20-dev \
|
||||||
libgsm1-dev libmpg123-dev libvulkan-dev libxslt1-dev nasm yasm ccache \
|
libgsm1-dev libmpg123-dev libvulkan-dev libxslt1-dev nasm yasm ccache
|
||||||
schroot
|
|
||||||
update-alternatives --install "$(command -v gcc)" gcc "$(command -v gcc-5)" 50
|
update-alternatives --install "$(command -v gcc)" gcc "$(command -v gcc-5)" 50
|
||||||
update-alternatives --set gcc "$(command -v gcc-5)"
|
update-alternatives --set gcc "$(command -v gcc-5)"
|
||||||
update-alternatives --install "$(command -v g++)" g++ "$(command -v g++-5)" 50
|
update-alternatives --install "$(command -v g++)" g++ "$(command -v g++-5)" 50
|
||||||
|
@ -8,40 +8,10 @@ if [ ! -e "$HOME/steam-runtime" ]; then
|
|||||||
(cd steam-runtime && ./build-runtime.py --verbose --output=./runtime/)
|
(cd steam-runtime && ./build-runtime.py --verbose --output=./runtime/)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$HOME/bin/schroot_wrapper" ]; then
|
#build and install recent mingw-w64
|
||||||
#create schroot wrapper scripts, for winebuild and winegcc to find in PATH
|
if [ ! -e "$HOME/.local/bin/x86_64-w64-mingw32-gcc" ]; then
|
||||||
mkdir -p $HOME/bin/
|
mkdir -p $HOME/mingw-w64-build/
|
||||||
cat > $HOME/bin/schroot_wrapper <<EOF
|
(cd $HOME/mingw-w64-build && $HOME/proton/build-mingw-w64.sh "$HOME/.local/")
|
||||||
#!/bin/bash
|
#clean up the build tree, this takes up like 6GB
|
||||||
schroot -c proton_crosscc -- /usr/bin/\$(basename \$0) \$@
|
rm -rf $HOME/mingw-w64-build/
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user