WIP: single stage Docker build for 64bit MXE

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-10-28 14:19:45 -07:00
parent 0a3007836f
commit 24bf9540cc
3 changed files with 60 additions and 12 deletions

View file

@ -3,13 +3,15 @@
#
# Start from Ubuntu
From ubuntu:18.04
From ubuntu:20.04
# 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 && \
apt-get install -y \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
autoconf \
automake \
autopoint \
@ -47,18 +49,24 @@ apt-get install -y \
lzip \
scons
# copy over the partial MXE settings (simply missing QtWebKit so we don't exceed the 6h limit)
# checkout MXE at the right version
RUN mkdir -p /win
ADD settings-stage1.mk /win/settings.mk
RUN cd /win ; git clone git://github.com/mxe/mxe ; \
cd mxe ; \
git checkout ${_ver} ;
# Patch the qtconnectivity build to explicilty enable native-win32-bluetooth and ensure another
# backend is not picked
ADD qtconnectivity-1.patch /win/qtconnectivity-1.patch
RUN mv /win/qtconnectivity-1.patch /win/mxe/src
RUN mv /win/settings.mk /win/mxe
ADD qtconnectivity-1.patch /win/mxe/src/qtconnectivity-1.patch
# 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 /win/mxe ; \
make -j 6 2>&1 | tee build.log ;
make -j 6 download 2>&1 | tee mxe-build.log
RUN cd /win/mxe ; \
make MXE_TARGETS=i686-w64-mingw32.static glib -j 6 2>&1 | tee -a build.log ;
make -j 6 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 ;

View file

@ -2,10 +2,13 @@
set -x
set -e
# known good MXE sha
MXE_SHA="8966a64"
SCRIPTPATH=$(dirname $0)
export VERSION=1.1
# version of the docker image
VERSION=2.0
pushd $SCRIPTPATH
docker build -t subsurface/mxe-build-container:$VERSION --build-arg=mxe_sha=1ee37f8 -f Dockerfile-stage1 .
docker build -t subsurface/mxe-build-container:$VERSION --build-arg=VERSION=$VERSION -f Dockerfile-stage2 .
docker build -t subsurface/mxe-build-container:$VERSION --build-arg=mxe_sha=$MXE_SHA -f Dockerfile .
popd

View file

@ -0,0 +1,37 @@
# This is a template of configuration file for MXE. See
# index.html for more extensive documentations.
# This variable controls the number of compilation processes
# within one package ("intra-package parallelism").
JOBS := 8
# This variable controls the targets that will build.
MXE_TARGETS := x86_64-w64-mingw32.shared
# The three lines below makes `make` build these "local packages" instead of all packages.
LOCAL_PKG_LIST := nsis \
curl \
libxml2 \
libxslt \
libzip \
libusb1 \
hidapi \
libgit2 \
libftdi1 \
mdbtools \
qtbase \
qtconnectivity \
qtdeclarative \
qtimageformats \
qtlocation \
qtmultimedia \
qtwebkit \
qtquickcontrols \
qtquickcontrols2 \
qtcharts \
qtsvg \
qttools \
qttranslations \
zstd
.DEFAULT local-pkg-list:
local-pkg-list: $(LOCAL_PKG_LIST)