-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile.i686-pc-windows-msvc-cross
50 lines (40 loc) · 1.57 KB
/
Dockerfile.i686-pc-windows-msvc-cross
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
# run these in separate steps, so we can cache MSVC between all images.
COPY cross-toolchains/docker/msvc-wine.sh /
RUN /msvc-wine.sh
COPY wine.sh /
RUN /wine.sh
# need windows-style perl for paths
COPY cross-toolchains/docker/perl.sh /
RUN /perl.sh
ARG ARCH=x86
COPY cross-toolchains/docker/msvc-wine-symlink.sh /
RUN /msvc-wine-symlink.sh $ARCH
# run-detectors are responsible for calling the correct interpreter for exe
# files. For some reason it does not work inside a docker container (it works
# fine in the host). So we replace the usual paths of run-detectors to run wine
# directly. This only affects the guest, we are not messing up with the host.
#
# See /usr/share/doc/binfmt-support/detectors
RUN mkdir -p /usr/lib/binfmt-support/ && \
rm -f /usr/lib/binfmt-support/run-detectors /usr/bin/run-detectors && \
ln -s /usr/bin/wine /usr/lib/binfmt-support/run-detectors && \
ln -s /usr/bin/wine /usr/bin/run-detectors
COPY cross-toolchains/docker/msvc-windows-entry.sh /
ENTRYPOINT ["/msvc-windows-entry.sh"]
ENV CARGO_TARGET_I686_PC_WINDOWS_MSVC_LINKER=link.exe \
CARGO_TARGET_I686_PC_WINDOWS_MSVC_RUNNER=wine \
CC_i686_pc_windows_msvc=cl.exe \
CXX_i686_pc_windows_msvc=cl.exe \
PATH=/opt/msvc/bin/$ARCH:/opt/bin:$PATH \
WINEPATH="$WINEPATH;C:/windows/syswow64;C:/windows/system32;/opt/msvc/bin/$ARCH" \
VSINSTALLDIR="/opt/msvc" \
VCINSTALLDIR="/opt/msvc/vc" \
VSCMD_ARG_TGT_ARCH=$ARCH