2024-12-16 03:54:21 +00:00
|
|
|
# This Dockerfile produces a base image for builds.
|
|
|
|
# It includes all dependencies necessary to cross-compile for Windows/MacOS/Linux.
|
|
|
|
|
|
|
|
FROM crazymax/osxcross:latest-ubuntu AS osxcross
|
|
|
|
|
|
|
|
FROM rust:latest
|
|
|
|
RUN rustup target add x86_64-pc-windows-msvc && \
|
|
|
|
rustup target add x86_64-apple-darwin && \
|
2024-12-17 04:24:17 +00:00
|
|
|
rustup target add aarch64-apple-darwin && \
|
2024-12-16 03:54:21 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y clang lld libc6-dev libasound2-dev libudev-dev genisoimage && \
|
|
|
|
cargo install cargo-bundle xwin
|
|
|
|
COPY --from=osxcross /osxcross /osxcross
|
|
|
|
RUN xwin --accept-license splat --output xwin && rm -rf .xwin-cache
|
|
|
|
ENV PATH="/osxcross/bin:$PATH" \
|
|
|
|
LD_LIBRARY_PATH="/osxcross/lib" \
|
|
|
|
CC="clang" CXX="clang++" AR="llvm-ar-14" \
|
|
|
|
CC_x86_64-apple-darwin="o64-clang" \
|
|
|
|
CXX_x86_64-apple-darwin="o64-clang++" \
|
2024-12-17 04:24:17 +00:00
|
|
|
CC_aarch64-apple-darwin="oa64-clang" \
|
|
|
|
CXX_aarch64-apple-darwin="o6a4-clang++" \
|
2024-12-16 03:54:21 +00:00
|
|
|
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER="lld-link" \
|
|
|
|
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="o64-clang" \
|
|
|
|
CARGO_TARGET_X86_64_APPLE_DARWIN_AR="llvm-ar-14" \
|
2024-12-17 04:24:17 +00:00
|
|
|
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="oa64-clang" \
|
|
|
|
CARGO_TARGET_AARCH64_APPLE_DARWIN_AR="llvm-ar-14" \
|
2024-12-16 03:54:21 +00:00
|
|
|
RUSTFLAGS="-Lnative=/xwin/crt/lib/x86_64 -Lnative=/xwin/sdk/lib/um/x86_64 -Lnative=/xwin/sdk/lib/ucrt/x86_64" \
|
|
|
|
MACOSX_DEPLOYMENT_TARGET="14.5"
|