Skip to content

Conversation

@akien-mga
Copy link
Member

Adds support for building Mono templates for Android in 3.2/master.
Expects mono 6.0+ (otherwise we'd have to handle the tarball compression
change from upstream).

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
in 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.

@akien-mga akien-mga added the enhancement New feature or request label Aug 31, 2019
@akien-mga akien-mga requested a review from hpvb August 31, 2019 11:23
@akien-mga akien-mga force-pushed the android-mono branch 2 times, most recently from 0ca5495 to 38e6089 Compare August 31, 2019 14:14
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).
@akien-mga
Copy link
Member Author

I did the requested changes.

I also added some changes I had locally but not pushed to git yet, namely changing from using the upstream tarball to using a git clone for a specific release tag.
Mono upstream seems to have bugs in their tarball generation, and the 5.18.1.3 tarball lacked two files needed to build on Android, even though they are included in the 5.18.1.3 tag:

/root/mono-5.18.1.3/mono/metadata/../../support/libm/complex.c:19:10: fatal error: 'math_private.h' file not found
#include "math_private.h"
         ^~~~~~~~~~~~~~~~

So far this was only done for Android builds, but we could also use the same approach for Dockerfile.mono if you agree.

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 && \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the reference, while we use --branch here, we check out a git tag, so unless upstream deletes it and retags another commit, this should allow reproducible builds.
The git submodule update --init below should also update to the commit hashes referenced in the tagged mono commit, so they shouldn't change.

@akien-mga akien-mga merged commit 4d8fc02 into godotengine:master Nov 11, 2019
@akien-mga akien-mga deleted the android-mono branch December 22, 2019 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants