From 59a3ba2bda3bcf75daa9b458c256e2374dabb1de Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 29 May 2021 12:38:53 +0200 Subject: [PATCH] (macOS) Updates to make VideoFFmpegComponent with libavfilter install and package correctly. --- es-app/CMakeLists.txt | 5 +++++ tools/macOS_change_dylib_rpaths.sh | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 6f4ca1a55..20779f1d7 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -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 diff --git a/tools/macOS_change_dylib_rpaths.sh b/tools/macOS_change_dylib_rpaths.sh index 9eff58c7c..21544ffca 100755 --- a/tools/macOS_change_dylib_rpaths.sh +++ b/tools/macOS_change_dylib_rpaths.sh @@ -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