/
Dockerfile.mingw64
92 lines (84 loc) · 3.99 KB
/
Dockerfile.mingw64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# Copyright 2022 The Geany contributors
# License: GPLv2
#
# Docker image for Geany and Geany-Plugins cross-build to Windows
# The image contains a self-compiled Pacman to install mingw-w64
# packages and all other dependencies necessary to build the code
# and create a ready-use installer.
# For more details, see build_mingw64_geany.sh where this image is used.
#
FROM debian:bullseye
# Find the latest version on https://packages.msys2.org/package/msys2-keyring
ENV MSYS2_KEYRING_PKG="msys2-keyring-1~20230703-1-any.pkg.tar.zst"
ENV MSYS2_KEYRING_PKG_SHA256="368f7b0a5434feadb512656134f4e721194c258b87b87f7139a15c1c5a51ad5c"
LABEL org.opencontainers.image.title="Geany-Mingw-w64-CI"
LABEL org.opencontainers.image.description="Build image for Geany CI to support automatic building of Windows installers."
LABEL org.opencontainers.image.url="https://github.com/geany/infrastructure"
LABEL org.opencontainers.image.source="https://github.com/geany/infrastructure"
LABEL org.opencontainers.image.authors="The Geany contributors"
LABEL org.opencontainers.image.licenses="GPL-2.0"
# install native tools and libraries
RUN set -ex && \
# ensure /etc/mtab is available, pacman depends on it
test -e /etc/mtab || ln -s /proc/mounts /etc/mtab && \
# add i386 architecture for mingw64
dpkg --add-architecture i386 && \
# add Debian backports for "pacman" package manager, can be removed after updating this image to Debian Bookworm
echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && \
apt-get update && \
apt-get install --no-install-recommends --assume-yes \
# libraries \
libcurl3-gnutls libgpgme11 libarchive13 libssl1.1 \
# common useful utilities \
wget curl less nano git gnupg2 file ca-certificates \
zip unzip xz-utils zstd \
# pacman package manager \
pacman-package-manager archlinux-keyring makepkg \
# build tools \
build-essential automake autoconf autopoint gettext libtool check cppcheck \
# geany-plugins autogen.sh requirements
intltool libglib2.0-dev \
# mingw-w64 \
gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools \
# install wine to test installer and created binaries
wine wine32 wine64 \
# install NSIS and exiftool to inspect binary metadata
nsis libimage-exiftool-perl osslsigncode \
# Geany build dependencies \
python3-lxml python3-docutils && \
# Use the "posix" variant of the mingw64 cross compiler to have support for recent C++ features
# like "std:future", see
# https://salsa.debian.org/mingw-w64-team/gcc-mingw-w64/-/blob/master/debian/gcc-mingw-w64-base.README.Debian
# and https://sourceforge.net/p/mingw-w64/bugs/959/ for details.
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
# copy scripts
COPY mingw64/bin/ /usr/local/bin/
COPY mingw64/etc/ /etc/
RUN mkdir /build /windows
WORKDIR /build
# start wine to initially create config directory
RUN set -e && \
/usr/local/bin/mingw-w64-i686-wine hostname.exe && \
/usr/local/bin/mingw-w64-x86_64-wine hostname.exe && \
# download MSYS2 keyring
wget --no-verbose "https://repo.msys2.org/msys/x86_64/${MSYS2_KEYRING_PKG}" && \
echo "${MSYS2_KEYRING_PKG_SHA256} *${MSYS2_KEYRING_PKG}" | sha256sum --check --strict - && \
tar -x -C /usr/share/keyrings/ -f "${MSYS2_KEYRING_PKG}" --strip-components 4 usr && \
rm "${MSYS2_KEYRING_PKG}" && \
# initialize keyring
pacman-key --init && \
pacman-key --populate msys2 && \
# install GTK3 and all its dependencies
pacman --noconfirm -Sy mingw-w64-x86_64-gtk3 && \
# cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
yes | pacman -Scc && \
rm -r /usr/share/doc \
/usr/share/locale \
/usr/share/man \
/windows/mingw64/share/icons \
/windows/mingw64/share/locale \
/windows/mingw64/share/doc