Simplify DXVK build

This commit is contained in:
Andrew Eikum 2019-06-24 13:51:54 -05:00
parent d68e71bed6
commit 030bdcd224
7 changed files with 20 additions and 42 deletions

View file

@ -27,8 +27,7 @@ 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)" \
--dxvk-crosscc-prefix=\"schroot\",\"-c\",\"dxvk_crosscc\",\"--\" \ --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
--docker-opts=-v\ /srv/chroot:/srv/chroot\ -v\ /etc/schroot/chroot.d/dxvk_crosscc:/etc/schroot/chroot.d/dxvk_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')"
@ -85,7 +84,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 dxvk_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 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'
proton: configure proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ dist' vagrant ssh -c 'make -C $(BUILD_DIR)/ dist'

18
Vagrantfile vendored
View file

@ -90,19 +90,19 @@ 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 dxvk_crosscc >/dev/null 2>&1; then if ! schroot -i -c proton_crosscc >/dev/null 2>&1; then
#download build of recent mingw-w64 with dwarf2 exceptions enabled #download build of recent mingw-w64 with dwarf2 exceptions enabled
wget --progress=dot -O /root/dxvk_crosscc.tar.xz 'http://repo.steampowered.com/proton_mingw/proton_mingw-9.1-1.tar.xz' 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/dxvk_crosscc.tar.xz unxz -T0 /root/proton_crosscc.tar.xz
mkdir -p /srv/chroot/dxvk_crosscc/ mkdir -p /srv/chroot/proton_crosscc/
tar -xf /root/dxvk_crosscc.tar -C /srv/chroot/dxvk_crosscc/ tar -xf /root/proton_crosscc.tar -C /srv/chroot/proton_crosscc/
#install dxvk_crosscc schroot #install proton_crosscc schroot
cat > /etc/schroot/chroot.d/dxvk_crosscc <<EOF cat > /etc/schroot/chroot.d/proton_crosscc <<EOF
[dxvk_crosscc] [proton_crosscc]
description=Special mingw-w64 for building DXVK description=Special mingw-w64 for building DXVK
type=directory type=directory
directory=/srv/chroot/dxvk_crosscc/ directory=/srv/chroot/proton_crosscc/
users=vagrant users=vagrant
personality=linux personality=linux
preserve-environment=true preserve-environment=true

View file

