ffmpeg: Restore compat with <5.1 #624
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MacOS Build | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
env: | |
MACOSX_DEPLOYMENT_TARGET: '10.15' | |
GH_CACHE_KEY: 1 | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
env: [ | |
{build_type: Debug, cmake: ""}, | |
{build_type: Release, cmake: ""} | |
] | |
name: ${{matrix.env.build_type}} | |
if: github.event.pull_request.draft != true | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install libs | |
run: | | |
brew install ninja yasm dylibbundler \ | |
libvpx boost cmake zlib \ | |
sdl2 sdl2_image sdl2_mixer sdl2_net | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: | | |
ffmpeg | |
key: MacOS-${{ env.GH_CACHE_KEY }} | |
- name: ffmpeg -- download | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: git clone --depth 1 --branch n6.1 https://git.ffmpeg.org/ffmpeg.git ffmpeg | |
- name: ffmpeg -- configure | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: ./configure | |
--prefix=/usr/local | |
--enable-shared --disable-static | |
--cc="clang" | |
--extra-cflags="-arch arm64" | |
--extra-ldflags="-arch arm64" | |
--target-os=darwin | |
--sysroot=$(xcrun --sdk macosx --show-sdk-path) | |
--disable-everything | |
--enable-swscale | |
--enable-swresample | |
--enable-zlib | |
--enable-libvpx | |
--enable-demuxer=rawvideo,bink,matroska | |
--enable-decoder=rawvideo,bink,binkaudio_dct,opus,vp8,vp9 | |
--enable-parser=vp9 | |
--enable-filter=aresample,aformat | |
--enable-protocol=file | |
--disable-d3d11va | |
--disable-dxva2 | |
--disable-vulkan | |
--disable-network | |
--disable-doc --disable-ffplay --disable-ffprobe --disable-ffmpeg | |
--disable-bzlib --disable-libopenjpeg --disable-iconv | |
working-directory: ffmpeg | |
- name: ffmpeg -- build | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: make -j4 | |
working-directory: ffmpeg | |
- name: ffmpeg -- install | |
run: sudo make install | |
working-directory: ffmpeg | |
- name: perimeter -- create build dir | |
run: mkdir build | |
- name: perimeter -- configure | |
run: cmake .. -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.env.build_type}} -DOPTION_D3D9=OFF ${{matrix.env.cmake}} | |
working-directory: build | |
- name: perimeter -- build project | |
run: ninja | |
working-directory: build | |
- name: perimeter -- install project | |
run: cmake --install . --prefix output | |
working-directory: build | |
- name: perimeter -- strip | |
run: | | |
strip -x output/bundle/perimeter.app/Contents/MacOS/* | |
working-directory: build | |
#TODO update package.sh to handle cmake install result | |
#- name: perimeter -- package app | |
# run: macos/package.sh | |
# env: | |
# TEMPLATE_DIR: "macos/Perimeter.app.template" | |
# BUILD_DIR: "build" | |
# APP_DIR: "Perimeter.app" | |
# LIB_DIR: "/usr/local/lib" | |
#- name: perimeter -- release tar | |
# run: tar -cvf Perimeter.app.tar Perimeter.app | |
#TODO Expose artifacts once we build universal binaries | |
#- uses: actions/upload-artifact@v4 | |
# with: | |
# name: Perimeter MacOS ${{matrix.env.build_type}} | |
# path: Perimeter.app.tar |