(macOS) Updates to make VideoFFmpegComponent with libavfilter install and package correctly.

This commit is contained in:
Leon Styhre 2021-05-29 12:38:53 +02:00
parent bbc9cbbb34
commit 59a3ba2bda
2 changed files with 27 additions and 0 deletions

View file

@ -162,6 +162,7 @@ elseif(APPLE)
# This problem definitely needs to be resolved properly at a later date.
add_custom_command(TARGET EmulationStation POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL}
-change /usr/local/lib/libavcodec.58.dylib @rpath/libavcodec.58.dylib
-change /usr/local/lib/libavfilter.7.dylib @rpath/libavfilter.7.dylib
-change /usr/local/lib/libavformat.58.dylib @rpath/libavformat.58.dylib
-change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib
-change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib
@ -179,10 +180,14 @@ elseif(APPLE)
if(NOT APPLE_SKIP_INSTALL_LIBS)
install(FILES ${CMAKE_SOURCE_DIR}/libavcodec.58.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libavfilter.7.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libavformat.58.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libavutil.56.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libpostproc.55.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libswresample.3.dylib
PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS)
install(FILES ${CMAKE_SOURCE_DIR}/libswscale.5.dylib

View file

@ -12,7 +12,9 @@
export FREETYPE_FILENAME=libfreetype.6.dylib
export AVCODEC_FILENAME=libavcodec.58.dylib
export AVFILTER_FILENAME=libavfilter.7.dylib
export AVFORMAT_FILENAME=libavformat.58.dylib
export POSTPROC_FILENAME=libpostproc.55.dylib
export SWRESAMPLE_FILENAME=libswresample.3.dylib
export SWSCALE_FILENAME=libswscale.5.dylib
@ -32,6 +34,19 @@ if [ -f $AVCODEC_FILENAME ]; then
install_name_tool -add_rpath @executable_path $AVCODEC_FILENAME
fi
if [ -f $AVFILTER_FILENAME ]; then
echo Found file $AVFILTER_FILENAME - changing to rpaths
chmod 755 $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libavformat.58.dylib @rpath/libavformat.58.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libavcodec.58.dylib @rpath/libavcodec.58.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libpostproc.55.dylib @rpath/libpostproc.55.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libswscale.5.dylib @rpath/libswscale.5.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib $AVFILTER_FILENAME
install_name_tool -change /usr/local/opt/fdk-aac/lib/libfdk-aac.2.dylib @rpath/libfdk-aac.2.dylib $AVFILTER_FILENAME
install_name_tool -add_rpath @executable_path $AVFILTER_FILENAME
fi
if [ -f $AVFORMAT_FILENAME ]; then
echo Found file $AVFORMAT_FILENAME - changing to rpaths
chmod 755 $AVFORMAT_FILENAME
@ -42,6 +57,13 @@ if [ -f $AVFORMAT_FILENAME ]; then
install_name_tool -add_rpath @executable_path $AVFORMAT_FILENAME
fi
if [ -f $POSTPROC_FILENAME ]; then
echo Found file $POSTPROC_FILENAME - changing to rpaths
chmod 755 $POSTPROC_FILENAME
install_name_tool -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib $POSTPROC_FILENAME
install_name_tool -add_rpath @executable_path $POSTPROC_FILENAME
fi
if [ -f $SWRESAMPLE_FILENAME ]; then
echo Found file $SWRESAMPLE_FILENAME - changing to rpaths
chmod 755 $SWRESAMPLE_FILENAME