Add cross-compilation support for Linux and Windows
- Add Docker-based build system for cross-compiling on Apple Silicon - Create Dockerfiles for Linux x86_64 and ARM64, Windows x86_64 - Add build-all.sh script for automated multi-platform builds - Configure cargo-deb and cargo-generate-rpm for Linux packaging - Update README with cross-compilation instructions Supported outputs: - Linux x86_64: .deb, .rpm, .tar.gz - Windows x86_64: .zip Note: Linux ARM64 disabled due to upstream zune-jpeg NEON bug
This commit is contained in:
22
docker/Dockerfile.linux-arm64
Normal file
22
docker/Dockerfile.linux-arm64
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM --platform=linux/amd64 rust:1.85-bookworm
|
||||
|
||||
# Install build dependencies and ARM64 cross-compiler
|
||||
RUN dpkg --add-architecture arm64 && apt-get update && apt-get install -y \
|
||||
cmake \
|
||||
nasm \
|
||||
meson \
|
||||
ninja-build \
|
||||
gcc-aarch64-linux-gnu \
|
||||
g++-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add the ARM64 target
|
||||
RUN rustup target add aarch64-unknown-linux-gnu
|
||||
|
||||
# Configure cargo for cross-compilation
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
|
||||
ENV CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
|
||||
ENV CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
|
||||
|
||||
WORKDIR /build
|
||||
25
docker/Dockerfile.linux-x86_64
Normal file
25
docker/Dockerfile.linux-x86_64
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM --platform=linux/amd64 rust:1.85-bookworm
|
||||
|
||||
# Install build dependencies for libavif, dav1d, and GUI
|
||||
RUN apt-get update && apt-get install -y \
|
||||
cmake \
|
||||
nasm \
|
||||
meson \
|
||||
ninja-build \
|
||||
libx11-dev \
|
||||
libxcursor-dev \
|
||||
libxrandr-dev \
|
||||
libxi-dev \
|
||||
libgl1-mesa-dev \
|
||||
libwayland-dev \
|
||||
libxkbcommon-dev \
|
||||
rpm \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add the target
|
||||
RUN rustup target add x86_64-unknown-linux-gnu
|
||||
|
||||
# Install packaging tools
|
||||
RUN cargo install cargo-deb cargo-generate-rpm
|
||||
|
||||
WORKDIR /build
|
||||
20
docker/Dockerfile.windows-x86_64
Normal file
20
docker/Dockerfile.windows-x86_64
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM --platform=linux/amd64 rust:1.85-bookworm
|
||||
|
||||
# Install build dependencies and MinGW cross-compiler
|
||||
RUN apt-get update && apt-get install -y \
|
||||
cmake \
|
||||
nasm \
|
||||
meson \
|
||||
ninja-build \
|
||||
mingw-w64 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add the Windows target
|
||||
RUN rustup target add x86_64-pc-windows-gnu
|
||||
|
||||
# Configure cargo for cross-compilation
|
||||
ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc
|
||||
ENV CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc
|
||||
ENV CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++
|
||||
|
||||
WORKDIR /build
|
||||
Reference in New Issue
Block a user