mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 03:00:03 +00:00
Add dockerfile for making mingw cross-compile builds
This commit is contained in:
parent
4638a4b5b8
commit
42293897e5
5
utils/dockerbuilds/make_mingw_build
Executable file
5
utils/dockerbuilds/make_mingw_build
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh -xe
|
||||||
|
|
||||||
|
cd mingw
|
||||||
|
docker build -t mingw-wesnoth .
|
||||||
|
docker run -it -v "$PWD"/../../..:/wesnoth -v "$PWD"/../mingwbuild:/output mingw-wesnoth
|
20
utils/dockerbuilds/mingw/Dockerfile
Normal file
20
utils/dockerbuilds/mingw/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM rwgrim/msys2-cross
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y scons g++-mingw-w64-x86-64 pkg-config python3-pefile && \
|
||||||
|
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-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-SDL2_ttf \
|
||||||
|
mingw-w64-x86_64-pango
|
||||||
|
|
||||||
|
COPY get_dlls.py /scripts/get_dlls.py
|
||||||
|
|
||||||
|
ENTRYPOINT mkdir /build && cd /build && scons -j `nproc` arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32 -Y /wesnoth && cp /build/wesnoth.exe /output/ && cd /output && python3 /scripts/get_dlls.py
|
18
utils/dockerbuilds/mingw/get_dlls.py
Executable file
18
utils/dockerbuilds/mingw/get_dlls.py
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/env python
|
||||||
|
|
||||||
|
import pefile, pathlib, shutil
|
||||||
|
|
||||||
|
dlls = set()
|
||||||
|
dllpath = pathlib.Path('/windows/mingw64/bin')
|
||||||
|
pe_modules = set([pefile.PE('wesnoth.exe')])
|
||||||
|
|
||||||
|
while pe_modules:
|
||||||
|
pe = pe_modules.pop()
|
||||||
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||||
|
path = dllpath / pathlib.Path(entry.dll.decode())
|
||||||
|
if path not in dlls and path.exists():
|
||||||
|
dlls.add(path)
|
||||||
|
pe_modules.add(pefile.PE(path))
|
||||||
|
|
||||||
|
for dll in dlls:
|
||||||
|
shutil.copy(dll, ".")
|
Loading…
x
Reference in New Issue
Block a user