build: Build docker images for proton sdk.

This commit is contained in:
Rémi Bernon 2021-01-12 14:31:00 +01:00 committed by Andrew Eikum
parent de58187e6c
commit ae85b5d0df
11 changed files with 486 additions and 1 deletions

View file

@ -40,6 +40,7 @@ ifneq ($(unstripped),)
DEPLOY_DIR := $(DEPLOY_DIR)_unstripped
endif
protonsdk_version := 0.20210126.1-0
CONFIGURE_CMD := ../proton/configure.sh \
--steam-runtime-image=steam-proton-dev \
--build-name="$(_build_name)"
@ -49,7 +50,7 @@ BUILD_DIR := "build-$(shell echo $(_build_name) | sed -e 's/ /_/g')"
all: help
.PHONY: help vagrant clean configure proton install deploy module
.PHONY: help vagrant clean configure proton install deploy module protonsdk
help:
@echo "Proton Makefile instructions"
@ -70,6 +71,8 @@ help:
@echo " Current build name: $(_build_name)"
@echo " unstripped - Set to non-empty to avoid stripping installed library files."
@echo " enable_ccache - Enabled by default, set to 0 to disable ccache."
@echo " protonsdk_version - Version of the proton sdk image to use for building,"
@echo " use protonsdk_version=local to build it locally."
@echo ""
@echo "Development targets:"
@echo " vagrant - Start Vagrant VM"
@ -104,9 +107,16 @@ vagrant:
clean: vagrant
vagrant ssh -c 'rm -rf $(BUILD_DIR)/'
protonsdk: vagrant
vagrant ssh -c 'make -C proton/docker $(UNSTRIPPED) $(CCACHE_FLAG) PROTONSDK_VERSION=$(protonsdk_version) proton'
configure: vagrant
@vagrant ssh -c 'if [ ! -e $(BUILD_DIR)/Makefile ]; then mkdir -p $(BUILD_DIR); (cd $(BUILD_DIR) && $(CONFIGURE_CMD)); fi && make -C $(BUILD_DIR) downloads'
ifeq ($(protonsdk_version),local)
configure: protonsdk
endif
proton: configure
vagrant ssh -c 'make -C $(BUILD_DIR)/ $(UNSTRIPPED) $(CCACHE_FLAG) dist'
echo "Proton built in VM. Use 'install' or 'deploy' targets to retrieve the build."

210
docker/Makefile Normal file
View file

