From a6e6c93a508b30f958788be7c0e1f27863d53611 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 16 Nov 2021 14:18:33 -0600 Subject: [PATCH] Final MacOS .app fix --- macos/set_library_path.sh | 6 ++++-- make_macos_dotapp.sh | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/macos/set_library_path.sh b/macos/set_library_path.sh index a92d8697..e72066cb 100644 --- a/macos/set_library_path.sh +++ b/macos/set_library_path.sh @@ -14,5 +14,7 @@ get_first_arg() { # Get current path CURRENT_PATH=$(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB)) -# Change to the new path -install_name_tool -change $CURRENT_PATH $NEW_PATH $EXEC \ No newline at end of file +# Change to the new path if found +if [ ! -z "$CURRENT_PATH" ]; then + install_name_tool -change $CURRENT_PATH $NEW_PATH $EXEC +fi \ No newline at end of file diff --git a/make_macos_dotapp.sh b/make_macos_dotapp.sh index d97e7bef..7c7df7a9 100644 --- a/make_macos_dotapp.sh +++ b/make_macos_dotapp.sh @@ -161,6 +161,7 @@ cp $LIBRTLSDR_PATH $DOTAPP/Contents/Frameworks/librtlsdr.dylib sh macos/delete_rpath.sh librtlsdr $DOTAPP/Contents/Plugins/rtl_sdr_source.dylib # sh macos/delete_rpath.sh libusb $DOTAPP/Contents/Frameworks/librtlsdr.dylib # NOT NEEDED???? sh macos/set_library_path.sh librtlsdr @rpath/librtlsdr.dylib $DOTAPP/Contents/Plugins/rtl_sdr_source.dylib +sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Plugins/rtl_sdr_source.dylib # On intel needed too apparently sh macos/set_library_path.sh libusb @rpath/libusb.dylib $DOTAPP/Contents/Frameworks/librtlsdr.dylib install_name_tool -add_rpath @loader_path/../Frameworks $DOTAPP/Contents/Frameworks/librtlsdr.dylib codesign --remove-signature $DOTAPP/Contents/Frameworks/librtlsdr.dylib