125 installation missing aarch64 linux build (#146)

aarch64 build
This commit is contained in:
Christian Visintin
2023-02-11 12:22:34 +01:00
committed by veeso
parent 1c75c7d386
commit c0bc493d21
8 changed files with 179 additions and 43 deletions

30
dist/build/aarch64_centos7/Dockerfile vendored Normal file
View File

@@ -0,0 +1,30 @@
FROM centos:centos7 as builder
ARG branch
ENV branch=$branch
WORKDIR /usr/src/
# Install dependencies
RUN yum -y install \
git \
gcc \
pkgconfig \
gcc \
make \
dbus-devel \
bash \
rpm-build
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh && \
chmod +x /tmp/rust.sh && \
/tmp/rust.sh -y
# Clone repository
RUN git clone --branch $branch https://github.com/veeso/termscp.git
# Set workdir to termscp
WORKDIR /usr/src/termscp/
# Build for x86_64
RUN source $HOME/.cargo/env && cargo build --release
# Install cargo rpm
RUN source $HOME/.cargo/env && cargo install cargo-rpm
# Build pkgs
RUN source $HOME/.cargo/env && cargo rpm init && cargo rpm build
CMD ["sh"]

31
dist/build/aarch64_debian9/Dockerfile vendored Normal file
View File

@@ -0,0 +1,31 @@
FROM debian:stretch
ARG branch
ENV branch=$branch
WORKDIR /usr/src/
# Install dependencies
RUN apt update && apt install -y \
git \
gcc \
pkg-config \
libdbus-1-dev \
build-essential \
bash \
curl
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh && \
chmod +x /tmp/rust.sh && \
/tmp/rust.sh -y
# Clone repository
RUN git clone --branch $branch https://github.com/veeso/termscp.git
# Set workdir to termscp
WORKDIR /usr/src/termscp/
# Install cargo deb
RUN . $HOME/.cargo/env && cargo install cargo-deb
# Build for x86_64
RUN . $HOME/.cargo/env && cargo build --release
# Build pkgs
RUN . $HOME/.cargo/env && cargo deb
CMD ["bash"]

39
dist/build/linux-aarch64.sh vendored Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
exit 1
fi
VERSION=$1
set -e # Don't fail
# Create pkgs directory
cd ..
PKGS_DIR=$(pwd)/pkgs
cd -
mkdir -p ${PKGS_DIR}/
# Build aarch64_deb
cd aarch64_debian9/
docker buildx build --platform linux/arm64 --build-arg branch=${VERSION} --tag termscp-${VERSION}-aarch64_debian9 .
cd -
mkdir -p ${PKGS_DIR}/deb/
mkdir -p ${PKGS_DIR}/aarch64-unknown-linux-gnu/
CONTAINER_NAME=$(docker create termscp-${VERSION}-aarch64_debian9 /bin/bash)
docker cp ${CONTAINER_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}_arm64.deb ${PKGS_DIR}/deb/
docker cp ${CONTAINER_NAME}:/usr/src/termscp/target/release/termscp ${PKGS_DIR}/aarch64-unknown-linux-gnu/
# Make tar.gz
cd ${PKGS_DIR}/aarch64-unknown-linux-gnu/
tar cvzf termscp-v${VERSION}-aarch64-unknown-linux-gnu.tar.gz termscp
rm termscp
cd -
# Build aarch64_centos7
cd aarch64_centos7/
docker buildx build --platform linux/arm64 --build-arg branch=${VERSION} --tag termscp-${VERSION}-aarch64_centos7 .
cd -
mkdir -p ${PKGS_DIR}/rpm/
CONTAINER_NAME=$(docker create termscp-${VERSION}-aarch64_centos7 /bin/bash)
docker cp ${CONTAINER_NAME}:/usr/src/termscp/target/release/rpmbuild/RPMS/aarch64/termscp-${VERSION}-1.el7.aarch64.rpm ${PKGS_DIR}/rpm/termscp-${VERSION}-1.aarch64.rpm
exit $?

View File

@@ -1,7 +1,7 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: docker.sh <version>"
echo "Usage: $0 <version>"
exit 1
fi