Skip to content

Commit

Permalink
Build on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Jan 27, 2020
1 parent b74bfe0 commit 820c7cd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 94 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install yasm cmake libavcodec-dev libavformat-dev libavutil-dev \
libavresample-dev libfftw3-dev libgtest-dev libboost-all-dev
libavresample-dev libfftw3-dev libgtest-dev
- name: Test with ${{ env.FFT_LIB }}
run: |
mkdir build.test.$FFT_LIB
Expand Down Expand Up @@ -59,22 +59,27 @@ jobs:
arch:
- x86_64
- i686
- armv7-a
- armv8-a
exclude:
- os: windows
arch: armv7-a
- os: windows
arch: armv8-a
env:
ARCH: ${{ matrix.arch }}
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install yasm cmake libavcodec-dev libavformat-dev libavutil-dev \
libavresample-dev libfftw3-dev libgtest-dev libboost-all-dev
- name: Install multilib dependencies
if: matrix.arch == 'i686'
run: sudo apt-get install gcc-multilib g++-multilib
- name: Install Windows cross-compile dependencies
if: matrix.os == 'windows'
run: sudo apt-get install mingw-w64
- name: Install armhf cross-compile dependencies
if: startsWith(matrix.arch, 'arm')
run: sudo apt-get install gcc-multilib-arm-linux-gnueabihf g++-multilib-arm-linux-gnueabihf
- name: Set TAG variable
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down Expand Up @@ -171,4 +176,4 @@ jobs:
with:
files: artifacts/release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85 changes: 0 additions & 85 deletions .gitlab-ci.yml

This file was deleted.

13 changes: 11 additions & 2 deletions package/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trap 'rm -rf $TMP_BUILD_DIR' EXIT

cd $TMP_BUILD_DIR

curl -s -L "https://github.com/acoustid/ffmpeg-build/releases/download/v4.2.2-2/ffmpeg-4.2.2-audio-$OS-$ARCH.tar.gz" | tar xz
curl -s -L "https://github.com/acoustid/ffmpeg-build/releases/download/v4.2.2-3/ffmpeg-4.2.2-audio-$OS-$ARCH.tar.gz" | tar xz
export FFMPEG_DIR=$TMP_BUILD_DIR/$(ls -d ffmpeg-* | tail)

CMAKE_ARGS=(
Expand Down Expand Up @@ -53,12 +53,21 @@ linux)
-DCMAKE_CXX_FLAGS='-m32 -static -static-libgcc -static-libstdc++'
)
;;
x86_64|armhf)
x86_64)
CMAKE_ARGS+=(
-DCMAKE_C_FLAGS='-static -static-libgcc -static-libstdc++'
-DCMAKE_CXX_FLAGS='-static -static-libgcc -static-libstdc++'
)
;;
arm*)
perl -pe "s!{EXTRA_PATHS}!$FFMPEG_DIR!g" $BASE_DIR/package/toolchain-armhf.cmake.in | perl -pe "s!{ARCH}!$ARCH!g" >toolchain.cmake
CMAKE_ARGS+=(
-DCMAKE_TOOLCHAIN_FILE=$TMP_BUILD_DIR/toolchain.cmake
-DCMAKE_C_FLAGS='-static -static-libgcc -static-libstdc++'
-DCMAKE_CXX_FLAGS='-static -static-libgcc -static-libstdc++'
)
STRIP=arm-linux-gnueabihf-strip
;;
*)
echo "unsupported architecture ($ARCH)"
exit 1
Expand Down
8 changes: 8 additions & 0 deletions package/toolchain-armhf.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR {ARCH})
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf {EXTRA_PATHS})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

0 comments on commit 820c7cd

Please sign in to comment.