Factor out cloning and patching for godot-mono-builds

This will also be used for iOS so it makes sense to do it all
together with the split out mono clone.

This also allows to pin the commit used more easily.
This commit is contained in:
Rémi Verschelde
2020-04-06 08:44:57 +02:00
parent 4812a83c56
commit a26fc11c30
4 changed files with 19 additions and 16 deletions

1
.gitignore vendored
View File

@@ -8,4 +8,5 @@
*.zip *.zip
*.xip *.xip
files/mono-*/
logs/ logs/

View File

@@ -19,16 +19,13 @@ ENV ANDROID_NDK_ROOT=/root/sdk/ndk-bundle/
RUN cp -a /root/files/${mono_version} /root && \ RUN cp -a /root/files/${mono_version} /root && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \ export MONO_SOURCE_ROOT=/root/${mono_version} && \
export make="make -j" && \ export make="make -j" && \
git clone --progress https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \ cd /root/${mono_version}/godot-mono-builds && \
cd /root/godot-mono-builds && \
git checkout 710b275fbf29ddb03fd5285c51782951a110cdab && \
python3 patch_mono.py && \
python3 android.py configure --target=all-runtime && \ python3 android.py configure --target=all-runtime && \
python3 android.py make --target=all-runtime && \ python3 android.py make --target=all-runtime && \
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \ cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
cd /root/godot-mono-builds && \ cd /root/${mono_version}/godot-mono-builds && \
python3 bcl.py make --product=android && \ python3 bcl.py make --product=android && \
cd /root && \ cd /root && \
rm -rf /root/${mono_version} /root/godot-mono-builds rm -rf /root/${mono_version}
CMD /bin/bash CMD /bin/bash

View File

@@ -19,16 +19,14 @@ RUN cp -a /root/files/${mono_version} /root && \
patch -p1 < /root/files/patches/mono-pr17094-bump-emscripten-1.38.46.patch && \ patch -p1 < /root/files/patches/mono-pr17094-bump-emscripten-1.38.46.patch && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \ export MONO_SOURCE_ROOT=/root/${mono_version} && \
export make="make -j" && \ export make="make -j" && \
git clone --progress https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \ cd /root/${mono_version}/godot-mono-builds && \
cd /root/godot-mono-builds && \
git checkout 710b275fbf29ddb03fd5285c51782951a110cdab && \
python3 patch_emscripten.py && \ python3 patch_emscripten.py && \
python3 wasm.py configure --target=runtime && \ python3 wasm.py configure --target=runtime && \
python3 wasm.py make --target=runtime && \ python3 wasm.py make --target=runtime && \
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \ cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
cd /root/godot-mono-builds && \ cd /root/${mono_version}/godot-mono-builds && \
python3 bcl.py make --product wasm && \ python3 bcl.py make --product wasm && \
cd /root && \ cd /root && \
rm -rf /root/${mono_version} /root/godot-mono-builds rm -rf /root/${mono_version}
CMD /bin/bash CMD /bin/bash

View File

@@ -21,13 +21,13 @@ if [ -z "$1" -o -z "$2" ]; then
echo "mono version:" echo "mono version:"
echo " These are combined to form the docker image tag, e.g. 'master-mono-6.6.0.160'." echo " These are combined to form the docker image tag, e.g. 'master-mono-6.6.0.160'."
echo " Git will then clone the branch/tag that matches the mono version." echo " Git will then clone the branch/tag that matches the mono version."
echo echo
echo "mono branch:" echo "mono branch:"
echo " If specified, git will clone this mono branch/tag instead. Requires specifying a commit." echo " If specified, git will clone this mono branch/tag instead. Requires specifying a commit."
echo echo
echo "mono commit:" echo "mono commit:"
echo " If specified, git will check out this commit after cloning." echo " If specified, git will check out this commit after cloning."
echo echo
exit 1 exit 1
fi fi
@@ -76,11 +76,11 @@ mkdir -p logs
# Check out and patch Mono version # Check out and patch Mono version
if [ ! -e ${mono_root} ]; then if [ ! -e ${mono_root} ]; then
if [ ! -z "${mono_commit}" ]; then if [ ! -z "${mono_commit}" ]; then
# If a commit is specified, get the full history # If a commit is specified, get the full history
git clone -b ${mono_version} --single-branch --progress https://github.com/mono/mono ${mono_root} git clone -b ${mono_version} --single-branch --progress https://github.com/mono/mono ${mono_root}
pushd ${mono_root} pushd ${mono_root}
git checkout ${mono_commit} git checkout ${mono_commit}
else else
# Otherwise, get a shallow repo # Otherwise, get a shallow repo
git clone -b ${mono_version} --single-branch --progress --depth 1 https://github.com/mono/mono ${mono_root} git clone -b ${mono_version} --single-branch --progress --depth 1 https://github.com/mono/mono ${mono_root}
@@ -88,7 +88,14 @@ if [ ! -e ${mono_root} ]; then
fi fi
# Download all submodules, up to 6 at a time # Download all submodules, up to 6 at a time
git submodule update --init --recursive --recommend-shallow -j 6 --progress git submodule update --init --recursive --recommend-shallow -j 6 --progress
patch -p1 < ${files_root}/patches/mono-unity-Clear-TLS-instead-of-aborting.patch patch -p1 < ${files_root}/patches/mono-unity-Clear-TLS-instead-of-aborting.patch
# Set up godot-mono-builds in tree
git clone --progress https://github.com/godotengine/godot-mono-builds
pushd godot-mono-builds
git checkout 710b275fbf29ddb03fd5285c51782951a110cdab
export MONO_SOURCE_ROOT=${mono_root}
python3 patch_mono.py
popd
popd popd
fi fi