From 3fea71731f0c551b030e3cdc7e8e0bad5a7f0492 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sun, 14 Apr 2024 14:11:45 -0500 Subject: [PATCH] CI:mac: Add option to not build ffmpeg to dependency build script --- .../scripts/macos/build-dependencies.sh | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/scripts/macos/build-dependencies.sh b/.github/workflows/scripts/macos/build-dependencies.sh index 48d50d3be2..f6b3e12c76 100755 --- a/.github/workflows/scripts/macos/build-dependencies.sh +++ b/.github/workflows/scripts/macos/build-dependencies.sh @@ -7,6 +7,10 @@ if [ "$#" -ne 1 ]; then exit 1 fi +# The bundled ffmpeg has a lot of things disabled to reduce code size. +# Users may want to use system ffmpeg for additional features +: ${BUILD_FFMPEG:=1} + export MACOSX_DEPLOYMENT_TARGET=11.0 NPROCS="$(getconf _NPROCESSORS_ONLN)" @@ -102,22 +106,24 @@ make -C build "-j$NPROCS" make -C build install cd .. -echo "Installing FFmpeg..." -rm -fr "ffmpeg-$FFMPEG" -tar xf "ffmpeg-$FFMPEG.tar.xz" -cd "ffmpeg-$FFMPEG" -LDFLAGS="-dead_strip $LDFLAGS" CFLAGS="-Os $CFLAGS" CXXFLAGS="-Os $CXXFLAGS" \ - ./configure --prefix="$INSTALLDIR" \ - --enable-cross-compile --arch=x86_64 --cc='clang -arch x86_64' --cxx='clang++ -arch x86_64' \ - --disable-all --disable-autodetect --disable-static --enable-shared \ - --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \ - --enable-audiotoolbox --enable-videotoolbox \ - --enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \ - --enable-muxer=avi,matroska,mov,mp3,mp4,wav \ - --enable-protocol=file -make "-j$NPROCS" -make install -cd .. +if [ "$BUILD_FFMPEG" -ne 0 ]; then + echo "Installing FFmpeg..." + rm -fr "ffmpeg-$FFMPEG" + tar xf "ffmpeg-$FFMPEG.tar.xz" + cd "ffmpeg-$FFMPEG" + LDFLAGS="-dead_strip $LDFLAGS" CFLAGS="-Os $CFLAGS" CXXFLAGS="-Os $CXXFLAGS" \ + ./configure --prefix="$INSTALLDIR" \ + --enable-cross-compile --arch=x86_64 --cc='clang -arch x86_64' --cxx='clang++ -arch x86_64' \ + --disable-all --disable-autodetect --disable-static --enable-shared \ + --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \ + --enable-audiotoolbox --enable-videotoolbox \ + --enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \ + --enable-muxer=avi,matroska,mov,mp3,mp4,wav \ + --enable-protocol=file + make "-j$NPROCS" + make install + cd .. +fi echo "Installing Zstd..." rm -fr "zstd-$ZSTD"