2019-12-02 13:30:41 +01:00
|
|
|
ARG img_version
|
2020-04-06 11:24:03 +02:00
|
|
|
FROM godot-osx:${img_version}
|
2019-01-07 21:51:22 +01:00
|
|
|
|
2020-10-07 08:44:09 +02:00
|
|
|
ARG mono_version
|
|
|
|
|
2020-11-19 12:57:58 +01:00
|
|
|
ENV IOS_SDK=14.2
|
|
|
|
|
2019-11-15 11:56:31 +01:00
|
|
|
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 && \
|
2020-03-19 18:13:06 +01:00
|
|
|
git clone --progress https://github.com/tpoechtrager/cctools-port.git && \
|
2019-01-07 21:51:22 +01:00
|
|
|
cd /root/cctools-port && \
|
2020-11-19 12:57:58 +01:00
|
|
|
git checkout 634a084377ee2e2932c66459b0396edf76da2e9f && \
|
|
|
|
usage_examples/ios_toolchain/build.sh /root/files/iPhoneOS${IOS_SDK}.sdk.tar.xz arm64 && \
|
2019-01-07 21:51:22 +01:00
|
|
|
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 && \
|
2020-11-19 12:57:58 +01:00
|
|
|
usage_examples/ios_toolchain/build.sh /root/files/iPhoneSimulator${IOS_SDK}.sdk.tar.xz x86_64 && \
|
2019-01-07 21:51:22 +01:00
|
|
|
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
|
|
|
|
|
2019-01-17 23:06:38 +01:00
|
|
|
ENV OSXCROSS_IOS=not_nothing
|
2020-04-06 11:24:03 +02:00
|
|
|
ENV IOSCROSS_ROOT=/root/ioscross
|
|
|
|
ENV PATH="/root/ioscross/arm64/bin:/root/ioscross/x86_64/bin:${PATH}"
|
|
|
|
|
2020-10-07 08:44:09 +02:00
|
|
|
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} && \
|
|
|
|
cd godot-mono-builds && \
|
2020-04-06 11:24:03 +02:00
|
|
|
export MONO_SOURCE_ROOT=/root/${mono_version} && \
|
2020-11-19 12:57:58 +01:00
|
|
|
python3 ios.py configure -j --verbose --target=arm64 --ios-toolchain ${IOSCROSS_ROOT}/arm64 --ios-sdk ${IOSCROSS_ROOT}/arm64/SDK/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
|
2020-04-06 11:24:03 +02:00
|
|
|
python3 ios.py make -j --verbose --target=arm64 && \
|
2020-11-19 12:57:58 +01:00
|
|
|
python3 ios.py configure -j --target=x86_64 --ios-toolchain ${IOSCROSS_ROOT}/x86_64 --ios-sdk ${IOSCROSS_ROOT}/x86_64/SDK/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
|
2020-04-06 11:24:03 +02:00
|
|
|
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.
|
2020-11-19 12:57:58 +01:00
|
|
|
#python3 ios.py configure -j --target=cross-arm64 --ios-toolchain ${IOSCROSS_ROOT}/arm64 --ios-sdk ${IOSCROSS_ROOT}/arm64/SDK/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
|
2020-04-06 11:24:03 +02:00
|
|
|
#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 && \
|
2021-01-27 21:48:06 +01:00
|
|
|
curl -LO https://github.com/godotengine/godot-mono-builds/releases/download/release-bda87f2/ios-cross-arm64.zip && \
|
|
|
|
dnf -y install --setopt=install_weak_deps=False p7zip && \
|
|
|
|
7za e ios-cross-arm64.zip ios-cross-arm64-release/bin/aarch64-apple-darwin-mono-sgen -o/root/aot-compilers/iphone-arm64 && \
|
|
|
|
rm ios-cross-arm64.zip
|
2019-01-17 23:06:38 +01:00
|
|
|
|
2019-11-15 11:22:07 +01:00
|
|
|
CMD /bin/bash
|