diff --git a/scripts/docker/mxe-build-container/Dockerfile-stage1 b/scripts/docker/mxe-build-container/Dockerfile similarity index 61% rename from scripts/docker/mxe-build-container/Dockerfile-stage1 rename to scripts/docker/mxe-build-container/Dockerfile index 056e6fa8e..aac9558ad 100644 --- a/scripts/docker/mxe-build-container/Dockerfile-stage1 +++ b/scripts/docker/mxe-build-container/Dockerfile @@ -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 ; diff --git a/scripts/docker/mxe-build-container/build-container.sh b/scripts/docker/mxe-build-container/build-container.sh index 1f5e1eddc..8821602d6 100644 --- a/scripts/docker/mxe-build-container/build-container.sh +++ b/scripts/docker/mxe-build-container/build-container.sh @@ -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 diff --git a/scripts/docker/mxe-build-container/settings.mk b/scripts/docker/mxe-build-container/settings.mk new file mode 100644 index 000000000..87591d7ac --- /dev/null +++ b/scripts/docker/mxe-build-container/settings.mk @@ -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)