From d3cbff6cc782e5843cfac551e9ae7d87e6b3f0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 6 Apr 2020 11:24:03 +0200 Subject: [PATCH] iOS: Build Mono runtime iOS image is now based on the OSX one, as we'll need the OSX toolchain to build the AOT cross-compiler. We can't build the cross-compiler yet though as godot-mono-builds doesn't support OSXCross for that part, and we will likely need to build libclang manually beforehand too. --- Dockerfile.ios | 23 ++++++++++++++++++++++- build.sh | 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Dockerfile.ios b/Dockerfile.ios index ec1fccb..58338c0 100644 --- a/Dockerfile.ios +++ b/Dockerfile.ios @@ -1,5 +1,5 @@ ARG img_version -FROM godot-fedora:${img_version} +FROM godot-osx:${img_version} RUN dnf -y install --setopt=install_weak_deps=False \ automake autoconf clang gcc gcc-c++ gcc-objc gcc-objc++ cmake libicu-devel libtool libxml2-devel llvm-devel openssl-devel perl python yasm && \ @@ -20,5 +20,26 @@ RUN dnf -y install --setopt=install_weak_deps=False \ ln -s /root/ioscross/x86_64/bin /root/ioscross/x86_64/usr/bin ENV OSXCROSS_IOS=not_nothing +ENV IOSCROSS_ROOT=/root/ioscross +ENV PATH="/root/ioscross/arm64/bin:/root/ioscross/x86_64/bin:${PATH}" + +RUN cp -a /root/files/${mono_version} /root && \ + cd /root/${mono_version}/godot-mono-builds && \ + export MONO_SOURCE_ROOT=/root/${mono_version} && \ + python3 ios.py configure -j --verbose --target=arm64 --ios-toolchain ${IOSCROSS_ROOT}/arm64 --ios-sdk ${IOSCROSS_ROOT}/arm64/SDK/iPhoneOS12.4.sdk --osx-toolchain ${OSXCROSS_ROOT} && \ + python3 ios.py make -j --verbose --target=arm64 && \ + python3 ios.py configure -j --target=x86_64 --ios-toolchain ${IOSCROSS_ROOT}/x86_64 --ios-sdk ${IOSCROSS_ROOT}/x86_64/SDK/iPhoneOS12.4.sdk --osx-toolchain ${OSXCROSS_ROOT} && \ + python3 ios.py make -j --target=x86_64 && \ + python3 bcl.py make -j --product=ios && \ + # TODO: Emable once godot-mono-builds supports osxcross for the cross-compiler. + # It requires having a build of libclang with support for iOS arm64 + changes to the build scripts. + #python3 ios.py configure -j --target=cross-arm64 --ios-toolchain ${IOSCROSS_ROOT}/arm64 --ios-sdk ${IOSCROSS_ROOT}/arm64/SDK/iPhoneOS12.4.sdk --osx-toolchain ${OSXCROSS_ROOT} && \ + #python3 ios.py make -j --target=cross-arm64 && \ + cd /root && \ + rm -rf /root/${mono_version} + +# Until we can build the cross-compiler, we include a pre-made build in the container. +RUN mkdir -p /root/aot-compilers/iphone-arm64 && \ + tar xvf /root/files/aarch64-apple-darwin-mono-sgen.tar.xz -C /root/aot-compilers/iphone-arm64 CMD /bin/bash diff --git a/build.sh b/build.sh index 1e452dc..8a06fab 100755 --- a/build.sh +++ b/build.sh @@ -91,7 +91,7 @@ if [ ! -e ${mono_root} ]; then # Set up godot-mono-builds in tree git clone --progress https://github.com/godotengine/godot-mono-builds pushd godot-mono-builds - git checkout a120a65774d206e432d2971457977aa29aca9188 + git checkout 562afa310ef78974b2986154220e26f58e83a72e export MONO_SOURCE_ROOT=${mono_root} python3 patch_mono.py popd @@ -123,8 +123,8 @@ if [ ! -e files/MacOSX10.14.sdk.tar.xz ] || [ ! -e files/iPhoneOS12.4.sdk.tar.xz $podman run -it --rm -v ${files_root}/files:/root/files godot-xcode-packer:${img_version} 2>&1 | tee logs/xcode_packer.log fi -$podman_build -t godot-ios:${img_version} -f Dockerfile.ios -v ${files_root}:/root/files . 2>&1 | tee logs/ios.log $podman_build_mono -t godot-osx:${img_version} -f Dockerfile.osx . 2>&1 | tee logs/osx.log +$podman_build_mono -t godot-ios:${img_version} -f Dockerfile.ios . 2>&1 | tee logs/ios.log if [ ! -e files/msvc2017.tar ]; then echo