@ -32,9 +32,6 @@ else # (Rest of the file is the else)
# STEAMRT32_MODE - Same as above for 32-bit container (can be different type) # STEAMRT32_MODE - Same as above for 32-bit container (can be different type)
# STEAMRT32_IMAGE - Same as above for 32-bit container # STEAMRT32_IMAGE - Same as above for 32-bit container
# STEAMRT_PATH - Path to built runtime which contains run.sh # STEAMRT_PATH - Path to built runtime which contains run.sh
# DXVK_CROSSCC_PREFIX - Quoted and comma-separated list of strings that
# should be prefixed before the cross compiler that builds DXVK, so
# we can execute it when it lives in a chroot, for example.
ifeq ($(SRCDIR),) ifeq ($(SRCDIR),)
foo := $(error SRCDIR not set, do not include makefile_base directly, run ./configure.sh to generate Makefile) foo := $(error SRCDIR not set, do not include makefile_base directly, run ./configure.sh to generate Makefile)
@ -1106,26 +1103,22 @@ DXVK_CONFIGURE_FILES32 := $(DXVK_OBJ32)/build.ninja
DXVK_CONFIGURE_FILES64 := $(DXVK_OBJ64)/build.ninja DXVK_CONFIGURE_FILES64 := $(DXVK_OBJ64)/build.ninja
# 64bit-configure. Remove coredata file if already configured (due to e.g. makefile changing) # 64bit-configure. Remove coredata file if already configured (due to e.g. makefile changing)
# sed is used to sub in our special cross compiler
$(DXVK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(DXVK)/build-win64.txt | $(DXVK_OBJ64) $(DXVK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(DXVK)/build-win64.txt | $(DXVK_OBJ64)
if [ -e "$(abspath $(DXVK_OBJ64))"/build.ninja ]; then \ if [ -e "$(abspath $(DXVK_OBJ64))"/build.ninja ]; then \
rm -f "$(abspath $(DXVK_OBJ64))"/meson-private/coredata.dat; \ rm -f "$(abspath $(DXVK_OBJ64))"/meson-private/coredata.dat; \
fi fi
cd "$(abspath $(DXVK))" && \ cd "$(abspath $(DXVK))" && \
sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win64.txt > "$(abspath $(DXVK_OBJ64))/proton-build-win64.txt" && \
PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
meson --prefix="$(abspath $(DXVK_OBJ64))" --cross-file "$(abspath $(DXVK_OBJ64))/proton-build-win64.txt" --strip --buildtype=release "$(abspath $(DXVK_OBJ64))" meson --prefix="$(abspath $(DXVK_OBJ64))" --cross-file "$(abspath $(DXVK))/build-win64.txt" --strip --buildtype=release "$(abspath $(DXVK_OBJ64))"
# 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing) # 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing)
# sed is used to sub in our special cross compiler
$(DXVK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(DXVK)/build-win32.txt | $(DXVK_OBJ32) $(DXVK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(DXVK)/build-win32.txt | $(DXVK_OBJ32)
if [ -e "$(abspath $(DXVK_OBJ32))"/build.ninja ]; then \ if [ -e "$(abspath $(DXVK_OBJ32))"/build.ninja ]; then \
rm -f "$(abspath $(DXVK_OBJ32))"/meson-private/coredata.dat; \ rm -f "$(abspath $(DXVK_OBJ32))"/meson-private/coredata.dat; \
fi fi
cd "$(abspath $(DXVK))" && \ cd "$(abspath $(DXVK))" && \
sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win32.txt > "$(abspath $(DXVK_OBJ32))/proton-build-win32.txt" && \
PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
meson --prefix="$(abspath $(DXVK_OBJ32))" --cross-file "$(abspath $(DXVK_OBJ32))/proton-build-win32.txt" --strip --buildtype=release "$(abspath $(DXVK_OBJ32))" meson --prefix="$(abspath $(DXVK_OBJ32))" --cross-file "$(abspath $(DXVK))/build-win32.txt" --strip --buildtype=release "$(abspath $(DXVK_OBJ32))"
## dxvk goals ## dxvk goals
DXVK_TARGETS = dxvk dxvk_configure dxvk32 dxvk64 dxvk_configure32 dxvk_configure64 DXVK_TARGETS = dxvk dxvk_configure dxvk32 dxvk64 dxvk_configure32 dxvk_configure64
@ -1168,26 +1161,22 @@ D9VK_CONFIGURE_FILES32 := $(D9VK_OBJ32)/build.ninja
D9VK_CONFIGURE_FILES64 := $(D9VK_OBJ64)/build.ninja D9VK_CONFIGURE_FILES64 := $(D9VK_OBJ64)/build.ninja
# 64bit-configure. Remove coredata file if already configured (due to e.g. makefile changing) # 64bit-configure. Remove coredata file if already configured (due to e.g. makefile changing)
# sed is used to sub in our special cross compiler
$(D9VK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(D9VK)/build-win64.txt | $(D9VK_OBJ64) $(D9VK_CONFIGURE_FILES64): $(MAKEFILE_DEP) $(D9VK)/build-win64.txt | $(D9VK_OBJ64)
if [ -e "$(abspath $(D9VK_OBJ64))"/build.ninja ]; then \ if [ -e "$(abspath $(D9VK_OBJ64))"/build.ninja ]; then \
rm -f "$(abspath $(D9VK_OBJ64))"/meson-private/coredata.dat; \ rm -f "$(abspath $(D9VK_OBJ64))"/meson-private/coredata.dat; \
fi fi
cd "$(abspath $(D9VK))" && \ cd "$(abspath $(D9VK))" && \
sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win64.txt > "$(abspath $(D9VK_OBJ64))/proton-build-win64.txt" && \
PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
meson --prefix="$(abspath $(D9VK_OBJ64))" --cross-file "$(abspath $(D9VK_OBJ64))/proton-build-win64.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ64))" meson --prefix="$(abspath $(D9VK_OBJ64))" --cross-file "$(abspath $(D9VK))/build-win64.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ64))"
# 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing) # 32-bit configure. Remove coredata file if already configured (due to e.g. makefile changing)
# sed is used to sub in our special cross compiler
$(D9VK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(D9VK)/build-win32.txt | $(D9VK_OBJ32) $(D9VK_CONFIGURE_FILES32): $(MAKEFILE_DEP) $(D9VK)/build-win32.txt | $(D9VK_OBJ32)
if [ -e "$(abspath $(D9VK_OBJ32))"/build.ninja ]; then \ if [ -e "$(abspath $(D9VK_OBJ32))"/build.ninja ]; then \
rm -f "$(abspath $(D9VK_OBJ32))"/meson-private/coredata.dat; \ rm -f "$(abspath $(D9VK_OBJ32))"/meson-private/coredata.dat; \
fi fi
cd "$(abspath $(D9VK))" && \ cd "$(abspath $(D9VK))" && \
sed -e "s|@PROTON_DXVK_CROSSCC_PREFIX@|$(subst ",\\\",$(DXVK_CROSSCC_PREFIX))|" < build-win32.txt > "$(abspath $(D9VK_OBJ32))/proton-build-win32.txt" && \
PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \ PATH="$(abspath $(SRCDIR))/glslang/bin/:$(PATH)" \
meson --prefix="$(abspath $(D9VK_OBJ32))" --cross-file "$(abspath $(D9VK_OBJ32))/proton-build-win32.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ32))" meson --prefix="$(abspath $(D9VK_OBJ32))" --cross-file "$(abspath $(D9VK))/build-win32.txt" --strip --buildtype=release -Denable_dxgi=false -Denable_d3d10=false -Denable_d3d11=false "$(abspath $(D9VK_OBJ32))"
## d9vk goals ## d9vk goals
D9VK_TARGETS = d9vk d9vk_configure d9vk32 d9vk64 d9vk_configure32 d9vk_configure64 D9VK_TARGETS = d9vk d9vk_configure d9vk32 d9vk64 d9vk_configure32 d9vk_configure64

View file

@ -111,10 +111,6 @@ function configure() {
echo "STEAMRT32_IMAGE := $(escape_for_make "$steamrt32_name")" echo "STEAMRT32_IMAGE := $(escape_for_make "$steamrt32_name")"
echo "STEAMRT_PATH := $(escape_for_make "$steamrt_path")" echo "STEAMRT_PATH := $(escape_for_make "$steamrt_path")"
if [[ -n "$arg_crosscc_prefix" ]]; then
echo "DXVK_CROSSCC_PREFIX := $(escape_for_make "$arg_crosscc_prefix")," #comma is not a typo
fi
if [[ -n "$arg_docker_opts" ]]; then if [[ -n "$arg_docker_opts" ]]; then
echo "DOCKER_OPTS := $arg_docker_opts" echo "DOCKER_OPTS := $arg_docker_opts"
fi fi
@ -138,7 +134,6 @@ arg_steamrt=""
arg_no_steamrt="" arg_no_steamrt=""
arg_ffmpeg="" arg_ffmpeg=""
arg_build_name="" arg_build_name=""
arg_crosscc_prefix=""
arg_docker_opts="" arg_docker_opts=""
arg_help="" arg_help=""
invalid_args="" invalid_args=""
@ -176,9 +171,6 @@ function parse_args() {
elif [[ $arg = --build-name ]]; then elif [[ $arg = --build-name ]]; then
arg_build_name="$val" arg_build_name="$val"
val_used=1 val_used=1
elif [[ $arg = --dxvk-crosscc-prefix ]]; then
arg_crosscc_prefix="$val"
val_used=1
elif [[ $arg = --docker-opts ]]; then elif [[ $arg = --docker-opts ]]; then
arg_docker_opts="$val" arg_docker_opts="$val"
val_used=1 val_used=1
@ -240,10 +232,6 @@ usage() {
"$1" "" "$1" ""
"$1" " --with-ffmpeg Build ffmpeg for WMA audio support" "$1" " --with-ffmpeg Build ffmpeg for WMA audio support"
"$1" "" "$1" ""
"$1" " --dxvk-crosscc-prefix='<prefix>' Quoted and comma-separated list of arguments to prefix before"
"$1" " the cross-compiler that builds DXVK. E.g:"
"$1" " --dxvk-crosscc-prefix=\"schroot\",\"-c\",\"some_chroot\",\"--\""
"$1" ""
"$1" " --docker-opts='<options>' Extra options to pass to Docker when invoking the runtime." "$1" " --docker-opts='<options>' Extra options to pass to Docker when invoking the runtime."
"$1" "" "$1" ""
"$1" " Steam Runtime" "$1" " Steam Runtime"

2
d9vk

@ -1 +1 @@
Subproject commit 10e386a0ffe13b85a1bb62ad96847b6409134469 Subproject commit b787cf0c66c5de1fc536b557a97c7a9117454bc3

2
dxvk

@ -1 +1 @@
Subproject commit 894515f6cf4ca668b5952834385a07debf360ae1 Subproject commit dd6676cf13bcfda932562a15622f821b61d1eed1

View file

@ -13,7 +13,7 @@ if [ ! -e "$HOME/bin/schroot_wrapper" ]; then
mkdir -p $HOME/bin/ mkdir -p $HOME/bin/
cat > $HOME/bin/schroot_wrapper <<EOF cat > $HOME/bin/schroot_wrapper <<EOF
#!/bin/bash #!/bin/bash
schroot -c dxvk_crosscc -- /usr/bin/\$(basename \$0) \$@ schroot -c proton_crosscc -- /usr/bin/\$(basename \$0) \$@
EOF EOF
chmod 755 $HOME/bin/schroot_wrapper chmod 755 $HOME/bin/schroot_wrapper
for a in x86_64 i686 for a in x86_64 i686
@ -23,9 +23,11 @@ EOF
w64-mingw32-as \ w64-mingw32-as \
w64-mingw32-dlltool \ w64-mingw32-dlltool \
w64-mingw32-gcc \ w64-mingw32-gcc \
w64-mingw32-g++ \
w64-mingw32-ld \ w64-mingw32-ld \
w64-mingw32-nm \ w64-mingw32-nm \
w64-mingw32-ranlib \ w64-mingw32-ranlib \
w64-mingw32-strip \
w64-mingw32-windres w64-mingw32-windres
do do
ln -s schroot_wrapper $HOME/bin/$a-$f ln -s schroot_wrapper $HOME/bin/$a-$f