Vagrantfile: Use public soldier SDK

This commit is contained in:
Andrew Eikum 2020-09-15 12:04:15 -05:00
parent 746cab7813
commit 8864bbfba3
3 changed files with 22 additions and 28 deletions

3
Vagrantfile vendored
View file

@ -94,7 +94,8 @@ Vagrant.configure(2) do |config|
adduser vagrant docker
#add steamrt docker
docker build -t "steam-proton-dev" -f "/home/vagrant/proton/steamrt/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-soldier-sysroot.Dockerfile" /home/vagrant/proton/steamrt/
docker pull registry.gitlab.steamos.cloud/steamrt/soldier/sdk
docker image tag registry.gitlab.steamos.cloud/steamrt/soldier/sdk steam-proton-dev
#allow user to run stuff in steamrt
sysctl kernel.unprivileged_userns_clone=1

View file

@ -76,34 +76,31 @@ cc-option = $(shell if test -z "`echo 'void*p=1;' | \
then echo "$(2)"; else echo "$(3)"; fi ;)
# Selected container mode shell
DOCKER_SHELL_BASE = docker run --rm --init --privileged --cap-add=SYS_ADMIN --security-opt apparmor:unconfined \
DOCKER_BASE = docker run --rm --init --privileged --cap-add=SYS_ADMIN --security-opt apparmor:unconfined \
-v $(HOME):$(HOME) -v /tmp:/tmp \
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v /etc/shadow:/etc/shadow:ro \
-w $(CURDIR) -e HOME=$(HOME) -e PATH=$(PATH) $(DOCKER_CCACHE_FLAG) -u $(shell id -u):$(shell id -g) -h $(shell hostname) \
$(DOCKER_OPTS) \
$(SELECT_DOCKER_IMAGE) /sbin/docker-init -sg -- /bin/bash
$(SELECT_DOCKER_IMAGE) /sbin/docker-init -sg --
STEAM_RUNTIME_RUNSH :=
# If STEAMRT64_MODE/STEAMRT32_MODE is set, set the nested SELECT_DOCKER_IMAGE to the _IMAGE variable and eval
# DOCKER_SHELL_BASE with it to create the CONTAINER_SHELL setting.
# DOCKER_BASE with it to create the CONTAINER_SHELL setting.
ifeq ($(STEAMRT64_MODE),docker)
SELECT_DOCKER_IMAGE := $(STEAMRT64_IMAGE)
CONTAINER_SHELL64 := $(DOCKER_SHELL_BASE)
CONTAINER_SHELL64 := $(DOCKER_BASE) /bin/bash
STEAM_RUNTIME_RUNSH := $(DOCKER_BASE)
else ifneq ($(STEAMRT64_MODE),)
foo := $(error Unrecognized STEAMRT64_MODE $(STEAMRT64_MODE))
endif
ifeq ($(STEAMRT32_MODE),docker)
SELECT_DOCKER_IMAGE := $(STEAMRT32_IMAGE)
CONTAINER_SHELL32 := $(DOCKER_SHELL_BASE)
CONTAINER_SHELL32 := $(DOCKER_BASE) /bin/bash
else ifneq ($(STEAMRT32_MODE),)
foo := $(error Unrecognized STEAMRT32_MODE $(STEAMRT32_MODE))
endif
ifneq ($(STEAMRT_PATH),)
STEAM_RUNTIME_RUNSH := $(STEAMRT_PATH)/run-in-soldier --
else
STEAM_RUNTIME_RUNSH :=
endif
SELECT_DOCKER_IMAGE :=
# If we're using containers to sub-invoke the various builds, jobserver won't work, have some silly auto-jobs

View file

@ -70,32 +70,28 @@ def setup_dll_symlinks(default_pfx_dir, dist_dir):
os.unlink(filename)
make_relative_symlink(target, filename)
def get_runtime_ld_path(runtime):
env = subprocess.check_output(runtime + ["env"], text=True)
for line in env.splitlines():
if line.startswith("LD_LIBRARY_PATH"):
return line.split("=", maxsplit=1)[1]
return None
def make_default_pfx(default_pfx_dir, dist_dir, runtime):
local_env = dict(os.environ)
local_env["WINEPREFIX"] = default_pfx_dir
local_env["WINEDEBUG"] = "-all"
ld_path = dist_dir + "/lib64:" + dist_dir + "/lib"
if runtime is None:
local_env["LD_LIBRARY_PATH"] = ld_path
local_env["WINEPREFIX"] = default_pfx_dir
local_env["WINEDEBUG"] = "-all"
runtime_args = []
else:
#the runtime overwrites LD_LIBRARY_PATH, so we pass it in on the CL via env
runtime_ld_path = get_runtime_ld_path(runtime)
if not runtime_ld_path is None:
ld_path = ld_path + ":" + runtime_ld_path
runtime_args = runtime + ["env", "LD_LIBRARY_PATH=" + ld_path]
#the runtime clears the environment, so we pass it in on the CL via env
runtime_args = runtime + ["env",
"LD_LIBRARY_PATH=" + ld_path,
"WINEPREFIX=" + default_pfx_dir,
"WINEDEBUG=-all"]
subprocess.run(runtime_args + [os.path.join(dist_dir, 'bin', 'wine'), "wineboot"], env=local_env, check=True)
subprocess.run(runtime_args + [os.path.join(dist_dir, 'bin', 'wineserver'), "-w"], env=local_env, check=True)
subprocess.run(runtime_args + ["/bin/bash", "-c",
os.path.join(dist_dir, 'bin', 'wine') + " wineboot && " +
os.path.join(dist_dir, 'bin', 'wineserver') + " -w"],
env=local_env, check=True)
setup_dll_symlinks(default_pfx_dir, dist_dir)
if __name__ == '__main__':