Skip to content

Commit 6034764

Browse files
committed
Move install of mig to osxcross install
.. since it is not cross platform dependent, so we can save some space when common image layers are used. Also adjust indention.
1 parent 6371091 commit 6034764

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

Dockerfile.mri.erb

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,19 @@ RUN dpkg -i /debs/*.deb
2828

2929
<% elsif platform =~ /aarch64-mingw-ucrt/ %>
3030

31-
RUN echo $TARGETPLATFORM
3231
RUN <<EOF
33-
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
34-
DOWNLOAD_PLATFORM="x86_64";
35-
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
36-
DOWNLOAD_PLATFORM="aarch64";
37-
else
38-
echo "Unsupported platform $TARGETPLATFORM";
39-
exit 1;
40-
fi &&
41-
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-ubuntu-20.04-$DOWNLOAD_PLATFORM.tar.xz && \
42-
tar xf llvm-mingw*.tar.xz && \
43-
mv `ls -d llvm-mingw-*/` /llvm-mingw && \
44-
echo "export PATH=/llvm-mingw/bin:\$PATH" >> /etc/rubybashrc && \
32+
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
33+
DOWNLOAD_PLATFORM="x86_64";
34+
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
35+
DOWNLOAD_PLATFORM="aarch64";
36+
else
37+
echo "Unsupported platform $TARGETPLATFORM";
38+
exit 1;
39+
fi &&
40+
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-ucrt-ubuntu-20.04-$DOWNLOAD_PLATFORM.tar.xz &&
41+
tar xf llvm-mingw*.tar.xz &&
42+
mv `ls -d llvm-mingw-*/` /llvm-mingw &&
43+
echo "export PATH=/llvm-mingw/bin:\$PATH" >> /etc/rubybashrc &&
4544
rm -r /llvm-mingw/bin/i686-w64* /llvm-mingw/bin/armv7-w64* /llvm-mingw/bin/x86_64-w64* /llvm-mingw/i686-w64* /llvm-mingw/armv7-w64* /llvm-mingw/x86_64-w64*
4645
EOF
4746

@@ -65,6 +64,20 @@ if platform =~ /x64-mingw32/ %> gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
6564
<% if platform =~ /darwin/ %>
6665
COPY build/mk_osxcross.sh /tmp
6766
RUN /tmp/mk_osxcross.sh
67+
68+
# Install mig which is a Macos specific RPC code generator, which is part of xcode
69+
RUN apt-get -y update && \
70+
apt-get install -y bison flex && \
71+
rm -rf /var/lib/apt/lists/*
72+
RUN git clone --branch=cross_platform https://github.com/markmentovai/bootstrap_cmds && \
73+
cd bootstrap_cmds && \
74+
autoreconf --install && \
75+
sh configure && \
76+
make && \
77+
sed -E -i 's/^cppflags=(.*)/cppflags=(\1 "-D<%= platform =~ /arm64/ ? "__arm64__" : "__x86_64__" %>" "-I\/opt\/osxcross\/target\/SDK\/MacOSX11.1.sdk\/usr\/include")/' migcom.tproj/mig.sh && \
78+
sudo make install && \
79+
cd .. && \
80+
rm -rf bootstrap_cmds
6881
<% end %>
6982

7083

@@ -232,18 +245,6 @@ RUN sudo cp /llvm-mingw/aarch64-w64-mingw32/bin/libc++.dll /llvm-mingw/aarch64-w
232245
COPY build/strip_wrapper_codesign /root/
233246
RUN mv /opt/osxcross/target/bin/<%= target %>-strip /opt/osxcross/target/bin/<%= target %>-strip.bin && \
234247
ln /root/strip_wrapper_codesign /opt/osxcross/target/bin/<%= target %>-strip
235-
236-
# Install mig which is a Macos specific RPC code generator, which is part of xcode
237-
RUN apt-get -y update && \
238-
apt-get install -y bison flex && \
239-
rm -rf /var/lib/apt/lists/*
240-
RUN git clone --branch=cross_platform https://github.com/markmentovai/bootstrap_cmds && \
241-
cd bootstrap_cmds && \
242-
autoreconf --install && \
243-
sh configure && \
244-
make && \
245-
sed -E -i 's/^cppflags=(.*)/cppflags=(\1 "-D<%= platform =~ /arm64/ ? "__arm64__" : "__x86_64__" %>" "-I\/opt\/osxcross\/target\/SDK\/MacOSX11.1.sdk\/usr\/include")/' migcom.tproj/mig.sh && \
246-
sudo make install
247248
<% end %>
248249

249250
<% if platform =~ /arm64-darwin/ %>

0 commit comments

Comments
 (0)