@ -0,0 +1,210 @@
STEAMRT_VERSION = 0.20210126.1
STEAMRT_URLBASE = registry.gitlab.steamos.cloud
PROTONSDK_URLBASE = $(STEAMRT_URLBASE)/proton/soldier/sdk
PROTONSDK_VERSION = $(STEAMRT_VERSION)-0
# this is just for building toolchain, as we do static builds it should
# not have any impact on the end result, but changing it will invalidate
# docker caches, so we need something that don't change much
BASE_IMAGE_i686 = i386/ubuntu:18.04
BASE_IMAGE_x86_64 = ubuntu:18.04
BINUTILS_VERSION = 2.35
GCC_VERSION = 9.3.0
MINGW_VERSION = 8.0.0
RUST_VERSION = 1.44.1
SOURCES_URLBASE = https://repo.steampowered.com/proton-sdk
BINUTILS_URLBASE = $(SOURCES_URLBASE)
GCC_URLBASE = $(SOURCES_URLBASE)
MINGW_URLBASE = $(SOURCES_URLBASE)
RUST_URLBASE = $(SOURCES_URLBASE)
BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.xz
GCC_SOURCE = gcc-$(GCC_VERSION).tar.xz
MINGW_SOURCE = mingw-w64-v$(MINGW_VERSION).tar.bz2
RUST_SOURCE_x86_64 = rust-$(RUST_VERSION)-x86_64-unknown-linux-gnu.tar.gz
RUST_SOURCE_i686 = rust-$(RUST_VERSION)-i686-unknown-linux-gnu.tar.gz
BINUTILS_SHA256 = 1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85
GCC_SHA256 = 71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1
MINGW_SHA256 = 44c740ea6ab3924bc3aa169bad11ad3c5766c5c8459e3126d44eabb8735a5762
RUST_SHA256_x86_64 = a41df89a461a580536aeb42755e43037556fba2e527dd13a1e1bb0749de28202
RUST_SHA256_i686 = e69689b0a1b66599cf83e7dd54f839419007e44376195e93e301a3175da3d854
DOCKER = docker
%.Dockerfile: %.Dockerfile.in
sed -re 's!@PROTONSDK_URLBASE@!$(PROTONSDK_URLBASE)!g' \
-re 's!@BASE_IMAGE@!$(BASE_IMAGE)!g' \
-re 's!@BINUTILS_VERSION@!$(BINUTILS_VERSION)!g' \
-re 's!@BINUTILS_URLBASE@!$(BINUTILS_URLBASE)!g' \
-re 's!@BINUTILS_SOURCE@!$(BINUTILS_SOURCE)!g' \
-re 's!@BINUTILS_SHA256@!$(BINUTILS_SHA256)!g' \
-re 's!@GCC_VERSION@!$(GCC_VERSION)!g' \
-re 's!@GCC_URLBASE@!$(GCC_URLBASE)!g' \
-re 's!@GCC_SOURCE@!$(GCC_SOURCE)!g' \
-re 's!@GCC_SHA256@!$(GCC_SHA256)!g' \
-re 's!@MINGW_VERSION@!$(MINGW_VERSION)!g' \
-re 's!@MINGW_URLBASE@!$(MINGW_URLBASE)!g' \
-re 's!@MINGW_SOURCE@!$(MINGW_SOURCE)!g' \
-re 's!@MINGW_SHA256@!$(MINGW_SHA256)!g' \
-re 's!@RUST_VERSION@!$(RUST_VERSION)!g' \
-re 's!@RUST_URLBASE@!$(RUST_URLBASE)!g' \
-re 's!@RUST_SOURCE_x86_64@!$(RUST_SOURCE_x86_64)!g' \
-re 's!@RUST_SOURCE_i686@!$(RUST_SOURCE_i686)!g' \
-re 's!@RUST_SHA256_x86_64@!$(RUST_SHA256_x86_64)!g' \
-re 's!@RUST_SHA256_i686@!$(RUST_SHA256_i686)!g' \
-re 's!@J@!$(shell nproc)!g' \
$< >$@
%-i686.Dockerfile.in: %.Dockerfile.in
sed -re 's!@ARCH@!i686!g' \
$< >$@
%-x86_64.Dockerfile.in: %.Dockerfile.in
sed -re 's!@ARCH@!x86_64!g' \
$< >$@
%-linux-gnu.Dockerfile.in: %.Dockerfile.in
sed -re 's!@TARGET@!linux-gnu!g' \
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
$< >$@
%-w64-mingw32.Dockerfile.in: %.Dockerfile.in
sed -re 's!@TARGET@!w64-mingw32!g' \
-re 's!@TARGET_FLAGS@!$(TARGET_FLAGS)!g' \
$< >$@
define create-build-base-rules
.PHONY: build-base-$(1)
all build-base: build-base-$(1)
build-base-$(1): BASE_IMAGE = $(BASE_IMAGE_$(1))
build-base-$(1): build-base-$(1).Dockerfile
rm -rf build; mkdir -p build
$(DOCKER) build -f $$< \
--cache-from=$(PROTONSDK_URLBASE)/build-base-$(1):latest \
-t $(PROTONSDK_URLBASE)/build-base-$(1):latest \
build
pull::
-$(DOCKER) pull $(PROTONSDK_URLBASE)/build-base-$(1):latest
push::
$(DOCKER) push $(PROTONSDK_URLBASE)/build-base-$(1):latest
endef
$(eval $(call create-build-base-rules,i686))
$(eval $(call create-build-base-rules,x86_64))
define create-binutils-rules
.PHONY: binutils-$(1)-$(2)
all binutils: binutils-$(1)-$(2)
binutils-$(1)-$(2): binutils-$(1)-$(2).Dockerfile | build-base
rm -rf build; mkdir -p build
$(DOCKER) build -f $$< \
--cache-from=$(PROTONSDK_URLBASE)/binutils-$(1)-$(2):$(BINUTILS_VERSION) \
-t $(PROTONSDK_URLBASE)/binutils-$(1)-$(2):$(BINUTILS_VERSION) \
-t $(PROTONSDK_URLBASE)/binutils-$(1)-$(2):latest \
build
pull::
-$(DOCKER) pull $(PROTONSDK_URLBASE)/binutils-$(1)-$(2):$(BINUTILS_VERSION)
push::
$(DOCKER) push $(PROTONSDK_URLBASE)/binutils-$(1)-$(2):$(BINUTILS_VERSION)
$(DOCKER) push $(PROTONSDK_URLBASE)/binutils-$(1)-$(2):latest
endef
$(eval $(call create-binutils-rules,i686,w64-mingw32))
$(eval $(call create-binutils-rules,i686,linux-gnu))
$(eval $(call create-binutils-rules,x86_64,w64-mingw32))
$(eval $(call create-binutils-rules,x86_64,linux-gnu))
define create-mingw-rules
.PHONY: mingw-$(2)-$(1)
all mingw: mingw-$(2)-$(1)
mingw-$(2)-$(1): mingw-$(2)-$(1).Dockerfile | binutils
rm -rf build; mkdir -p build
$(DOCKER) build -f $$< \
--cache-from=$(PROTONSDK_URLBASE)/mingw-$(2)-$(1):$(MINGW_VERSION) \
-t $(PROTONSDK_URLBASE)/mingw-$(2)-$(1):$(MINGW_VERSION) \
-t $(PROTONSDK_URLBASE)/mingw-$(2)-$(1):latest \
build
pull::
-$(DOCKER) pull $(PROTONSDK_URLBASE)/mingw-$(2)-$(1):$(MINGW_VERSION)
push::
$(DOCKER) push $(PROTONSDK_URLBASE)/mingw-$(2)-$(1):$(MINGW_VERSION)
$(DOCKER) push $(PROTONSDK_URLBASE)/mingw-$(2)-$(1):latest
endef
$(eval $(call create-mingw-rules,i686,headers))
$(eval $(call create-mingw-rules,i686,gcc))
$(eval $(call create-mingw-rules,i686,crt))
$(eval $(call create-mingw-rules,i686,pthreads))
$(eval $(call create-mingw-rules,i686,widl))
$(eval $(call create-mingw-rules,x86_64,headers))
$(eval $(call create-mingw-rules,x86_64,gcc))
$(eval $(call create-mingw-rules,x86_64,crt))
$(eval $(call create-mingw-rules,x86_64,pthreads))
$(eval $(call create-mingw-rules,x86_64,widl))
GCC_TARGET_FLAGS_w64-mingw32 = --disable-shared
GCC_TARGET_FLAGS_linux-gnu =
define create-gcc-rules
.PHONY: gcc-$(1)-$(2)
all gcc: gcc-$(1)-$(2)
gcc-$(1)-$(2): TARGET_FLAGS = $(GCC_TARGET_FLAGS_$(2))
gcc-$(1)-$(2): gcc-$(1)-$(2).Dockerfile | mingw
rm -rf build; mkdir -p build
$(DOCKER) build -f $$< \
--cache-from=$(PROTONSDK_URLBASE)/gcc-$(1)-$(2):$(GCC_VERSION) \
-t $(PROTONSDK_URLBASE)/gcc-$(1)-$(2):$(GCC_VERSION) \
-t $(PROTONSDK_URLBASE)/gcc-$(1)-$(2):latest \
build
pull::
-$(DOCKER) pull $(PROTONSDK_URLBASE)/gcc-$(1)-$(2):$(GCC_VERSION)
push::
$(DOCKER) push $(PROTONSDK_URLBASE)/gcc-$(1)-$(2):$(GCC_VERSION)
$(DOCKER) push $(PROTONSDK_URLBASE)/gcc-$(1)-$(2):latest
endef
$(eval $(call create-gcc-rules,i686,linux-gnu))
$(eval $(call create-gcc-rules,x86_64,linux-gnu))
$(eval $(call create-gcc-rules,i686,w64-mingw32))
$(eval $(call create-gcc-rules,x86_64,w64-mingw32))
define create-proton-rules
.PHONY: proton
all: proton
proton: BASE_IMAGE = $(STEAMRT_URLBASE)/steamrt/soldier/sdk:$(STEAMRT_VERSION)
proton: proton.Dockerfile | gcc
rm -rf build; mkdir -p build
$(DOCKER) build -f $$< \
--cache-from=$(PROTONSDK_URLBASE):$(PROTONSDK_VERSION) \
-t $(PROTONSDK_URLBASE):$(PROTONSDK_VERSION) \
-t $(PROTONSDK_URLBASE):latest \
build
pull::
-$(DOCKER) pull $(PROTONSDK_URLBASE):$(PROTONSDK_VERSION)
push::
$(DOCKER) push $(PROTONSDK_URLBASE):$(PROTONSDK_VERSION)
$(DOCKER) push $(PROTONSDK_URLBASE):latest
endef
$(eval $(call create-proton-rules))
sources::
rm -f $(BINUTILS_SOURCE)
rm -f $(MINGW_SOURCE)
rm -f $(GCC_SOURCE)
rm -f $(RUST_SOURCE_x86_64)
rm -f $(RUST_SOURCE_i686)
wget $(BINUTILS_URLBASE)/$(BINUTILS_SOURCE)
wget $(MINGW_URLBASE)/$(MINGW_SOURCE)
wget $(GCC_URLBASE)/$(GCC_SOURCE)
wget $(RUST_URLBASE)/$(RUST_SOURCE_x86_64)
wget $(RUST_URLBASE)/$(RUST_SOURCE_i686)
echo $(BINUTILS_SHA256) $(BINUTILS_SOURCE) | sha256sum -c -
echo $(MINGW_SHA256) $(MINGW_SOURCE) | sha256sum -c -
echo $(GCC_SHA256) $(GCC_SOURCE) | sha256sum -c -
echo $(RUST_SHA256_x86_64) $(RUST_SOURCE_x86_64) | sha256sum -c -
echo $(RUST_SHA256_i686) $(RUST_SOURCE_i686) | sha256sum -c -

