Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement mingw cross-compile docker image #6568

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions utils/dockerbuilds/CI/Dockerfile-base-mingw
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM rwgrim/msys2-cross
ENV DEBIAN_FRONTEND=noninteractive
FROM wesnoth/wesnoth:msys2-base

RUN apt-get update && \
apt-get install -y scons g++-mingw-w64-x86-64 pkg-config python3-pefile expect nsis gettext git && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix && \
apt-get clean && \
rm -rf /var/lib/apt/lists
RUN pacman -S --noconfirm scons mingw-w64-gcc pkg-config python-pefile expect nsis git

RUN pacman-cross -S --noconfirm \
mingw-w64-x86_64-boost \
mingw-w64-x86_64-SDL2 \
mingw-w64-x86_64-SDL2_image \
mingw-w64-x86_64-SDL2_mixer \
mingw-w64-x86_64-pango

#symlink for compatibility with previous Dockerfiles
RUN ln -s /msys64 /windows
2 changes: 1 addition & 1 deletion utils/dockerbuilds/mingw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ENV DEBIAN_FRONTEND=noninteractive

COPY get_dlls.py /scripts/get_dlls.py

ENTRYPOINT cd /output && scons -j `nproc` arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32 -Y /wesnoth && python3 /scripts/get_dlls.py && rm -rf packaging && ln -sf /wesnoth/doc /wesnoth/packaging /wesnoth/data /wesnoth/fonts /wesnoth/images /wesnoth/sounds /wesnoth/README.md /wesnoth/copyright /wesnoth/COPYING /wesnoth/changelog.md /wesnoth/cwesnoth.cmd . && scons -Y /wesnoth windows-installer
ENTRYPOINT cd /output && scons -j `nproc` arch=x86-64 prefix=/msys64/mingw64 gtkdir=/msys64/mingw64 host=x86_64-w64-mingw32 -Y /wesnoth && python3 /scripts/get_dlls.py && rm -rf packaging && ln -sf /wesnoth/doc /wesnoth/packaging /wesnoth/data /wesnoth/fonts /wesnoth/images /wesnoth/sounds /wesnoth/README.md /wesnoth/copyright /wesnoth/COPYING /wesnoth/changelog.md /wesnoth/cwesnoth.cmd . && scons -Y /wesnoth windows-installer
24 changes: 24 additions & 0 deletions utils/dockerbuilds/msys2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM archlinux

# Add ownstuff third party repository because nsis is unavailable from default archlinux repos
COPY ownstuff.conf ownstuff.conf
RUN cat < ownstuff.conf >> /etc/pacman.conf

RUN pacman --noconfirm -Syu && pacman --noconfirm -S wget

# Trust ownstuff repo key to avoid prompts when installing nsis
RUN pacman-key --init && \
pacman-key --recv-keys B9E36A7275FC61B464B67907E06FE8F53CDC6A4C && \
pacman-key --lsign-key B9E36A7275FC61B464B67907E06FE8F53CDC6A4C

RUN wget https://github.com/msys2/msys2-installer/releases/download/2022-03-19/msys2-base-x86_64-20220319.tar.xz && \
tar xJvf msys2-base-x86_64-20220319.tar.xz && \
cp /msys64/etc/pacman.d/* /etc/pacman.d/ && \
cp /msys64/usr/share/pacman/keyrings/* /usr/share/pacman/keyrings/

# setup msys2 keys
RUN pacman-key --populate msys2

RUN pacman --root /msys64 --config /msys64/etc/pacman.conf -Syu

COPY bin/pacman-cross /bin/pacman-cross
3 changes: 3 additions & 0 deletions utils/dockerbuilds/msys2/bin/pacman-cross
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
pacman --root /msys64 --config /msys64/etc/pacman.conf $@
exit $?
3 changes: 3 additions & 0 deletions utils/dockerbuilds/msys2/ownstuff.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[ownstuff]
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch
Server = https://martchus.no-ip.biz/repo/arch/$repo/os/$arch