mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2025-04-08 05:00:02 +03:00
Build for Linux ARM
This commit is contained in:
parent
df17032377
commit
b5f35dcf36
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Packages
|
||||
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
|
||||
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@ -41,7 +41,7 @@ jobs:
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Packages
|
||||
run: sudo add-apt-repository ppa:savoury1/ffmpeg4 -y && sudo add-apt-repository ppa:savoury1/ffmpeg5 -y && sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
|
||||
run: sudo add-apt-repository ppa:savoury1/ffmpeg4 -y && sudo add-apt-repository ppa:savoury1/ffmpeg5 -y && sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@ -59,6 +59,25 @@ jobs:
|
||||
name: bliss-analyser-linux-x86-ffmpeg5
|
||||
path: releases/
|
||||
|
||||
Linux_ARM:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
docker run --rm -v $(pwd):/source dlecan/rust-crosscompiler-arm:stable
|
||||
docker build -t bliss-analyser-cross - < docker/Dockerfile
|
||||
docker run --rm -v $PWD/target:/build -v $PWD:/src bliss-analyser-cross
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bliss-analyser-linux-arm
|
||||
path: releases/
|
||||
|
||||
macOS:
|
||||
runs-on: macos-11.0
|
||||
|
||||
|
29
docker/Dockerfile
Normal file
29
docker/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
# Cross compilation environment for bliss-mixer
|
||||
|
||||
FROM debian:stretch
|
||||
|
||||
RUN dpkg --add-architecture arm64 && \
|
||||
dpkg --add-architecture armhf
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -y curl git build-essential gcc-multilib musl-tools musl-dev musl && \
|
||||
apt-get install -y yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg && \
|
||||
apt-get install -y crossbuild-essential-armhf crossbuild-essential-arm64
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
ENV PATH="/root/.cargo/bin/:${PATH}"
|
||||
RUN rustup target add aarch64-unknown-linux-gnu && \
|
||||
rustup target add arm-unknown-linux-gnueabihf
|
||||
|
||||
RUN mkdir /.cargo && \
|
||||
echo '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' > /.cargo/config && \
|
||||
echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config
|
||||
|
||||
RUN mkdir /build
|
||||
ENV CARGO_TARGET_DIR /build
|
||||
ENV CARGO_HOME /build/cache
|
||||
|
||||
RUN mkdir /src
|
||||
|
||||
WORKDIR /src
|
||||
CMD ["/src/docker/docker-build.sh"]
|
26
docker/docker-build.sh
Executable file
26
docker/docker-build.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
## #!/usr/bin/env bash
|
||||
set -eux
|
||||
|
||||
uname -a
|
||||
DESTDIR=/src/releases
|
||||
|
||||
for d in armhf-linux aarch64-linux ; do
|
||||
mkdir -p $DESTDIR/$d
|
||||
rm -f $DESTDIR/$d/*
|
||||
done
|
||||
|
||||
function build {
|
||||
echo Building for $1 to $3...
|
||||
|
||||
if [[ ! -f /build/$1/release/bliss-analyser ]]; then
|
||||
cargo build --release --target $1
|
||||
fi
|
||||
|
||||
$2 /build/$1/release/bliss-analyser && cp /build/$1/release/bliss-analyser $DESTDIR/$3
|
||||
}
|
||||
|
||||
build arm-unknown-linux-gnueabihf arm-linux-gnueabihf-strip armhf-linux/bliss-analyser
|
||||
build aarch64-unknown-linux-gnu aarch64-linux-gnu-strip aarch64-linux/bliss-analyser
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user