Skip to content

Commit

Permalink
Merge pull request #84 from godotengine/containers-overhaul-linux-sdk…
Browse files Browse the repository at this point in the history
…-macos-arm64
  • Loading branch information
akien-mga authored Jul 13, 2021
2 parents 8f8fdf5 + a1fe833 commit e9875af
Show file tree
Hide file tree
Showing 18 changed files with 240 additions and 300 deletions.
11 changes: 5 additions & 6 deletions Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
dnf -y install --setopt=install_weak_deps=False \
java-1.8.0-openjdk-devel ncurses-compat-libs && \
mkdir -p sdk && cd sdk && \
curl -LO https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip && \
unzip commandlinetools-linux-6858069_latest.zip && \
rm commandlinetools-linux-6858069_latest.zip && \
export CMDLINETOOLS=commandlinetools-linux-7302050_latest.zip && \
curl -LO https://dl.google.com/android/repository/${CMDLINETOOLS} && \
unzip ${CMDLINETOOLS} && \
rm ${CMDLINETOOLS} && \
yes | cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" --licenses && \
cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" "ndk;${ANDROID_NDK_VERSION}" 'cmdline-tools;latest' 'build-tools;30.0.1' 'platforms;android-29' 'cmake;3.10.2.4988404'
cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_SDK_ROOT}" "ndk;${ANDROID_NDK_VERSION}" 'cmdline-tools;latest' 'build-tools;30.0.3' 'platforms;android-29' 'cmake;3.18.1'

RUN cp -a /root/files/${mono_version} /root && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \
cd /root/${mono_version}/godot-mono-builds && \
python3 android.py configure -j --target=all-runtime && \
python3 android.py make -j --target=all-runtime && \
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
cd /root/${mono_version}/godot-mono-builds && \
python3 bcl.py make -j --product=android && \
cd /root && \
rm -rf /root/${mono_version}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM fedora:33
FROM fedora:34

WORKDIR /root

RUN dnf -y upgrade --setopt=install_weak_deps=False && \
dnf -y install --setopt=install_weak_deps=False \
bash bzip2 curl git make nano patch pkgconfig python-unversioned-command python3-pip unzip which xz && \
bash bzip2 curl file findutils git make nano patch pkgconfig python3-pip unzip which xz && \
pip install scons==4.1.0

CMD /bin/bash
19 changes: 11 additions & 8 deletions Dockerfile.ios
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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 14ab64360c556c1263e022318ee4be1077d7a839 && \
git checkout 236a426c1205a3bfcf0dbb2e2faf2296f0a100e5 && \
# arm64 device
usage_examples/ios_toolchain/build.sh /root/files/iPhoneOS${IOS_SDK}.sdk.tar.xz arm64 && \
mkdir -p /root/ioscross/arm64 && \
Expand Down Expand Up @@ -42,12 +42,15 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
cd /root/${mono_version} && \
cd 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/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
python3 ios.py make -j --verbose --target=arm64 && \
#python3 ios.py configure -j --verbose --target=arm64-sim --ios-toolchain ${IOSCROSS_ROOT}/arm64_sim --ios-sdk ${IOSCROSS_ROOT}/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
#python3 ios.py make -j --verbose --target=arm64-sim && \
python3 ios.py configure -j --verbose --target=x86_64 --ios-toolchain ${IOSCROSS_ROOT}/x86_64_sim --ios-sdk ${IOSCROSS_ROOT}/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk --osx-toolchain ${OSXCROSS_ROOT} && \
python3 ios.py make -j --verbose --target=x86_64 && \
python3 ios.py configure -j --target=arm64 --ios-version-min 10.0 --osx-toolchain ${OSXCROSS_ROOT} \
--ios-toolchain ${IOSCROSS_ROOT}/arm64 --ios-sdk ${IOSCROSS_ROOT}/arm64/SDK/iPhoneOS${IOS_SDK}.sdk && \
python3 ios.py make -j --target=arm64 && \
#python3 ios.py configure -j --target=arm64-sim --ios-version-min 10.0 --osx-toolchain ${OSXCROSS_ROOT} \
# --ios-toolchain ${IOSCROSS_ROOT}/arm64_sim --ios-sdk ${IOSCROSS_ROOT}/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk && \
#python3 ios.py make -j --target=arm64-sim && \
python3 ios.py configure -j --target=x86_64 --ios-version-min 10.0 --osx-toolchain ${OSXCROSS_ROOT} \
--ios-toolchain ${IOSCROSS_ROOT}/x86_64_sim --ios-sdk ${IOSCROSS_ROOT}/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk && \
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.
Expand All @@ -58,7 +61,7 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand

# Until we can build the cross-compiler, we include a pre-made build in the container.
RUN mkdir -p /root/aot-compilers/iphone-arm64 && \
curl -LO https://github.com/godotengine/godot-mono-builds/releases/download/release-df330ce/ios-cross-arm64.zip && \
curl -LO https://github.com/godotengine/godot-mono-builds/releases/download/release-c3a9d31/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
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile.javascript
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM godot-mono:${img_version}

ARG mono_version

