mirror of
https://github.com/godotengine/build-containers.git
synced 2026-01-03 10:09:18 +03:00
Specifying only a branch like '2019-08' is problematic if upstream commits something between the builds of two containers. We could make a tarball in the first container build and reuse that, but we need the flexibility of Git for some patching in the Android and JavaScript builds, so instead we allow specifying a git tree-ish as the third argument. We can therefore also give a pretty version string to use for the image name as second argument, e.g. 6.6.0.160 for bef1e6335812d32f8eab648c0228fc624b9f8357. As we can't `git clone` a commit hash directly, we still need to provide both branch name and then commit hash for this use case.
54 lines
2.1 KiB
Docker
54 lines
2.1 KiB
Docker
ARG img_version
|
|
FROM godot-mono:${img_version}
|
|
|
|
ARG mono_version
|
|
ARG mono_commit
|
|
|
|
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 \
|
|
automake autoconf bzip2-devel clang libicu-devel libtool libxml2-devel llvm-devel openssl-devel yasm && \
|
|
dnf clean all && \
|
|
git clone https://github.com/tpoechtrager/osxcross.git && \
|
|
cd /root/osxcross && \
|
|
git checkout 542acc2ef6c21aeb3f109c03748b1015a71fed63 && \
|
|
ln -s /root/files/MacOSX10.14.sdk.tar.xz /root/osxcross/tarballs && \
|
|
UNATTENDED=1 ./build.sh
|
|
|
|
ENV OSXCROSS_ROOT=/root/osxcross
|
|
ENV PATH="/root/osxcross/target/bin:${PATH}"
|
|
|
|
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
|
|
cd /root/mono && \
|
|
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
|
|
git submodule update --init && \
|
|
export CMAKE=/root/osxcross/target/bin/x86_64-apple-darwin18-cmake && \
|
|
NOCONFIGURE=1 ./autogen.sh && \
|
|
./configure --prefix=/root/dependencies/mono \
|
|
--build=x86_64-linux-gnu \
|
|
--host=x86_64-apple-darwin18 \
|
|
--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 && \
|
|
cd /root && \
|
|
rm -f /root/dependencies/mono/bin/mono /root/dependencies/mono/bin/mono-sgen && \
|
|
ln -s /usr/bin/mono /root/dependencies/mono/bin/mono && \
|
|
ln -s /usr/bin/mono-sgen /root/dependencies/mono/bin/mono-sgen && \
|
|
ln -sf /usr/lib/mono/* /root/dependencies/mono/lib/mono && \
|
|
mkdir -p /root/dependencies/mono/etc && \
|
|
cp -rvp /etc/mono /root/dependencies/mono/etc/ && \
|
|
cp /root/dependencies/mono/etc/mono/config{,.bak} && \
|
|
cp /root/files/mono-config-macosx /root/dependencies/mono/etc/mono/config && \
|
|
rm -rf /root/mono
|
|
|
|
ENV MONO64_PREFIX=/root/dependencies/mono
|
|
|
|
CMD /bin/bash
|