docker-mingw-arch
docker-mingw-arch copied to clipboard
mingw-based build environment based on arch-linux. Easy cross-compilation for windows target.
MinGW-arch
mingw-based build environment based on arch-linux. The image provides an easy to use cross-compilation for windows target. It is also CI-friendly. mingw- versions of Qt5, cmake, Eigen3, boost are included. Dosens of other libraries are available from the package manager.
Table of Contents
- Usage
- Continuous Integration
- Dependencies
- Supported tags
Usage
Start the docker container:
sudo docker run -it burningdaylight/mingw-arch:qt /bin/bash
Compile your application (QNapi is used as an example here):
git clone --recursive 'https://github.com/QNapi/qnapi.git'
cd qnapi/
x86_64-w64-mingw32-qmake-qt5
make
Or for CMake:
x86_64-w64-mingw32-cmake ..
To deploy the program, you will need to copy the dlls from /usr/{x86_64-w64-mingw32,i686-w64-mingw32}/{bin,lib/qt/plugins/{imageformats,iconengines,platforms}}
(for x64 and x32 builds respectively) to the directory with the .exe file. The list of necessary dlls may vary. If a dll is missing, Windows will usually show an error popup window with the name of the missing dll, when you try to start the program.
That's it!
Continuous Integration
For Gitlab CI the config file could look something like this:
build-win64:
stage: compile
image: burningdaylight/mingw-arch:qt
script:
- mkdir -p ${CI_BUILD_NAME}
- cd ${CI_BUILD_NAME}; x86_64-w64-mingw32-qmake-qt5 ..; make
artifacts:
paths:
- "${CI_BUILD_NAME}/src/*/release/*.exe"
- "${CI_BUILD_NAME}/src/*/release/*.dll"
You can also check out the a full .gitlab-ci.yml file.
Dependencies
If you need some other dependencies, you can install them from AUR.
yay -S --noconfirm 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.
Supported tags
-
base
minimal cross-compilation environment which includesyay
to install additional libraries from AUR and a small set of mingw-w64- packages:cmake
,gcc
,zlib
-
latest
,qt
full-blown cross-compilation environment, which includesQt5
,boost
,openssl
, etc.