Skip to content

Commit 895d8e3

Browse files
committed
mono: Update msbuild and support for mono 6.0.x
Install xz/xz-utils and conditionally handle tar.xz tarballs from 6.0+. On Windows, I ran into a build issue due to `make distclean` being bogus in 6.0.0.319 (mono/mono#16605), so I worked it around by starting from a clean folder for each build. The hotfixed mingw-binutils packages should likely be rebuilt against Fedora 30's mingw-binutils, but I didn't find the src.rpm in the repo to do it. There were no functional changes between F29 and F30's mingw-binutils though, so we should be fine as is: https://src.fedoraproject.org/rpms/mingw-binutils/commits/f30 The `MONO32_PREFIX` and `MONO64_PREFIX` are no longer used by the buildsystem (replaced by a `mono_prefix` build option), but I kept them where relevant to point to non-standard install locations.
1 parent a62e856 commit 895d8e3

File tree

5 files changed

+51
-30
lines changed

5 files changed

+51
-30
lines changed

Dockerfile.mono

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ ARG mono_version
44

55
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi
66

7-
RUN dnf -y install cmake gcc gcc-c++ make which perl python curl bzip2 && dnf clean all && \
8-
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \
7+
RUN dnf -y install autoconf automake libtool cmake gcc gcc-c++ make which perl python curl bzip2 xz && dnf clean all && \
8+
if [ ${mono_version%%.*} -ge 6 ]; then \
9+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.xz | tar xJ; \
10+
else \
11+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj; \
12+
fi && \
913
cd mono-${mono_version} && \
10-
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm && make -j && make install && make distclean && \
14+
autoreconf -vfi && \
15+
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm && \
16+
make -j && make install && make distclean && \
1117
cd /root && \
1218
rm -rf mono-${mono_version} && \
13-
cert-sync /etc/pki/tls/certs/ca-bundle.crt && \
14-
rpm -ivh --nodeps https://download.mono-project.com/repo/centos7-stable/m/msbuild/msbuild-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.3.epel7.noarch.rpm \
15-
https://download.mono-project.com/repo/centos7-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-2.0.0.2017.07.06.00.01-0.xamarin.1.epel7.x86_64.rpm \
16-
https://download.mono-project.com/repo/centos7-stable/m/msbuild/msbuild-sdkresolver-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.3.epel7.noarch.rpm \
17-
https://download.mono-project.com/repo/centos7-stable/n/nuget/nuget-4.7.0.5148.bin-0.xamarin.1.epel7.noarch.rpm
19+
cert-sync /etc/pki/tls/certs/ca-bundle.crt
1820

21+
RUN rpm -ivh --nodeps https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.5.epel8.noarch.rpm \
22+
https://download.mono-project.com/repo/centos8-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-2.0.0.2017.07.06.00.01-0.xamarin.3.epel8.x86_64.rpm \
23+
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.5.epel8.noarch.rpm \
24+
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-4.7.0.5148.bin-0.xamarin.2.epel8.noarch.rpm

Dockerfile.osx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ RUN dnf -y install automake autoconf bzip2-devel clang git libicu-devel libtool
2828
mkdir -p ${CLANG_LIB_DIR}/lib/darwin && \
2929
cp -rv /root/osxcross/build/compiler-rt/include/sanitizer ${CLANG_LIB_DIR}/include && \
3030
cp -v /root/osxcross/build/compiler-rt/build/lib/darwin/*.a ${CLANG_LIB_DIR}/lib/darwin && \
31-
cp -v /root/osxcross/build/compiler-rt/build/lib/darwin/*.dylib ${CLANG_LIB_DIR}/lib/darwin && \
32-
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \
31+
cp -v /root/osxcross/build/compiler-rt/build/lib/darwin/*.dylib ${CLANG_LIB_DIR}/lib/darwin
32+
33+
RUN if [ ${mono_version%%.*} -ge 6 ]; then \
34+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.xz | tar xJ; \
35+
else \
36+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj; \
37+
fi && \
3338
cd mono-${mono_version} && \
3439
patch -p1 < /root/files/patches/fix-mono-configure.diff && \
3540
export PATH=/root/osxcross/target/bin:$PATH && \

Dockerfile.ubuntu-32

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ RUN apt-get update && \
1313
echo 'deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu trusty main' >> /etc/apt/sources.list && \
1414
apt-get update && \
1515
apt-get install -y gcc-8 g++-8 libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \
16-
libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make bzip2 yasm && \
16+
libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make curl bzip2 xz-utils yasm && \
1717
ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \
1818
ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \
1919
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2020
ln -sf /usr/bin/g++-8 /usr/bin/g++ && \
21-
wget -O- https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \
21+
if [ ${mono_version%%.*} -ge 6 ]; then \
22+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.xz | tar xJ; \
23+
else \
24+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj; \
25+
fi && \
2226
cd mono-${mono_version} && \
2327
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu && \
2428
make -j && \
@@ -36,7 +40,4 @@ RUN apt-get update && \
3640
rm *.deb && \
3741
rm -rf /root/mono-${mono_version}
3842

39-
ENV MONO32_PREFIX=/usr
40-
ENV MONO64_PREFIX=/usr
41-
4243
CMD ['/bin/bash']

Dockerfile.ubuntu-64

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ RUN apt-get update && \
1313
echo 'deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu trusty main' >> /etc/apt/sources.list && \
1414
apt-get update && \
1515
apt-get install -y gcc-8 g++-8 libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \
16-
libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make bzip2 yasm && \
16+
libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make curl bzip2 xz-utils yasm && \
1717
ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \
1818
ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \
1919
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2020
ln -sf /usr/bin/g++-8 /usr/bin/g++ && \
21-
wget -O- https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \
21+
if [ ${mono_version%%.*} -ge 6 ]; then \
22+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.xz | tar xJ; \
23+
else \
24+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj; \
25+
fi && \
2226
cd mono-${mono_version} && \
2327
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu && \
2428
make -j && \
@@ -36,7 +40,4 @@ RUN apt-get update && \
3640
rm *.deb && \
3741
rm -rf /root/mono-${mono_version}
3842

39-
ENV MONO32_PREFIX=/usr
40-
ENV MONO64_PREFIX=/usr
41-
4243
CMD ['/bin/bash']

Dockerfile.windows

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,43 @@ ARG mono_version
44

55
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi
66

7-
RUN dnf -y install scons mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static yasm && dnf clean all && \
8-
rpm -Uvh --replacepkgs /root/files/mingw-binutils-generic-2.30-5.fc29.godot.x86_64.rpm \
9-
/root/files/mingw64-binutils-2.30-5.fc29.godot.x86_64.rpm \
10-
/root/files/mingw32-binutils-2.30-5.fc29.godot.x86_64.rpm && \
11-
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \
7+
RUN dnf -y install scons mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static yasm bzip2 xz && dnf clean all && \
8+
rpm -Uvh --force /root/files/mingw-binutils-generic-2.30-5.fc29.godot.x86_64.rpm \
9+
/root/files/mingw64-binutils-2.30-5.fc29.godot.x86_64.rpm \
10+
/root/files/mingw32-binutils-2.30-5.fc29.godot.x86_64.rpm && \
11+
if [ ${mono_version%%.*} -ge 6 ]; then \
12+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.xz | tar xJ; \
13+
else \
14+
curl https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj; \
15+
fi && \
16+
cp -r mono-${mono_version} mono-${mono_version}-32 && \
1217
cd mono-${mono_version} && \
1318
./configure --prefix=/root/dependencies/mono-64 --host=x86_64-w64-mingw32 --disable-boehm --disable-mcs-build --disable-executables && \
1419
echo '#define HAVE_STRUCT_SOCKADDR_IN6 1' >> config.h && \
1520
make -j && \
1621
make install && \
17-
make distclean && \
22+
cd .. && \
23+
rm -rf mono-${mono_version} && \
1824
cp /root/dependencies/mono-64/bin/libMonoPosixHelper.dll /root/dependencies/mono-64/bin/MonoPosixHelper.dll && \
1925
rm -f /root/dependencies/mono-64/bin/mono /root/dependencies/mono-64/bin/mono-sgen && \
2026
ln -s /usr/bin/mono /root/dependencies/mono-64/bin/mono && \
2127
ln -s /usr/bin/mono-sgen /root/dependencies/mono-64/bin/mono-sgen && \
2228
ln -sf /usr/lib/mono/* /root/dependencies/mono-64/lib/mono || /bin/true && \
23-
cp -rvp /etc/mono /root/dependencies/mono-64/etc && \
29+
cp -rvp /etc/mono /root/dependencies/mono-64/etc
30+
31+
RUN cd mono-${mono_version}-32 && \
2432
./configure --prefix=/root/dependencies/mono-32 --host=i686-w64-mingw32 --disable-boehm --disable-mcs-build --disable-executables && \
2533
echo '#define HAVE_STRUCT_SOCKADDR_IN6 1' >> config.h && \
2634
make -j && \
2735
make install && \
28-
make distclean && \
36+
cd .. && \
37+
rm -rf mono-${mono_version}-32 && \
2938
cp /root/dependencies/mono-32/bin/libMonoPosixHelper.dll /root/dependencies/mono-32/bin/MonoPosixHelper.dll && \
3039
rm -f /root/dependencies/mono-32/bin/mono /root/dependencies/mono-32/bin/mono-sgen && \
3140
ln -s /usr/bin/mono /root/dependencies/mono-32/bin/mono && \
3241
ln -s /usr/bin/mono-sgen /root/dependencies/mono-32/bin/mono-sgen && \
3342
ln -sf /usr/lib/mono/* /root/dependencies/mono-32/lib/mono || /bin/true && \
34-
cp -rvp /etc/mono /root/dependencies/mono-32/etc && \
35-
rm -rf /root/mono-${mono_version}
43+
cp -rvp /etc/mono /root/dependencies/mono-32/etc
3644

3745
ENV MONO32_PREFIX=/root/dependencies/mono-32
3846
ENV MONO64_PREFIX=/root/dependencies/mono-64

0 commit comments

Comments
 (0)