lemur/build.Dockerfile

35 lines
1.5 KiB
Docker
Raw Permalink Normal View History

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 && \
2024-12-19 00:40:06 +00:00
apt-get install -y clang-19 lld-19 libc6-dev libasound2-dev libudev-dev genisoimage mingw-w64 && \
cargo install cargo-bundle xwin && \
xwin --accept-license splat --output xwin && \
rm -rf .xwin-cache && \
ln -s $(which clang-19) /usr/bin/clang && \
ln -s $(which clang++-19) /usr/bin/clang++
2024-12-16 03:54:21 +00:00
COPY --from=osxcross /osxcross /osxcross
2024-12-19 00:40:06 +00:00
2024-12-16 03:54:21 +00:00
ENV PATH="/osxcross/bin:$PATH" \
LD_LIBRARY_PATH="/osxcross/lib" \
2024-12-19 00:40:06 +00:00
CC="clang-19" CXX="clang++-19" AR="llvm-ar-19" \
2024-12-16 03:54:21 +00:00
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-19 00:40:06 +00:00
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER="lld-link-19" \
2024-12-16 03:54:21 +00:00
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="o64-clang" \
2024-12-19 00:40:06 +00:00
CARGO_TARGET_X86_64_APPLE_DARWIN_AR="llvm-ar-19" \
2024-12-17 04:24:17 +00:00
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="oa64-clang" \
2024-12-19 00:40:06 +00:00
CARGO_TARGET_AARCH64_APPLE_DARWIN_AR="llvm-ar-19" \
CROSS_COMPILE="setting-this-to-silence-a-warning-" \
RC_PATH="llvm-rc-19" \
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"