Docker image for MinGW-w64 build environment
based on Arch Linux. The image provides simple cross-compilation environment for windows 32/64bit builds. Amongst other MinGW binaries/libraries image includes GCC, CMake, GNU Autotools, Meson, FFMPEG, Qt5, KF5, Boost
.
This script was inspired by mdimura/docker-mingw-qt5
You can pull latest docker image with:
sudo docker pull maxrd2/arch-mingw
If you prefer to build it on your machine:
git clone https://github.com/maxrd2/arch-mingw.git && cd arch-mingw
sudo docker build -t maxrd2/arch-mingw -f Dockerfile .
Start the docker container (replace some-local-path
with dir to mount as docker home):
sudo docker run -v some-local-path:/home/devel -it maxrd2/arch-mingw /bin/bash
Compile your application:
git clone 'https://github.com/maxrd2/DivvyDroid.git'
mkdir DivvyDroid/build
sudo docker run -v DivvyDroid:/home/devel --rm -it maxrd2/arch-mingw /bin/bash -c "\
cd build && \
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. && \
make -j\$(nproc) nsis \
"
ls -l build # windows binaries
cmake, configure, etc commands should be prefixed by i686/x86_64 for 32/64bit builds e.g. i686-w64-mingw32-cmake
, x86_64-w64-mingw32-configure
Extra/missing dependencies can be installed from AUR
pacaur -S mingw-w64-rapidjson
If mingw- version of the needed libarary is not available in AUR, you can add it yourself. The process is really straightforward. You would need to write a PKBUILD file, which is as intuitive as it can get, see mingw-w64-rapidjson, for example.