mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-28 06:57:37 +00:00
build: modernize dockerfile, make more reproducible
This commit is contained in:
parent
f225dd03bc
commit
70f4bbb828
@ -1,26 +1,74 @@
|
|||||||
FROM docker.io/library/debian:stable-slim
|
FROM scratch AS zipdeps
|
||||||
|
|
||||||
|
ARG CMAKE_VERSION=3.26.6
|
||||||
|
ARG NINJA_VERSION=1.12.1
|
||||||
|
|
||||||
|
ADD --checksum=sha256:7947618912e2c2f48f987631e29e318e56ccda551a7b65364c8a3f743e719ac5 \
|
||||||
|
https://github.com/itsmattkc/MSVC420/archive/df2c13aad74c094988c6c7e784234c2e778a0e91.zip \
|
||||||
|
msvc.zip
|
||||||
|
ADD --checksum=sha256:dc3f535d880d1ffa7cfa86a0eefdc1fc9bf8b9ede59d1deb7a2bb41f0a58d2d4 \
|
||||||
|
https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-windows-i386.zip \
|
||||||
|
cmake.zip
|
||||||
|
ADD --checksum=sha256:f550fec705b6d6ff58f2db3c374c2277a37691678d6aba463adcbb129108467a \
|
||||||
|
https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-win.zip \
|
||||||
|
ninja.zip
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
# Gather dependencies
|
# Gather dependencies
|
||||||
RUN dpkg --add-architecture i386
|
RUN <<EOF
|
||||||
RUN apt-get update -y
|
dpkg --add-architecture i386
|
||||||
RUN apt-get install git wine wine64 wine32 wget unzip -y
|
apt-get update -y
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libarchive-tools \
|
||||||
|
wine \
|
||||||
|
wine32 \
|
||||||
|
wine64
|
||||||
|
EOF
|
||||||
|
|
||||||
# Silence debug warnings in wine (creates noise during compile)
|
# Silence debug warnings in wine (creates noise during compile)
|
||||||
RUN export WINEDEBUG=-all
|
ARG WINEDEBUG=-all
|
||||||
|
ARG WINEPREFIX=/root/.wine
|
||||||
# Set up the wineprefix
|
|
||||||
RUN wine wineboot
|
RUN wine wineboot
|
||||||
|
|
||||||
# Set up MSVC 4.20 and CMake for Windows
|
# extract everything
|
||||||
RUN git clone https://github.com/itsmattkc/MSVC420 ~/.wine/drive_c/msvc
|
RUN --mount=from=zipdeps,target=/zipdeps <<EOF
|
||||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.6/cmake-3.26.6-windows-i386.zip
|
extract() {
|
||||||
RUN unzip cmake-3.26.6-windows-i386.zip -d ~/.wine/drive_c
|
p="$WINEPREFIX/drive_c/$1"
|
||||||
RUN mv ~/.wine/drive_c/cmake-3.26.6-windows-i386 ~/.wine/drive_c/cmake
|
dep="/zipdeps/$1.zip"
|
||||||
RUN rm cmake-3.26.6-windows-i386.zip
|
shift
|
||||||
|
|
||||||
RUN wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip
|
mkdir -p "$p" && bsdtar -oxvf "$dep" -C "$p" $@
|
||||||
RUN unzip ninja-win.zip -d ~/.wine/drive_c
|
}
|
||||||
RUN rm ninja-win.zip
|
|
||||||
|
extract cmake --strip-components 1
|
||||||
|
extract msvc --strip-components 1
|
||||||
|
extract ninja
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# remove clutter
|
||||||
|
RUN <<EOF
|
||||||
|
apt-get remove --purge libarchive-tools
|
||||||
|
apt-get clean
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Populate the Windows path inside of the wineprefix
|
||||||
|
RUN <<EOF
|
||||||
|
setenv() {
|
||||||
|
wine reg ADD 'HKCU\Environment' /v "$1" /d "$2" /f
|
||||||
|
# wine doesn't set it synchronously, server gets cut off by docker if you
|
||||||
|
# don't give it enough time
|
||||||
|
sleep 0.5
|
||||||
|
}
|
||||||
|
setenv PATH 'C:\msvc\bin;C:\msvc\bin\winnt;C:\cmake\bin;C:\windows\system32;C:\ninja'
|
||||||
|
setenv INCLUDE 'C:\msvc\include;C:\msvc\mfc\include'
|
||||||
|
setenv LIB 'C:\msvc\lib;C:\msvc\mfc\lib'
|
||||||
|
setenv TMP 'Z:\build'
|
||||||
|
setenv TEMP 'Z:\build'
|
||||||
|
EOF
|
||||||
|
|
||||||
# Set up entrypoint script to perform the build
|
# Set up entrypoint script to perform the build
|
||||||
COPY entrypoint.sh entrypoint.sh
|
COPY entrypoint.sh entrypoint.sh
|
||||||
|
|||||||
@ -48,7 +48,7 @@ trap cleanup EXIT
|
|||||||
mkdir -p result
|
mkdir -p result
|
||||||
rm -rf result/*
|
rm -rf result/*
|
||||||
|
|
||||||
if [[ "x${JOBS:-}" == "x" ]]; then
|
if [ "x${JOBS:-}" = "x" ]; then
|
||||||
JOBS=$(nproc)
|
JOBS=$(nproc)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Populate the Windows path inside of the wineprefix
|
set -e
|
||||||
# TODO: This is in here because writing to the registry seems
|
|
||||||
# to fail when performed in the Dockerfile itself; investigate
|
|
||||||
wine reg ADD 'HKCU\Environment' /v PATH /d 'C:\msvc\bin;C:\msvc\bin\winnt;C:\cmake\bin;C:\windows\system32;C:\' /f
|
|
||||||
wine reg ADD 'HKCU\Environment' /v INCLUDE /d 'C:\msvc\include;C:\msvc\mfc\include' /f
|
|
||||||
wine reg ADD 'HKCU\Environment' /v LIB /d 'C:\msvc\lib;C:\msvc\mfc\lib' /f
|
|
||||||
wine reg ADD 'HKCU\Environment' /v TMP /d 'Z:\build' /f
|
|
||||||
wine reg ADD 'HKCU\Environment' /v TEMP /d 'Z:\build' /f
|
|
||||||
|
|
||||||
# Configure build with CMake
|
# Configure build with CMake
|
||||||
wine cmake -B build isle -G "Ninja" $CMAKE_FLAGS
|
wine cmake -B build isle -G "Ninja" $CMAKE_FLAGS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user