Skip to content

Commit

Permalink
update build_gnu_docker.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
heqingpan committed Apr 1, 2024
1 parent f05cc68 commit ac1c971
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions docker/build_gnu_docker.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
#!/bin/sh

echo "start build_gnu_docker"
echo "TARGETARCH: " $TARGETARCH
echo "TARGETPLATFORM: " $TARGETPLATFORM
echo "BUILDPLATFORM: " $BUILDPLATFORM

CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
if [ "$TARGETPLATFORM" = "linux/arm64" ]; then
apt-get update && apt-get install -y aarch64-linux-gnu-gcc
CARGO_BUILD_TARGET="aarch64-unknown-linux-gnu"
fi

echo "start build_gnu_docker"
echo "TARGETARCH: " $TARGETARCH
echo "TARGETPLATFORM: " $TARGETPLATFORM
echo "BUILDPLATFORM: " $BUILDPLATFORM
echo "CARGO_BUILD_TARGET: " $CARGO_BUILD_TARGET

if [ "$TARGETPLATFORM" = "linux/arm64" ];
then
echo "build aarch64-unknown-linux-gnu" $TARGETPLATFORM
rustup target add aarch64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
mv target/aarch64-unknown-linux-gnu/release/rnacos /usr/bin/rnacos
else
echo "build x86_64-unknown-linux-gnu" $TARGETPLATFORM
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu
mv target/x86_64-unknown-linux-gnu/release/rnacos /usr/bin/rnacos
fi
rustup target add $CARGO_BUILD_TARGET
cargo build --release --target $CARGO_BUILD_TARGET
mv target/$CARGO_BUILD_TARGET/release/rnacos /usr/bin/rnacos

echo "end build_gnu_docker"

0 comments on commit ac1c971

Please sign in to comment.