View file

@ -0,0 +1,32 @@
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
RUN wget -q @BINUTILS_URLBASE@/@BINUTILS_SOURCE@ \
&& echo '@BINUTILS_SHA256@ @BINUTILS_SOURCE@' | sha256sum -c - \
&& tar xf @BINUTILS_SOURCE@ -C /tmp && rm @BINUTILS_SOURCE@ \
&& cd /tmp/binutils-@BINUTILS_VERSION@ \
&& ./configure --quiet \
--prefix=/usr \
--libdir=/usr/lib \
--host=@ARCH@-linux-gnu \
--build=@ARCH@-linux-gnu \
--target=@ARCH@-@TARGET@ \
--program-prefix=@ARCH@-@TARGET@- \
--enable-gold \
--enable-ld=default \
--enable-lto \
--enable-static \
--disable-multilib \
--disable-nls \
--disable-plugins \
--disable-shared \
--disable-werror \
--with-gmp \
--with-isl \
--with-mpc \
--with-mpfr \
--with-system-zlib \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true configure-host \
&& make --quiet -j@J@ MAKEINFO=true LDFLAGS="-static" \
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/binutils-@BINUTILS_VERSION@

View file

@ -0,0 +1,17 @@
FROM @BASE_IMAGE@ AS base
RUN apt-get update && apt-get install -y \
autoconf \
bzip2 \
g++ \
gcc \
libgmp-dev \
libisl-dev \
libmpc-dev \
libmpfr-dev \
libtool \
libz-dev \
make \
wget \
xz-utils \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /var/lib/apt/lists/*

47
docker/gcc.Dockerfile.in Normal file
View file

@ -0,0 +1,47 @@
FROM @PROTONSDK_URLBASE@/binutils-@ARCH@-@TARGET@:@BINUTILS_VERSION@ AS binutils
FROM @PROTONSDK_URLBASE@/mingw-headers-@ARCH@:@MINGW_VERSION@ AS mingw-headers
FROM @PROTONSDK_URLBASE@/mingw-crt-@ARCH@:@MINGW_VERSION@ AS mingw-crt
FROM @PROTONSDK_URLBASE@/mingw-pthreads-@ARCH@:@MINGW_VERSION@ AS mingw-pthreads
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
COPY --from=binutils /opt/usr /usr
COPY --from=mingw-headers /opt/usr /usr
COPY --from=mingw-crt /opt/usr /usr
COPY --from=mingw-pthreads /opt/usr /usr
RUN wget -q @GCC_URLBASE@/@GCC_SOURCE@ \
&& echo '@GCC_SHA256@ @GCC_SOURCE@' | sha256sum -c - \
&& tar xf @GCC_SOURCE@ -C /tmp && rm @GCC_SOURCE@ \
&& mkdir /tmp/gcc-@GCC_VERSION@/build && cd /tmp/gcc-@GCC_VERSION@/build \
&& ../configure --quiet \
--prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--host=@ARCH@-linux-gnu \
--build=@ARCH@-linux-gnu \
--target=@ARCH@-@TARGET@ \
--program-prefix=@ARCH@-@TARGET@- \
--enable-languages=c,c++,lto \
--enable-libstdcxx-time=yes \
--enable-lto \
--enable-threads=posix \
--disable-bootstrap \
--disable-checking \
--disable-multilib \
--disable-nls \
--disable-plugin \
@TARGET_FLAGS@ \
--disable-sjlj-exceptions \
--disable-werror \
--with-arch=nocona \
--with-default-libstdcxx-abi=new \
--with-dwarf2 \
--with-system-gmp \
--with-system-isl \
--with-system-mpc \
--with-system-mpfr \
--with-system-zlib \
--with-tune=core-avx2 \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" \
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/gcc-@GCC_VERSION@

View file

@ -0,0 +1,20 @@
FROM @PROTONSDK_URLBASE@/binutils-@ARCH@-w64-mingw32:@BINUTILS_VERSION@ AS binutils
FROM @PROTONSDK_URLBASE@/mingw-headers-@ARCH@:@MINGW_VERSION@ AS mingw-headers
FROM @PROTONSDK_URLBASE@/mingw-gcc-@ARCH@:@MINGW_VERSION@ AS mingw-gcc
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
COPY --from=binutils /opt/usr /usr
COPY --from=mingw-headers /opt/usr /usr
COPY --from=mingw-gcc /opt/usr /usr
RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
&& echo '@MINGW_SHA256@ @MINGW_SOURCE@' | sha256sum -c - \
&& tar xf @MINGW_SOURCE@ -C /tmp && rm @MINGW_SOURCE@ \
&& cd /tmp/mingw-w64-v@MINGW_VERSION@/mingw-w64-crt \
&& ./configure --quiet \
--prefix=/usr/@ARCH@-w64-mingw32/ \
--host=@ARCH@-w64-mingw32 \
--enable-wildcard \
MAKEINFO=true || cat config.log \
&& make --quiet -j@J@ MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/mingw-w64-v@MINGW_VERSION@

View file

@ -0,0 +1,35 @@
FROM @PROTONSDK_URLBASE@/binutils-@ARCH@-w64-mingw32:@BINUTILS_VERSION@ AS binutils
FROM @PROTONSDK_URLBASE@/mingw-headers-@ARCH@:@MINGW_VERSION@ AS mingw-headers
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
COPY --from=binutils /opt/usr /usr
COPY --from=mingw-headers /opt/usr /usr
RUN wget -q @GCC_URLBASE@/@GCC_SOURCE@ \
&& echo '@GCC_SHA256@ @GCC_SOURCE@' | sha256sum -c - \
&& tar xf @GCC_SOURCE@ -C /tmp && rm @GCC_SOURCE@ \
&& mkdir /tmp/gcc-@GCC_VERSION@/build && cd /tmp/gcc-@GCC_VERSION@/build \
&& ../configure --quiet \
--prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--host=@ARCH@-linux-gnu \
--build=@ARCH@-linux-gnu \
--target=@ARCH@-w64-mingw32 \
--program-prefix=@ARCH@-w64-mingw32- \
--enable-languages=c \
--disable-bootstrap \
--disable-checking \
--disable-multilib \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-werror \
--with-system-gmp \
--with-system-isl \
--with-system-mpc \
--with-system-mpfr \
--with-system-zlib \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" all-gcc \
&& make --quiet -j@J@ MAKEINFO=true CFLAGS="-static --static" LDFLAGS="-s -static --static" install-strip-gcc DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/gcc-@GCC_VERSION@

View file

@ -0,0 +1,16 @@
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
&& echo '@MINGW_SHA256@ @MINGW_SOURCE@' | sha256sum -c - \
&& tar xf @MINGW_SOURCE@ -C /tmp && rm @MINGW_SOURCE@ \
&& cd /tmp/mingw-w64-v@MINGW_VERSION@/mingw-w64-headers \
&& ./configure --quiet \
--prefix=/usr/@ARCH@-w64-mingw32/ \
--host=@ARCH@-w64-mingw32 \
--enable-sdk=all \
--enable-secure-api \
--enable-idl \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/mingw-w64-v@MINGW_VERSION@

View file

@ -0,0 +1,22 @@
FROM @PROTONSDK_URLBASE@/binutils-@ARCH@-w64-mingw32:@BINUTILS_VERSION@ AS binutils
FROM @PROTONSDK_URLBASE@/mingw-headers-@ARCH@:@MINGW_VERSION@ AS mingw-headers
FROM @PROTONSDK_URLBASE@/mingw-gcc-@ARCH@:@MINGW_VERSION@ AS mingw-gcc
FROM @PROTONSDK_URLBASE@/mingw-crt-@ARCH@:@MINGW_VERSION@ AS mingw-crt
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
COPY --from=binutils /opt/usr /usr
COPY --from=mingw-headers /opt/usr /usr
COPY --from=mingw-gcc /opt/usr /usr
COPY --from=mingw-crt /opt/usr /usr
RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
&& echo '@MINGW_SHA256@ @MINGW_SOURCE@' | sha256sum -c - \
&& tar xf @MINGW_SOURCE@ -C /tmp && rm @MINGW_SOURCE@ \
&& cd /tmp/mingw-w64-v@MINGW_VERSION@/mingw-w64-libraries/winpthreads \
&& ./configure --quiet \
--prefix=/usr/@ARCH@-w64-mingw32/ \
--host=@ARCH@-w64-mingw32 \
--disable-shared \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/mingw-w64-v@MINGW_VERSION@

View file

@ -0,0 +1,16 @@
FROM @PROTONSDK_URLBASE@/build-base-@ARCH@:latest AS build
RUN wget -q @MINGW_URLBASE@/@MINGW_SOURCE@ \
&& echo '@MINGW_SHA256@ @MINGW_SOURCE@' | sha256sum -c - \
&& tar xf @MINGW_SOURCE@ -C /tmp && rm @MINGW_SOURCE@ \
&& cd /tmp/mingw-w64-v@MINGW_VERSION@/mingw-w64-tools/widl \
&& ./configure --quiet \
--prefix=/usr \
--host=@ARCH@-linux-gnu \
--build=@ARCH@-linux-gnu \
--target=@ARCH@-w64-mingw32 \
--program-prefix=@ARCH@-w64-mingw32- \
MAKEINFO=true \
&& make --quiet -j@J@ MAKEINFO=true LDFLAGS="-static" \
&& make --quiet -j@J@ MAKEINFO=true install-strip DESTDIR=/opt \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /tmp/mingw-w64-v@MINGW_VERSION@

View file

@ -0,0 +1,60 @@
FROM @PROTONSDK_URLBASE@/binutils-i686-linux-gnu:@BINUTILS_VERSION@ AS binutils-linux-i686
FROM @PROTONSDK_URLBASE@/binutils-x86_64-linux-gnu:@BINUTILS_VERSION@ AS binutils-linux-x86_64
FROM @PROTONSDK_URLBASE@/binutils-i686-w64-mingw32:@BINUTILS_VERSION@ AS binutils-mingw-i686
FROM @PROTONSDK_URLBASE@/binutils-x86_64-w64-mingw32:@BINUTILS_VERSION@ AS binutils-mingw-x86_64
FROM @PROTONSDK_URLBASE@/mingw-headers-i686:@MINGW_VERSION@ AS mingw-headers-i686
FROM @PROTONSDK_URLBASE@/mingw-headers-x86_64:@MINGW_VERSION@ AS mingw-headers-x86_64
FROM @PROTONSDK_URLBASE@/mingw-crt-i686:@MINGW_VERSION@ AS mingw-crt-i686
FROM @PROTONSDK_URLBASE@/mingw-crt-x86_64:@MINGW_VERSION@ AS mingw-crt-x86_64
FROM @PROTONSDK_URLBASE@/mingw-pthreads-i686:@MINGW_VERSION@ AS mingw-pthreads-i686
FROM @PROTONSDK_URLBASE@/mingw-pthreads-x86_64:@MINGW_VERSION@ AS mingw-pthreads-x86_64
FROM @PROTONSDK_URLBASE@/mingw-widl-i686:@MINGW_VERSION@ AS mingw-widl-i686
FROM @PROTONSDK_URLBASE@/mingw-widl-x86_64:@MINGW_VERSION@ AS mingw-widl-x86_64
FROM @PROTONSDK_URLBASE@/gcc-i686-linux-gnu:@GCC_VERSION@ AS gcc-linux-i686
FROM @PROTONSDK_URLBASE@/gcc-x86_64-linux-gnu:@GCC_VERSION@ AS gcc-linux-x86_64
FROM @PROTONSDK_URLBASE@/gcc-i686-w64-mingw32:@GCC_VERSION@ AS gcc-mingw-i686
FROM @PROTONSDK_URLBASE@/gcc-x86_64-w64-mingw32:@GCC_VERSION@ AS gcc-mingw-x86_64
FROM @BASE_IMAGE@ AS base
COPY --from=binutils-linux-i686 /opt/usr /usr
COPY --from=binutils-linux-x86_64 /opt/usr /usr
COPY --from=binutils-mingw-i686 /opt/usr /usr
COPY --from=binutils-mingw-x86_64 /opt/usr /usr
COPY --from=mingw-headers-i686 /opt/usr /usr
COPY --from=mingw-headers-x86_64 /opt/usr /usr
COPY --from=mingw-crt-i686 /opt/usr /usr
COPY --from=mingw-crt-x86_64 /opt/usr /usr
COPY --from=mingw-pthreads-i686 /opt/usr /usr
COPY --from=mingw-pthreads-x86_64 /opt/usr /usr
COPY --from=mingw-widl-i686 /opt/usr /usr
COPY --from=mingw-widl-x86_64 /opt/usr /usr
COPY --from=gcc-linux-i686 /opt/usr /usr
COPY --from=gcc-linux-x86_64 /opt/usr /usr
COPY --from=gcc-mingw-i686 /opt/usr /usr
COPY --from=gcc-mingw-x86_64 /opt/usr /usr
RUN wget -q @RUST_URLBASE@/@RUST_SOURCE_x86_64@ \
&& echo '@RUST_SHA256_x86_64@ @RUST_SOURCE_x86_64@' | sha256sum -c - \
&& tar xf @RUST_SOURCE_x86_64@ -C /tmp && rm @RUST_SOURCE_x86_64@ \
&& /tmp/rust-@RUST_VERSION@-x86_64-unknown-linux-gnu/install.sh --prefix=/opt/rust \
&& rm -rf /tmp/rust-@RUST_VERSION@-x86_64-unknown-linux-gnu
RUN wget -q @RUST_URLBASE@/@RUST_SOURCE_i686@ \
&& echo '@RUST_SHA256_i686@ @RUST_SOURCE_i686@' | sha256sum -c - \
&& tar xf @RUST_SOURCE_i686@ -C /tmp && rm @RUST_SOURCE_i686@ \
&& /tmp/rust-@RUST_VERSION@-i686-unknown-linux-gnu/install.sh --prefix=/opt/rust \
--components=rust-std-i686-unknown-linux-gnu \
&& rm -rf /tmp/rust-@RUST_VERSION@-i686-unknown-linux-gnu
RUN bash -c 'ls /opt/rust/bin/* | xargs -n1 -I{} ln -sf {} /usr/bin/'
RUN bash -c 'mkdir -p /usr/lib/ccache && ls /usr/bin/{,*-}{cc,c++,gcc,g++}{,-[0-9]*} | sed -re s:/bin:/lib/ccache: | xargs -n1 ln -sf ../../bin/ccache'
ENV PATH=/usr/lib/ccache:$PATH
RUN apt-get install -y \
tini \
&& rm -rf /opt/usr/share/doc /opt/usr/share/info /opt/usr/share/man \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/usr/bin/tini-static", "-s", "-g", "--"]
CMD ["/bin/bash"]