ENV EMSCRIPTEN_CLASSICAL=2.0.15
ENV EMSCRIPTEN_CLASSICAL=2.0.25
ENV EMSCRIPTEN_MONO=1.39.9

RUN if [ -z "${mono_version}" ]; then printf "\n\nArgument mono_version is mandatory!\n\n"; exit 1; fi && \
Expand All @@ -23,8 +23,6 @@ RUN if [ -z "${mono_version}" ]; then printf "\n\nArgument mono_version is manda
python3 patch_emscripten.py && \
python3 wasm.py configure -j --target=runtime && \
python3 wasm.py make -j --target=runtime && \
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
cd /root/${mono_version}/godot-mono-builds && \
python3 bcl.py make -j --product wasm && \
cd /root && \
rm -rf /root/${mono_version}
Expand Down
41 changes: 41 additions & 0 deletions Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ARG img_version
FROM godot-mono:${img_version}

ARG mono_version

ENV GODOT_SDK_LINUX_X86_64=/root/x86_64-godot-linux-gnu_sdk-buildroot
ENV GODOT_SDK_LINUX_X86=/root/i686-godot-linux-gnu_sdk-buildroot
ENV BASE_PATH=${PATH}

RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
dnf -y install --setopt=install_weak_deps=False \
libxcrypt-compat yasm && \
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
cd x86_64-godot-linux-gnu_sdk-buildroot && \
./relocate-sdk.sh && \
rm -f bin/{aclocal*,auto*,libtool*,m4} && \
cd /root && \
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
cd i686-godot-linux-gnu_sdk-buildroot && \
./relocate-sdk.sh && \
rm -f bin/{aclocal*,auto*,libtool*,m4} && \
cp -a /root/files/${mono_version} /root && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \
cd /root/${mono_version}/godot-mono-builds && \
export PATH=${GODOT_SDK_LINUX_X86_64}/bin:${BASE_PATH} && \
python3 linux.py configure -j --target=x86_64 && \
python3 linux.py make -j --target=x86_64 && \
export PATH=${GODOT_SDK_LINUX_X86}/bin:${BASE_PATH} && \
python3 linux.py configure -j --target=x86 && \
python3 linux.py make -j --target=x86 && \
export PATH=${GODOT_SDK_LINUX_X86_64}/bin:${BASE_PATH} && \
python3 bcl.py make -j --product=desktop && \
python3 linux.py copy-bcl --target=x86_64 --target=x86 && \
cd /root && \
rm -rf /root/${mono_version}

CMD /bin/bash
11 changes: 5 additions & 6 deletions Dockerfile.mono
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ARG mono_version

RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
dnf -y install --setopt=install_weak_deps=False \
gcc gcc-c++ make yasm \
autoconf automake cmake gettext libtool perl && \
autoconf automake cmake gcc gcc-c++ gettext libtool perl python-unversioned-command && \
cp -a /root/files/${mono_version} /root && \
cd /root/${mono_version} && \
NOCONFIGURE=1 ./autogen.sh && \
Expand All @@ -17,9 +16,9 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
rm -rf /root/${mono_version} && \
cert-sync /etc/pki/tls/certs/ca-bundle.crt && \
rpm -ivh --nodeps \
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-16.6+xamarinxplat.2021.01.15.16.11-0.xamarin.2.epel8.noarch.rpm \
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-16.6+xamarinxplat.2021.01.15.16.11-0.xamarin.2.epel8.noarch.rpm \
https://download.mono-project.com/repo/centos8-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-3.0.0.2019.04.16.02.13-0.xamarin.4.epel8.x86_64.rpm \
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-5.6.0.6489.bin-0.xamarin.1.epel8.noarch.rpm
https://download.mono-project.com/repo/centos8-preview/m/msbuild/msbuild-16.10.1+xamarinxplat.2021.05.26.14.00-0.xamarin.7.epel8.noarch.rpm \
https://download.mono-project.com/repo/centos8-preview/m/msbuild/msbuild-sdkresolver-16.10.1+xamarinxplat.2021.05.26.14.00-0.xamarin.7.epel8.noarch.rpm \
https://download.mono-project.com/repo/centos8-preview/m/msbuild-libhostfxr/msbuild-libhostfxr-3.0.0.2019.04.16.02.13-0.xamarin.4.epel8.x86_64.rpm \
https://download.mono-project.com/repo/centos8-preview/n/nuget/nuget-5.6.0.6489.bin-0.xamarin.1.epel8.noarch.rpm

CMD /bin/bash
37 changes: 12 additions & 25 deletions Dockerfile.osx
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,26 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
automake autoconf bzip2-devel clang libicu-devel libtool libxml2-devel llvm-devel openssl-devel yasm && \
git clone --progress https://github.com/tpoechtrager/osxcross.git && \
cd /root/osxcross && \
git checkout 61925a29c404fc547ce9d51eb2ee4a09bd6533da && \
git checkout 447cf3b3ea4323d24648f5f7f775f5977a0d15bd && \
ln -s /root/files/MacOSX11.1.sdk.tar.xz /root/osxcross/tarballs && \
UNATTENDED=1 ./build.sh
patch -p1 < /root/files/patches/osxcross-pr284-compiler-rt.patch && \
UNATTENDED=1 ./build.sh && \
ENABLE_COMPILER_RT_INSTALL=1 ./build_compiler_rt.sh

