Files
build-containers/Dockerfile.ios
Rémi Verschelde dede88afa4 Update to Mono 6.12.0.102, use Fedora 32
- Base container: Fedora 32
- Mono uses version 6.12.0.102, MSBuild 16.6
- Linux builds use GCC 9
- Windows builds use Fedora 32's mingw-gcc (GCC 9)
- JavaScript uses Emscripten 1.39.9 (Mono 6.12 requires 1.39.7 but that version
  fails generating .wasm, so we backport a patch to get 1.39.9)
- Install SCons 4.0.1 from pip
2020-10-20 13:27:57 +02:00

52 lines
3.0 KiB
Docker

ARG img_version
FROM godot-osx:${img_version}
ARG mono_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 && \
git clone --progress https://github.com/tpoechtrager/cctools-port.git && \
cd /root/cctools-port && \
git checkout f85f5e4388047a7ab7515fcdb376b25aa11d4d1b && \
usage_examples/ios_toolchain/build.sh /root/files/iPhoneOS14.0.sdk.tar.xz arm64 && \
mkdir -p /root/ioscross/arm64 && \
mv usage_examples/ios_toolchain/target/* /root/ioscross/arm64 && \
mkdir /root/ioscross/arm64/usr && \
ln -s /root/ioscross/arm64/bin /root/ioscross/arm64/usr/bin && \
sed -i 's#^TRIPLE=.*#TRIPLE="x86_64-apple-darwin11"#' usage_examples/ios_toolchain/build.sh && \
usage_examples/ios_toolchain/build.sh /root/files/iPhoneSimulator14.0.sdk.tar.xz x86_64 && \
mkdir -p /root/ioscross/x86_64 && \
mv usage_examples/ios_toolchain/target/* /root/ioscross/x86_64 && \
mkdir /root/ioscross/x86_64/usr && \
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 if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
cp -a /root/files/${mono_version} /root && \
cd /root/${mono_version} && \
patch -p1 < /root/files/patches/mono-xcode-allow-weak-import.patch && \
patch -p1 < /root/files/patches/mono-sys-uio-fix-preadv-misdetection.patch && \
cd godot-mono-builds && \
export DISABLE_NO_WEAK_IMPORTS=1 && \
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/iPhoneOS14.0.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/iPhoneOS14.0.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/iPhoneOS14.0.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