From e5d6158b9e2cebfab66c4412c619c1c7e0ea3426 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Thu, 17 Jan 2019 23:06:38 +0100 Subject: [PATCH] Several small fixes * Mono config on MacOSX is not portable from the Linux and Windows version. * Rename the compilers so that 'gcc' and 'g++' are the new version by default. * Add default environment variables to containers. --- Dockerfile.android | 3 +++ Dockerfile.ios | 2 ++ Dockerfile.osx | 4 ++++ Dockerfile.ubuntu-32 | 15 ++++++++------ Dockerfile.ubuntu-64 | 15 ++++++++------ Dockerfile.windows | 3 +++ files/mono-config-macosx | 44 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 files/mono-config-macosx diff --git a/Dockerfile.android b/Dockerfile.android index e311ee6..a603035 100644 --- a/Dockerfile.android +++ b/Dockerfile.android @@ -7,4 +7,7 @@ RUN dnf -y install scons java-1.8.0-openjdk-devel ncurses-compat-libs unzip whic yes | tools/bin/sdkmanager --licenses && \ tools/bin/sdkmanager ndk-bundle 'platforms;android-23' 'build-tools;19.1.0' 'build-tools;28.0.3' 'platforms;android-28' +ENV ANDROID_HOME=/root/ +ENV ANDROID_NDK_ROOT=/root/ndk-bundle/ + CMD ['/bin/bash'] diff --git a/Dockerfile.ios b/Dockerfile.ios index bd191a8..9c7de5c 100644 --- a/Dockerfile.ios +++ b/Dockerfile.ios @@ -16,4 +16,6 @@ RUN dnf -y install automake autoconf clang gcc gcc-c++ gcc-objc gcc-objc++ cmake mkdir /root/ioscross/x86_64/usr && \ ln -s /root/ioscross/x86_64/bin /root/ioscross/x86_64/usr/bin +ENV OSXCROSS_IOS=not_nothing + CMD ['/bin/bash'] diff --git a/Dockerfile.osx b/Dockerfile.osx index aab3e24..7826560 100644 --- a/Dockerfile.osx +++ b/Dockerfile.osx @@ -44,6 +44,10 @@ RUN dnf -y install automake autoconf bzip2-devel clang git libicu-devel libtool ln -s /usr/bin/mono-sgen /root/dependencies/mono/bin/mono-sgen && \ ln -sf /usr/lib/mono/* /root/dependencies/mono/lib/mono ;\ cp -rvp /etc/mono /root/dependencies/mono/etc && \ + cp /root/files/mono-config-macosx /root/dependencies/mono/etc/config && \ rm -rf /root/mono-${mono_version} /root/apple-libtapi /root/cctools-port +ENV MONO64_PREFIX=/root/dependencies/mono +ENV OSXCROSS_ROOT=/root/osxcross + CMD ['/bin/bash'] diff --git a/Dockerfile.ubuntu-32 b/Dockerfile.ubuntu-32 index 6faf868..0b7608f 100644 --- a/Dockerfile.ubuntu-32 +++ b/Dockerfile.ubuntu-32 @@ -6,14 +6,19 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand RUN apt-get update && \ apt-get -y install wget && \ + cd /root && \ wget -O- 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F' | apt-key add - && \ echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main' >> /etc/apt/sources.list && \ apt-get update && \ apt-get install -y gcc-8 g++-8 libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \ libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make bzip2 && \ + ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \ + ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \ + ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \ + ln -sf /usr/bin/g++-8 /usr/bin/g++ && \ wget -O- https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \ cd mono-${mono_version} && \ - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu CC=gcc-8 CXX=g++-8 && \ + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu && \ make -j && \ make install && \ cert-sync /etc/ssl/certs/ca-certificates.crt && \ @@ -27,11 +32,9 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/ && \ rm *.deb && \ - ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \ - ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \ - rm -rf /root/${mono_version} + rm -rf /root/mono-${mono_version} -ENV CC=gcc-8 -ENV CXX=g++-8 +ENV MONO32_PREFIX=/usr +ENV MONO64_PREFIX=/usr CMD ['/bin/bash'] diff --git a/Dockerfile.ubuntu-64 b/Dockerfile.ubuntu-64 index 9a8fb30..1e7a97d 100644 --- a/Dockerfile.ubuntu-64 +++ b/Dockerfile.ubuntu-64 @@ -6,14 +6,19 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand RUN apt-get update && \ apt-get -y install wget && \ + cd /root && \ wget -O- 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F' | apt-key add - && \ echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main' >> /etc/apt/sources.list && \ apt-get update && \ apt-get install -y gcc-8 g++-8 libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \ libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev git scons cmake perl make bzip2 && \ + ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \ + ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \ + ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \ + ln -sf /usr/bin/g++-8 /usr/bin/g++ && \ wget -O- https://download.mono-project.com/sources/mono/mono-${mono_version}.tar.bz2 | tar xj && \ cd mono-${mono_version} && \ - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu CC=gcc-8 CXX=g++-8 && \ + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu && \ make -j && \ make install && \ cert-sync /etc/ssl/certs/ca-certificates.crt && \ @@ -27,11 +32,9 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/ && \ rm *.deb && \ - ln -sf /usr/bin/gcc-ranlib-8 /usr/bin/gcc-ranlib && \ - ln -sf /usr/bin/gcc-ar-8 /usr/bin/gcc-ar && \ - rm -rf /root/${mono_version} + rm -rf /root/mono-${mono_version} -ENV CC=gcc-8 -ENV CXX=g++-8 +ENV MONO32_PREFIX=/usr +ENV MONO64_PREFIX=/usr CMD ['/bin/bash'] diff --git a/Dockerfile.windows b/Dockerfile.windows index 88282c9..522cc27 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -29,4 +29,7 @@ RUN dnf -y install scons mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static cp -rvp /etc/mono /root/dependencies/mono-32/etc && \ rm -rf /root/mono-${mono_version} +ENV MONO32_PREFIX=/root/dependencies/mono-32 +ENV MONO64_PREFIX=/root/dependencies/mono-64 + CMD ['/bin/bash'] diff --git a/files/mono-config-macosx b/files/mono-config-macosx new file mode 100644 index 0000000..5e1976f --- /dev/null +++ b/files/mono-config-macosx @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +