-
Notifications
You must be signed in to change notification settings - Fork 456
Build ffmpeg for linux-arm, linux-arm64, linux-x86 #6288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
26f578b
3c27bf7
939b2c1
5c8ce4f
f067a17
7821765
f260648
f226655
240a955
3e1a3e4
991b0d9
ffaf5dd
2cdec6a
0972bd3
8793a3a
bf113a8
64d129a
6452d45
e998242
44d68e5
5b9ae47
a2a0102
7824a71
2c82111
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ on: workflow_dispatch | |
| jobs: | ||
| build-macos: | ||
| name: Build macOS | ||
| runs-on: macos-12 | ||
| runs-on: macos-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
|
|
@@ -55,22 +55,25 @@ jobs: | |
| path: macOS-universal | ||
|
|
||
| build-win: | ||
| name: Build Windows | ||
| name: Build Windows (${{ matrix.arch }}) | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| arch: | ||
| - x86 | ||
| - x64 | ||
| - x86 | ||
| - arm64 | ||
| container: | ||
| image: mstorsjo/llvm-mingw:latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install nasm mingw-w64 | ||
| apt-get update -y -qq | ||
| apt-get install -y nasm mingw-w64 | ||
|
|
||
| - name: Build | ||
| run: osu.Framework.NativeLibs/scripts/ffmpeg/build-win.sh | ||
|
|
@@ -83,81 +86,67 @@ jobs: | |
| name: win-${{ matrix.arch }} | ||
| path: win-${{ matrix.arch }} | ||
|
|
||
| # The win-arm64 build runs in a special MinGW container to cross-compile successfully. | ||
| build-win-arm64: | ||
| name: Build Windows (arm64) | ||
| runs-on: ubuntu-22.04 | ||
| container: | ||
| image: mstorsjo/llvm-mingw:latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build | ||
| run: osu.Framework.NativeLibs/scripts/ffmpeg/build-win.sh | ||
| env: | ||
| arch: arm64 | ||
|
|
||
| - name: Upload | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: win-arm64 | ||
| path: win-arm64 | ||
|
|
||
| build-linux: | ||
| name: Build Linux (x64) | ||
| name: Build Linux (${{ matrix.arch }}) | ||
| # Use 20.04 to target glibc 2.31 like the other native libs | ||
| runs-on: ubuntu-20.04 | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - { arch: x64, container: "ubuntu:20.04" } | ||
| - { arch: x86, container: "i386/ubuntu:20.04" } | ||
| - { arch: arm64, container: "arm64v8/ubuntu:20.04" } | ||
| - { arch: arm, container: "arm32v7/ubuntu:20.04" } | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install nasm libva-dev libvdpau-dev | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup QEMU | ||
| if: ${{ contains(matrix.arch, 'arm') }} | ||
| uses: docker/setup-qemu-action@v2 | ||
|
|
||
| - name: Build | ||
| run: osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: ${{ matrix.container }} | ||
| options: -v ${{ github.workspace }}:/workspace -w /workspace -e DEBIAN_FRONTEND=noninteractive | ||
| run: | | ||
| apt-get update -y -qq | ||
| apt-get install -y build-essential curl nasm libva-dev libvdpau-dev | ||
|
||
| osu.Framework.NativeLibs/scripts/ffmpeg/build-linux.sh | ||
|
|
||
| - name: Upload | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-x64 | ||
| path: linux-x64 | ||
| name: linux-${{ matrix.arch }} | ||
| path: linux-${{ matrix.arch }} | ||
|
|
||
| make-pr: | ||
| name: Create pull request | ||
| runs-on: ubuntu-22.04 | ||
| needs: | ||
| - combine-macos | ||
| - build-win | ||
| - build-win-arm64 | ||
| - build-linux | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - { name: macOS-universal, path: osu.Framework.NativeLibs/runtimes/osx/native } | ||
| - { name: linux-arm64, path: osu.Framework.NativeLibs/runtimes/linux-arm64/native} | ||
| - { name: linux-arm, path: osu.Framework.NativeLibs/runtimes/linux-arm/native} | ||
| - { name: linux-x64, path: osu.Framework.NativeLibs/runtimes/linux-x64/native} | ||
| - { name: linux-x86, path: osu.Framework.NativeLibs/runtimes/linux-x86/native} | ||
| - { name: win-arm64, path: osu.Framework.NativeLibs/runtimes/win-arm64/native} | ||
| - { name: win-x64, path: osu.Framework.NativeLibs/runtimes/win-x64/native} | ||
| - { name: win-x86, path: osu.Framework.NativeLibs/runtimes/win-x86/native} | ||
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: macOS-universal | ||
| path: osu.Framework.NativeLibs/runtimes/osx/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: linux-x64 | ||
| path: osu.Framework.NativeLibs/runtimes/linux-x64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: win-arm64 | ||
| path: osu.Framework.NativeLibs/runtimes/win-arm64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: win-x64 | ||
| path: osu.Framework.NativeLibs/runtimes/win-x64/native | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: win-x86 | ||
| path: osu.Framework.NativeLibs/runtimes/win-x86/native | ||
| name: ${{ matrix.name }} | ||
| path: ${{ matrix.path }} | ||
|
|
||
| - uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,21 @@ FFMPEG_FLAGS+=( | |
| ) | ||
|
|
||
| pushd . > /dev/null | ||
| prep_ffmpeg linux-x64 | ||
|
|
||
| if [ $(uname -m) == "x86_64" ]; then | ||
| ARCH="x64" | ||
| elif [ $(uname -m) == "i686" ]; then | ||
| ARCH="x86" | ||
| elif [ $(uname -m) == "aarch64" ]; then | ||
| ARCH="arm64" | ||
| elif [ $(uname -m) == "armv7l" ]; then | ||
| ARCH="arm" | ||
| else | ||
| echo "Unsupported architecture: $(uname -m)" | ||
| exit 1 | ||
| fi | ||
|
||
|
|
||
| prep_ffmpeg linux-$ARCH | ||
| # Apply patch from upstream to fix errors with new binutils versions: | ||
| # Ticket: https://fftrac-bg.ffmpeg.org/ticket/10405 | ||
| # This patch should be removed when FFmpeg is updated to >=6.1 | ||
|
|
@@ -28,7 +42,7 @@ popd > /dev/null | |
|
|
||
| # gcc creates multiple symlinks per .so file for versioning. | ||
| # We delete the symlinks and rename the real files to include the major library version | ||
| rm linux-x64/*.so | ||
| for f in linux-x64/*.so.*.*.*; do | ||
| rm linux-$ARCH/*.so | ||
| for f in linux-$ARCH/*.so.*.*.*; do | ||
| mv -vf "$f" "${f%.*.*}" | ||
| done | ||
Uh oh!
There was an error while loading. Please reload this page.