From 41fc770431d6c0c9b59eef7754dae6ec59c5c79b Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 13 Apr 2026 21:56:09 -0400 Subject: [PATCH 1/2] ci: add alpine linux matrix --- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++++++++++++-- CMakeLists.txt | 1 + README.md | 39 ++++++++++++++++++++++ cmake/ffmpeg/ffmpeg.cmake | 2 +- 4 files changed, 107 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d04ffb0..34107ac5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: permissions: contents: read runs-on: ${{ matrix.os }} + container: ${{ matrix.container }} strategy: fail-fast: false matrix: @@ -57,6 +58,8 @@ jobs: - FFMPEG # name: ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR} name: # each entry must have a matching block in the "include" section below + - Alpine-aarch64 + - Alpine-x86_64 - Darwin-arm64 - Darwin-x86_64 - FreeBSD-aarch64 @@ -67,6 +70,20 @@ jobs: - Windows-AMD64 - Windows-ARM64 include: + - name: Alpine-aarch64 + os: ubuntu-24.04-arm + arch: aarch64 + build_ffmpeg_cuda_llvm: 'OFF' + generator: "Unix Makefiles" + shell: sh + container: alpine:3.22 + - name: Alpine-x86_64 + os: ubuntu-latest + arch: x86_64 + build_ffmpeg_cuda_llvm: 'OFF' + generator: "Unix Makefiles" + shell: sh + container: alpine:3.22 - name: Darwin-arm64 os: macos-14 arch: aarch64 @@ -126,6 +143,50 @@ jobs: run: shell: ${{ matrix.shell }} steps: + - name: Fix arm64 Alpine container + if: runner.arch == 'ARM64' && startsWith(matrix.name, 'Alpine') + uses: laverdet/alpine-arm64@7f0f72ee2f71eb2324e5888e8b6e42b1b53e6160 # v1.0.0 + + # must be before checkout so that git is available in the container + - name: Setup Dependencies Alpine + if: startsWith(matrix.name, 'Alpine') + run: | + set -eux + apk add --no-cache \ + autoconf \ + automake \ + bash \ + build-base \ + cmake \ + freetype-dev \ + git \ + glib-dev \ + gnutls-dev \ + lame-dev \ + libass-dev \ + libdrm-dev \ + libtool \ + libvorbis-dev \ + libx11-dev \ + libxcb-dev \ + libxext-dev \ + libxfixes-dev \ + libxrandr-dev \ + linux-headers \ + meson \ + nasm \ + ninja-build \ + numactl-dev \ + opus-dev \ + pkgconf \ + samurai \ + sdl2-dev \ + texinfo \ + wayland-dev \ + wget \ + xorgproto \ + zlib-dev + - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -133,7 +194,7 @@ jobs: - name: Prepare Dependencies Linux id: cross_compile - if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') + if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') && !startsWith(matrix.name, 'Alpine') run: | echo "::group::distro detection" # detect dist name like bionic, focal, etc @@ -309,7 +370,7 @@ jobs: echo "::endgroup::" - name: Setup Dependencies Linux - if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') + if: runner.os == 'Linux' && !startsWith(matrix.shell, 'freebsd') && !startsWith(matrix.name, 'Alpine') run: | echo "::group::apt update" sudo apt-get update @@ -520,6 +581,8 @@ jobs: set -e cd "$GITHUB_WORKSPACE" + build_ffmpeg_cuda_llvm="${{ matrix.build_ffmpeg_cuda_llvm || 'ON' }}" + if [ "${{ startsWith(matrix.shell, 'freebsd') }}" = true ]; then export CC=$(which clang${{ env.FREEBSD_CLANG_VERSION }}) export CXX=$(which clang++${{ env.FREEBSD_CLANG_VERSION }}) @@ -542,6 +605,7 @@ jobs: -G "${{ matrix.generator }}" \ -DBUILD_ALL=OFF \ -DBUILD_${{ matrix.build }}=ON \ + -DBUILD_FFMPEG_CUDA_LLVM=${build_ffmpeg_cuda_llvm} \ -DCMAKE_TOOLCHAIN_FILE=${{ env.CMAKE_TOOLCHAIN_FILE }} \ -DCMAKE_INSTALL_PREFIX="${{ env.ROOT_PATH }}/build/dist" \ -DPARALLEL_BUILDS=${{ steps.processor_count.outputs.PROCESSOR_COUNT || 1 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 3824f475..0c637c42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ option(BUILD_FFMPEG_CBS_PATCHES "Apply FFmpeg CBS patches" ON) option(BUILD_FFMPEG_MF "Build FFmpeg Media Foundation" ON) option(BUILD_FFMPEG_MF_PATCHES "Apply FFmpeg Media Foundation patches" ON) option(BUILD_FFMPEG_NV_CODEC_HEADERS "Build FFmpeg NV Codec Headers" ON) +option(BUILD_FFMPEG_CUDA_LLVM "Build FFmpeg with cuda_llvm support when NV codec headers are enabled" ON) option(BUILD_FFMPEG_NV_CODEC_HEADERS_PATCHES "Apply FFmpeg NV Codec Headers patches" ON) option(BUILD_FFMPEG_SVT_AV1 "Build FFmpeg SVT-AV1" ON) option(BUILD_FFMPEG_SVT_AV1_PATCHES "Apply FFmpeg SVT-AV1 patches" ON) diff --git a/README.md b/README.md index b56f47a8..ac6ceaf6 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,45 @@ sudo apt install -y \ zlib1g-dev ``` +#### Alpine + +```bash +apk add --no-cache \ + autoconf \ + automake \ + bash \ + build-base \ + cmake \ + freetype-dev \ + git \ + glib-dev \ + gnutls-dev \ + lame-dev \ + libass-dev \ + libdrm-dev \ + libtool \ + libvorbis-dev \ + libx11-dev \ + libxcb-dev \ + libxext-dev \ + libxfixes-dev \ + libxrandr-dev \ + linux-headers \ + meson \ + nasm \ + ninja-build \ + numactl-dev \ + opus-dev \ + pkgconf \ + samurai \ + sdl2-dev \ + texinfo \ + wayland-dev \ + wget \ + xorgproto \ + zlib-dev +``` + #### macOS ```bash diff --git a/cmake/ffmpeg/ffmpeg.cmake b/cmake/ffmpeg/ffmpeg.cmake index 49ddcda5..79374139 100644 --- a/cmake/ffmpeg/ffmpeg.cmake +++ b/cmake/ffmpeg/ffmpeg.cmake @@ -67,7 +67,7 @@ if(BUILD_FFMPEG_NV_CODEC_HEADERS) --enable-ffnvcodec --enable-nvenc ) - if(UNIX AND NOT APPLE AND NOT FREEBSD) + if(UNIX AND NOT APPLE AND NOT FREEBSD AND BUILD_FFMPEG_CUDA_LLVM) list(APPEND FFMPEG_EXTRA_CONFIGURE --enable-cuda_llvm ) From e1e19acc7ea953ef33b77b4f353d4386772338ca Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:53:05 -0400 Subject: [PATCH 2/2] Simplify CI and docs package lists Streamline dependency lists in .github/workflows/ci.yml and README.md: remove a number of -dev and build-tool packages (freetype-dev, glib-dev, gnutls-dev, lame-dev, libass-dev, libvorbis-dev, libxrandr-dev, meson, ninja-build, opus-dev, samurai, sdl2-dev, texinfo, wget, xorgproto, zlib-dev) from the apk/CI install steps. Also add a "Debian/Ubuntu" subsection to the README. These changes reduce and harmonize the packages installed in CI and documented install instructions. --- .github/workflows/ci.yml | 18 ++---------------- README.md | 20 ++++---------------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34107ac5..e7f5881f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,34 +158,20 @@ jobs: bash \ build-base \ cmake \ - freetype-dev \ git \ - glib-dev \ - gnutls-dev \ - lame-dev \ - libass-dev \ libdrm-dev \ libtool \ - libvorbis-dev \ libx11-dev \ libxcb-dev \ libxext-dev \ libxfixes-dev \ libxrandr-dev \ linux-headers \ - meson \ + mesa-dev \ nasm \ - ninja-build \ numactl-dev \ - opus-dev \ pkgconf \ - samurai \ - sdl2-dev \ - texinfo \ - wayland-dev \ - wget \ - xorgproto \ - zlib-dev + wayland-dev - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/README.md b/README.md index ac6ceaf6..900eba2d 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ pkg install -y \ #### Linux +##### Debian/Ubuntu + ```bash sudo apt install -y \ autoconf \ @@ -122,34 +124,20 @@ apk add --no-cache \ bash \ build-base \ cmake \ - freetype-dev \ git \ - glib-dev \ - gnutls-dev \ - lame-dev \ - libass-dev \ libdrm-dev \ libtool \ - libvorbis-dev \ libx11-dev \ libxcb-dev \ libxext-dev \ libxfixes-dev \ libxrandr-dev \ linux-headers \ - meson \ + mesa-dev \ nasm \ - ninja-build \ numactl-dev \ - opus-dev \ pkgconf \ - samurai \ - sdl2-dev \ - texinfo \ - wayland-dev \ - wget \ - xorgproto \ - zlib-dev + wayland-dev ``` #### macOS