CICD: Add GitHub Action to build the Windows (MXE) Builder Docker Image.

Add a GitHub action that builds the docker image to run builds for the
Windows (MXE) version of Subsurface.
Also update the MXE image Dockerfile to the latest version of MXE, and
add a patch to use a current version of mdbtools.
Configure GitHub actions that do not build docker images to not trigger
on changes to the contents of `scripts/docker/`.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-01-21 01:07:33 +13:00 committed by Dirk Hohndel
parent eea75fc1c4
commit c1bfded4a7
17 changed files with 186 additions and 39 deletions

View file

@ -1,77 +1,94 @@
# Build the image using the --build-arg option, e.g.:
# docker build -t boret/myimage:0.1 --build-arg=mxe_sha=123ABC456 .
#
# Start from Ubuntu
From ubuntu:22.04
FROM ubuntu:22.04 as base
# very often master is broken, so we pass in a known good SHA
ARG mxe_sha=master
ENV _ver=${mxe_sha}
# update and set up the packages we need for this cross build
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# update and set up the packages we need for the build
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
autoconf \
automake \
autopoint \
bash \
binutils \
bison \
bzip2 \
ca-certificates \
flex \
g++ \
g++-multilib \
gettext \
git \
gperf \
intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \
libssl-dev \
libtool \
libtool-bin \
libxml-parser-perl \
make \
openssl \
p7zip-full \
patch \
perl \
pkg-config \
python3 \
python3-mako \
ruby \
sed \
unzip \
wget \
lzip && \
apt-get clean
FROM base as build
# set up the packages we need additionally for this cross build
RUN apt-get install -y \
bison \
flex \
gperf \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libxml-parser-perl \
python3 \
python3-mako \
python-is-python3 \
ruby \
xz-utils \
lzip \
scons
# very often master is broken, so we pass in a known good SHA
ARG mxe_sha=master
ENV _ver=${mxe_sha}
WORKDIR /win
# checkout MXE at the right version
RUN mkdir -p /win
RUN cd /win ; git clone https://github.com/mxe/mxe ; \
cd mxe ; \
git checkout ${_ver} ;
RUN git clone https://github.com/mxe/mxe && \
cd mxe && \
git checkout ${_ver}
WORKDIR /win/mxe
# Move the settings into place to build everything that we need
ADD settings.mk .
# Patch the qtconnectivity build to explicilty enable native-win32-bluetooth and ensure another
# backend is not picked
ADD qtconnectivity-1.patch /win/mxe/src/qtconnectivity-1.patch
ADD qtconnectivity-1.patch src/
ADD mdbtools_version.patch .
RUN patch -p1 < mdbtools_version.patch 2>&1 | tee mxe-patch.log
# Move the settings into place to build everything that we need
# separate download from build so that we can redo the build
ADD settings.mk /win/mxe/settings.mk
RUN cd /usr/bin ; ln -s -f python3 python
RUN cd /win/mxe ; \
make -j 6 download 2>&1 | tee mxe-build.log
RUN cd /win/mxe ; \
make -j 6 2>&1 | tee -a mxe-build.log ;
RUN make -j download 2>&1 | tee mxe-build.log
RUN make -j 2>&1 | tee -a mxe-build.log
# for some reason smtk2ssrf needs a static build of mdbtools
RUN cd /win/mxe ; \
make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 6 2>&1 | tee -a mxe-build.log ;
RUN make MXE_TARGETS=x86_64-w64-mingw32.static glib mdbtools -j 2>&1 | tee -a mxe-build.log
RUN apt-get remove -y bison flex gperf libc6-dev-i386 libgdk-pixbuf2.0-dev libxml-parser-perl python ruby xz-utils scons && rm -rf /var/lib/apt/lists/*
RUN rm -rf /win/mxe/pkg /win/mxe/log /win/mxe/docs
RUN rm -rf pkg log docs
FROM base as final
WORKDIR /win
COPY --from=build /win/mxe mxe