2018-06-09 07:20:20 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Before including this script, make sure to set:
|
|
|
|
#
|
|
|
|
# WINEARCH environment variable to either "win64" or "win32"
|
|
|
|
# MXE_TARGET_ARCH argument to either "x86_64" or "i686". See http://mxe.cc/
|
2018-06-10 10:33:23 +02:00
|
|
|
# MXE_TARGET_THREAD argument to either "" or ".posix". Default is win32. See http://mxe.cc/
|
2018-10-08 14:34:13 +02:00
|
|
|
# MXE_TARGET_LINK argument to either "static" or "shared"
|
2018-06-09 07:20:20 +02:00
|
|
|
#
|
|
|
|
# For example:
|
|
|
|
#
|
|
|
|
# ENV WINEARCH win64
|
|
|
|
# ARG MXE_TARGET_ARCH=x86_64
|
2018-06-10 10:33:23 +02:00
|
|
|
# ARG MXE_TARGET_THREAD=
|
2018-10-08 14:34:13 +02:00
|
|
|
# ARG MXE_TARGET_LINK=shared
|
2018-06-09 07:20:20 +02:00
|
|
|
#
|
|
|
|
|
2024-07-23 00:22:50 +02:00
|
|
|
# mxe master 2024-07-27
|
|
|
|
ARG MXE_GIT_TAG=9f349e0de62a4a68bfc0f13d835a6c685dae9daa
|
2018-06-09 07:20:20 +02:00
|
|
|
|
2018-10-08 14:34:13 +02:00
|
|
|
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}/share/cmake/mxe-conf.cmake
|
2018-06-09 07:20:20 +02:00
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
#
|
|
|
|
# WINE is used as an emulator for try_run and tests with CMake.
|
|
|
|
#
|
|
|
|
# Other dependencies are from the listed MXE requirements:
|
|
|
|
# http://mxe.cc/#requirements
|
|
|
|
# 'cmake' is omitted because it is installed from source in the base image
|
|
|
|
#
|
|
|
|
RUN \
|
|
|
|
apt-get update && \
|
2018-06-11 23:21:02 +02:00
|
|
|
apt-get install --no-install-recommends --yes \
|
2018-06-09 07:20:20 +02:00
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
autopoint \
|
|
|
|
bash \
|
|
|
|
bison \
|
|
|
|
bzip2 \
|
|
|
|
flex \
|
|
|
|
gettext \
|
|
|
|
git \
|
|
|
|
g++ \
|
|
|
|
g++-multilib \
|
|
|
|
gperf \
|
|
|
|
intltool \
|
|
|
|
libffi-dev \
|
|
|
|
libgdk-pixbuf2.0-dev \
|
|
|
|
libtool-bin \
|
|
|
|
libltdl-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libxml-parser-perl \
|
|
|
|
libc6-dev-i386 \
|
2019-02-28 20:59:50 +01:00
|
|
|
lzip \
|
2018-06-09 07:20:20 +02:00
|
|
|
make \
|
2021-10-11 12:49:53 +02:00
|
|
|
nsis \
|
2018-06-09 07:20:20 +02:00
|
|
|
openssl \
|
2021-11-03 16:15:24 +01:00
|
|
|
osslsigncode \
|
2018-06-09 07:20:20 +02:00
|
|
|
p7zip-full \
|
|
|
|
patch \
|
|
|
|
perl \
|
|
|
|
pkg-config \
|
2023-11-07 12:08:01 +01:00
|
|
|
python3 \
|
2018-06-09 07:20:20 +02:00
|
|
|
ruby \
|
|
|
|
scons \
|
|
|
|
sed \
|
|
|
|
unzip \
|
|
|
|
wget \
|
|
|
|
wine \
|
|
|
|
xz-utils \
|
2024-07-23 00:22:50 +02:00
|
|
|
python3-mako \
|
2018-06-09 07:20:20 +02:00
|
|
|
&& \
|
|
|
|
#
|
|
|
|
# Install Wine
|
|
|
|
#
|
|
|
|
dpkg --add-architecture i386 && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y wine32 && \
|
|
|
|
wine hostname && \
|
|
|
|
#
|
|
|
|
# Download MXE sources
|
|
|
|
#
|
|
|
|
cd /usr/src && \
|
|
|
|
git clone https://github.com/mxe/mxe.git && \
|
|
|
|
cd mxe && \
|
|
|
|
git checkout ${MXE_GIT_TAG} && \
|
|
|
|
#
|
|
|
|
# Configure "settings.mk" required to build MXE
|
|
|
|
#
|
|
|
|
cd /usr/src/mxe && \
|
2018-10-08 14:34:13 +02:00
|
|
|
echo "MXE_TARGETS := ${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}" > settings.mk && \
|
2019-12-04 08:21:09 +01:00
|
|
|
echo "MXE_USE_CCACHE :=" >> settings.mk && \
|
2021-07-08 13:20:36 +02:00
|
|
|
echo "MXE_PLUGIN_DIRS := plugins/gcc11" >> settings.mk && \
|
2018-09-12 21:21:30 +02:00
|
|
|
echo "LOCAL_PKG_LIST := cc cmake" >> settings.mk && \
|
2018-06-10 10:33:23 +02:00
|
|
|
echo ".DEFAULT local-pkg-list:" >> settings.mk && \
|
|
|
|
echo "local-pkg-list: \$(LOCAL_PKG_LIST)" >> settings.mk && \
|
2018-06-09 07:20:20 +02:00
|
|
|
#
|
|
|
|
# Build MXE
|
|
|
|
#
|
|
|
|
cd /usr/src/mxe && \
|
2019-12-03 14:14:15 +01:00
|
|
|
make JOBS=$(nproc) && \
|
2018-06-09 07:20:20 +02:00
|
|
|
#
|
2018-06-11 15:25:14 +02:00
|
|
|
# Cleanup: By keeping the MXE build system (Makefile, ...), derived images will be able to install
|
|
|
|
# additional packages.
|
2018-06-10 00:23:50 +02:00
|
|
|
#
|
2018-07-23 08:31:13 +02:00
|
|
|
rm -rf log pkg && \
|
2018-06-10 00:23:50 +02:00
|
|
|
#
|
2018-06-09 07:20:20 +02:00
|
|
|
# Update MXE toolchain file
|
|
|
|
#
|
|
|
|
echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE} && \
|
|
|
|
#
|
2021-10-11 12:49:53 +02:00
|
|
|
# Add a sysmbolic link for makensis
|
|
|
|
#
|
|
|
|
ln -s /usr/bin/makensis /usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}-makensis && \
|
|
|
|
#
|
2018-06-09 07:20:20 +02:00
|
|
|
# Replace cmake and cpack binaries
|
|
|
|
#
|
|
|
|
cd /usr/bin && \
|
|
|
|
rm cmake cpack && \
|
2018-10-08 14:34:13 +02:00
|
|
|
ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}-cmake cmake && \
|
2021-10-11 12:22:05 +02:00
|
|
|
ln -s /usr/src/mxe/usr/bin/${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}-cpack cpack && \
|
|
|
|
#
|
|
|
|
# clean up temporary wine files
|
|
|
|
#
|
|
|
|
rm -rf /tmp/wine-*
|
2018-06-09 07:20:20 +02:00
|
|
|
|
|
|
|
ENV PATH ${PATH}:/usr/src/mxe/usr/bin
|
2018-10-08 14:34:13 +02:00
|
|
|
ENV CROSS_TRIPLE ${MXE_TARGET_ARCH}-w64-mingw32.${MXE_TARGET_LINK}${MXE_TARGET_THREAD}
|
2018-06-09 07:20:20 +02:00
|
|
|
ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
|
|
|
|
AR=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ar \
|
|
|
|
CC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gcc \
|
|
|
|
CPP=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-cpp \
|
|
|
|
CXX=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-g++ \
|
|
|
|
LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld \
|
|
|
|
FC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gfortran
|
|
|
|
|
|
|
|
WORKDIR /work
|