mirror of
https://github.com/godotengine/build-containers.git
synced 2026-01-04 18:10:06 +03:00
Adds support for building Mono templates for Android in 3.2/master. We use the script from https://github.com/godotengine/godot-mono-builds to build Mono for all arches with the right options, and a patch included from https://github.com/godotengine/godot/blob/master/modules/mono/build_scripts/patches/fix-mono-android-tkill.diff which is also necessary. I also moved the SDK to a `sdk` folder to make the `$HOME` more tidy, especially since the Mono build scripts install the mono toolchains in `$HOME` too by default. Using a git clone for specific mono version tag, as the upstream tarballs are iffy (the 5.18.1.3 tarball lacks files needed to build on Android).
31 lines
1.2 KiB
Docker
31 lines
1.2 KiB
Docker
ARG mono_version
|
|
FROM godot-mono:${mono_version}
|
|
ARG mono_version
|
|
|
|
RUN dnf -y install scons java-1.8.0-openjdk-devel ncurses-compat-libs unzip which gcc gcc-c++ && \
|
|
mkdir sdk && cd sdk && \
|
|
curl -LO https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
|
|
unzip sdk-tools-linux-4333796.zip && \
|
|
rm sdk-tools-linux-4333796.zip && \
|
|
yes | tools/bin/sdkmanager --licenses && \
|
|
tools/bin/sdkmanager ndk-bundle 'build-tools;28.0.3' 'platforms;android-28' 'cmake;3.10.2.4988404' && \
|
|
cd ..
|
|
|
|
ENV ANDROID_HOME=/root/sdk/
|
|
ENV ANDROID_NDK_ROOT=/root/sdk/ndk-bundle/
|
|
|
|
RUN dnf -y install git patch && \
|
|
git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
|
|
cd mono && git submodule update --init && \
|
|
patch -p1 < /root/files/patches/fix-mono-android-tkill.diff && \
|
|
cd .. && \
|
|
git clone https://github.com/godotengine/godot-mono-builds && \
|
|
cd godot-mono-builds && \
|
|
git checkout 9efec19e6b61fdc7201067cff4dd5b741399ae31 && \
|
|
./build_mono_android.py configure --target=all --mono-sources=/root/mono && \
|
|
./build_mono_android.py make --target=all --mono-sources=/root/mono && \
|
|
cd .. && \
|
|
rm -rf /root/mono /root/godot-mono-builds
|
|
|
|
CMD ['/bin/bash']
|