CI:mac: Add option to not build ffmpeg to dependency build script

This commit is contained in:
TellowKrinkle 2024-04-14 14:11:45 -05:00 committed by Connor McLaughlin
parent c0b36a482a
commit 3fea71731f
1 changed files with 22 additions and 16 deletions

View File

@ -7,6 +7,10 @@ if [ "$#" -ne 1 ]; then
exit 1 exit 1
fi 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 export MACOSX_DEPLOYMENT_TARGET=11.0
NPROCS="$(getconf _NPROCESSORS_ONLN)" NPROCS="$(getconf _NPROCESSORS_ONLN)"
@ -102,22 +106,24 @@ make -C build "-j$NPROCS"
make -C build install make -C build install
cd .. cd ..
echo "Installing FFmpeg..." if [ "$BUILD_FFMPEG" -ne 0 ]; then
rm -fr "ffmpeg-$FFMPEG" echo "Installing FFmpeg..."
tar xf "ffmpeg-$FFMPEG.tar.xz" rm -fr "ffmpeg-$FFMPEG"
cd "ffmpeg-$FFMPEG" tar xf "ffmpeg-$FFMPEG.tar.xz"
LDFLAGS="-dead_strip $LDFLAGS" CFLAGS="-Os $CFLAGS" CXXFLAGS="-Os $CXXFLAGS" \ cd "ffmpeg-$FFMPEG"
./configure --prefix="$INSTALLDIR" \ LDFLAGS="-dead_strip $LDFLAGS" CFLAGS="-Os $CFLAGS" CXXFLAGS="-Os $CXXFLAGS" \
--enable-cross-compile --arch=x86_64 --cc='clang -arch x86_64' --cxx='clang++ -arch x86_64' \ ./configure --prefix="$INSTALLDIR" \
--disable-all --disable-autodetect --disable-static --enable-shared \ --enable-cross-compile --arch=x86_64 --cc='clang -arch x86_64' --cxx='clang++ -arch x86_64' \
--enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \ --disable-all --disable-autodetect --disable-static --enable-shared \
--enable-audiotoolbox --enable-videotoolbox \ --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \
--enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \ --enable-audiotoolbox --enable-videotoolbox \
--enable-muxer=avi,matroska,mov,mp3,mp4,wav \ --enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \
--enable-protocol=file --enable-muxer=avi,matroska,mov,mp3,mp4,wav \
make "-j$NPROCS" --enable-protocol=file
make install make "-j$NPROCS"
cd .. make install
cd ..
fi
echo "Installing Zstd..." echo "Installing Zstd..."
rm -fr "zstd-$ZSTD" rm -fr "zstd-$ZSTD"