-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.osx-cross
80 lines (61 loc) · 2.22 KB
/
Dockerfile.osx-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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt install -y \
clang llvm-dev libxml2-dev uuid-dev \
libssl-dev bash patch tar xz-utils bzip2 \
gzip sed cpio libbz2-dev ca-certificates vim \
cmake fuse libfuse-dev wget git ninja-build
ENV DEBIAN_FRONTEND=dialog
ENV WORKDIR=root/project
RUN mkdir $WORKDIR
#Set the working dir to the env variable
WORKDIR $WORKDIR
RUN git clone https://github.com/tpoechtrager/osxcross
RUN cd osxcross/tools \
&& ./get_dependencies.sh
#COPY Xcode_*.xip .
#
#RUN cd osxcross/tools \
# && ./gen_sdk_package_pbzx.sh ../../Xcode_*.xip \
# && mv MacOSX*.sdk.tar.xz ../tarballs
RUN cd osxcross/tarballs \
&& wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz
RUN cd osxcross \
&& UNATTENDED=1 ./build.sh
RUN mv osxcross/target /opt/osxcross
RUN wget https://github.com/darlinghq/darling/releases/download/v0.1.20220704/darling_0.1.20220704.focal_amd64.deb
RUN apt-get update \
&& apt install -y \
libavcodec58 libavformat58 libavutil56 \
libcairo2 libdbus-1-3 libegl1 libgif7 libgl1 \
libglu1-mesa libglu1 libpulse0 libswresample3 \
libxcursor1 libxkbfile1 libxrandr2
RUN dpkg -i darling_0.1.20220704.focal_amd64.deb
ENV WORKDIR=/root/project/Warf
RUN mkdir $WORKDIR
WORKDIR $WORKDIR
COPY test test
COPY fuzz fuzz
COPY CMakeLists.txt CMakeLists.txt
COPY scripts scripts
COPY cli-test-cases cli-test-cases
COPY src src
# Equivalent of PATH="$PATH:/opt/osxcross/bin"
ENV PATH="${PATH}:/opt/osxcross/bin"
#ENV LD_LIBRARY_PATH="/opt/osxcross/lib:${$LD_LIBRARY_PATH}"
ENV LD_LIBRARY_PATH=/opt/osxcross/lib:$LD_LIBRARY_PATH
RUN export LD_LIBRARY_PATH \
&& cmake -S . -B build \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=o64-clang \
-DCMAKE_CXX_COMPILER=o64-clang++ \
-DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_CROSS_COMPILING=TRUE \
-DCMAKE_LINKER=x86_64-apple-darwin20.4-ld \
-DCMAKE_C_COMPILER_AR=x86_64-apple-darwin20.4-ar \
-DCMAKE_CXX_COMPILER_AR=x86_64-apple-darwin20.4-ar \
-DBuildTest=TRUE
RUN ninja -C./build
#Note Darling can't run in Docker.
#RUN darling shell build/test/WarfLang_TEST
#RUN darling shell build/src/cli/Warf.exe cli-test-cases/add.wef