ENV OSXCROSS_ROOT=/root/osxcross
ENV PATH="/root/osxcross/target/bin:${PATH}"

RUN cp -a /root/files/${mono_version} /root && \
cd /root/${mono_version} && \
export CMAKE=/root/osxcross/target/bin/x86_64-apple-darwin20.2-cmake && \
NOCONFIGURE=1 ./autogen.sh && \
./configure --prefix=/root/dependencies/mono \
--build=x86_64-linux-gnu \
--host=x86_64-apple-darwin20.2 \
--disable-boehm \
--disable-mcs-build \
--with-tls=pthread \
--disable-dtrace \
--disable-executables \
mono_cv_uscore=yes \
_lt_dar_can_shared=yes \
CC=o64-clang \
CXX=o64-clang++ && \
make -j && \
make install && \
patch -p1 < /root/files/patches/mono-btls-cmake-wrapper.patch && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \
export OSXCROSS_SDK=20.2 && \
cd /root/${mono_version}/godot-mono-builds && \
python3 osx.py configure -j --target=x86_64 --target=arm64 && \
python3 osx.py make -j --target=x86_64 --target=arm64 && \
python3 bcl.py make --product=desktop && \
python3 osx.py copy-bcl --target=x86_64 --target=arm64 && \
cd /root && \
rm -rf /root/dependencies/mono/bin/mono{,-sgen} /root/dependencies/mono/lib/mono && \
ln -s /usr/bin/mono /root/dependencies/mono/bin/mono && \
ln -s /usr/bin/mono-sgen /root/dependencies/mono/bin/mono-sgen && \
ln -s /usr/lib/mono /root/dependencies/mono/lib/mono && \
mkdir -p /root/dependencies/mono/etc && \
cp -rvp /etc/mono /root/dependencies/mono/etc/ && \
cp /root/files/mono-config-macosx /root/dependencies/mono/etc/mono/config && \
rm -rf /root/${mono_version}

CMD /bin/bash
32 changes: 0 additions & 32 deletions Dockerfile.ubuntu-32

This file was deleted.

43 changes: 0 additions & 43 deletions Dockerfile.ubuntu-64

This file was deleted.

31 changes: 9 additions & 22 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,16 @@ ARG mono_version

RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
dnf -y install --setopt=install_weak_deps=False \
mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static wine && \
mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static && \
cp -a /root/files/${mono_version} /root && \
cd /root/${mono_version} && \
patch -p1 < /root/files/patches/wine-mono.patch && \
export WINE_BITS=64 && \
bash /root/files/mono-build-win32.sh --prefix=/root/dependencies/mono-64 --host=x86_64-w64-mingw32 \
--with-profile4_x=yes --with-runtime-preset=net_4_x && \
git clean -fdx && \
cp /root/dependencies/mono-64/bin/libMonoPosixHelper.dll /root/dependencies/mono-64/bin/MonoPosixHelper.dll && \
rm -f /root/dependencies/mono-64/bin/mono /root/dependencies/mono-64/bin/mono-sgen && \
ln -s /usr/bin/mono /root/dependencies/mono-64/bin/mono && \
ln -s /usr/bin/mono-sgen /root/dependencies/mono-64/bin/mono-sgen && \
cp -rvp /etc/mono /root/dependencies/mono-64/etc && \
export WINE_BITS=32 && \
bash /root/files/mono-build-win32.sh --prefix=/root/dependencies/mono-32 --host=i686-w64-mingw32 \
--with-profile4_x=yes --with-runtime-preset=net_4_x && \
export MONO_SOURCE_ROOT=/root/${mono_version} && \
cd /root/${mono_version}/godot-mono-builds && \
python3 windows.py configure -j --target=x86_64 --target=x86 --mxe-prefix=/usr && \
python3 windows.py make -j --target=x86_64 --target=x86 --mxe-prefix=/usr && \
python3 bcl.py make -j --product=desktop && \
python3 bcl.py make -j --product=desktop-win32 && \
python3 windows.py copy-bcl --target=x86_64 --target=x86 && \
cd /root && \
rm -rf /root/${mono_version} && \
cp /root/dependencies/mono-32/bin/libMonoPosixHelper.dll /root/dependencies/mono-32/bin/MonoPosixHelper.dll && \
rm -f /root/dependencies/mono-32/bin/mono /root/dependencies/mono-32/bin/mono-sgen && \
ln -s /usr/bin/mono /root/dependencies/mono-32/bin/mono && \
ln -s /usr/bin/mono-sgen /root/dependencies/mono-32/bin/mono-sgen && \
cp -rvp /etc/mono /root/dependencies/mono-32/etc && \
dnf -y remove wine
rm -rf /root/${mono_version}

CMD /bin/bash
Loading

0 comments on commit e9875af

Please sign in to comment.