Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
fidoriel committed Oct 27, 2024
1 parent b24c3a4 commit f92a854
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM --platform=$BUILDPLATFORM rust:1.82-bookworm AS rust-builder

RUN apt-get update -y && apt-get install gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu -y
RUN apt-get update -y && apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu -y

RUN apt-get install -y cmake pkg-config

RUN rustup target add x86_64-unknown-linux-gnu
RUN rustup target add aarch64-unknown-linux-gnu
Expand All @@ -19,22 +21,17 @@ ARG BUILDPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
dpkg --add-architecture arm64 && \
apt-get update -y && \
apt-get install -y sqlite3:arm64 libsqlite3-dev:arm64; \
apt-get install -y libsqlite3-dev:arm64 libfontconfig1-dev:arm64 libexpat1-dev:arm64 && \
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu && \
export PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/lib/pkgconfig && \
export TARGET_CHAIN=aarch64-unknown-linux-gnu; \
elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
dpkg --add-architecture amd64 && \
apt-get update -y && \
apt-get install -y sqlite3:amd64 libsqlite3-dev:amd64; \
else \
echo "Unsupported architecture: $TARGETPLATFORM" && exit 1; \
fi

RUN echo "Running on $BUILDPLATFORM building for $TARGETPLATFORM"
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
export TARGET_CHAIN=aarch64-unknown-linux-gnu; \
elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
export TARGET_CHAIN=x86_64-unknown-linux-gnu; \
else \
echo "Unsupported architecture: $TARGETPLATFORM" && exit 1; \
apt-get install -y libsqlite3-dev:amd64 libfreetype6-dev:amd64 libfontconfig1-dev:amd64 libexpat1-dev:amd64 && \
export PKG_CONFIG_SYSROOT_DIR=/usr/x86_64-linux-gnu && \
export PKG_CONFIG_PATH=/usr/x86_64-linux-gnu/lib/pkgconfig && \
export TARGET_CHAIN=x86_64-unknown-linux-gnu; \
fi && \
cargo build --release --target $TARGET_CHAIN && \
mv target/$TARGET_CHAIN/release/meshvault .
Expand Down

0 comments on commit f92a854

Please sign in to comment.