From bf45e8c3f1ee600b42cee186e81f1a3ad0b61cb3 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 16 Dec 2020 13:04:18 -0800 Subject: [PATCH] macOS: Add a workaround for libsnappy. Work around an issue with libsnappy similar to what we do with libssh. --- packaging/macosx/osx-app.sh.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packaging/macosx/osx-app.sh.in b/packaging/macosx/osx-app.sh.in index 94b4db0a31..b0b00f4ba2 100755 --- a/packaging/macosx/osx-app.sh.in +++ b/packaging/macosx/osx-app.sh.in @@ -176,6 +176,9 @@ while $endl; do # @rpath/libssh.4.dylib, rather than /usr/local/lib/libssh.4.dylib, # when built by tools/macos-setup.sh; # + # replace "@rpath/libsnappy" with "/usr/local/lib/libssnappy" so that + # it isn't excluded from subsequent filtering. + # replace "\tlibbrotli" with "\t/usr/local/lib/libbrotli" so that # it isn't excluded from subsequent filtering. # libbrotli, for some reason, doesn't have a path prefix in its @@ -186,11 +189,18 @@ while $endl; do # # eliminate duplicates. # + # We might want to let dyld do some of the work for us, e.g. by + # parsing the output of + # + # `DYLD_PRINT_LIBRARIES=1 $bundle_binary` + # + # instead. libs="$( # shellcheck disable=SC2086 otool -L $bundle_binary_list "$pkglib"/*.dylib 2>/dev/null \ | grep -F compatibility \ | cut -d\( -f1 \ + | sed '1,$s;^ @rpath/libsnappy; /usr/local/lib/libsnappy;' \ | sed '1,$s;^ @rpath/libssh; /usr/local/lib/libssh;' \ | sed '1,$s;^ libbrotli; /usr/local/lib/libbrotli;' \ | grep -E -v "$exclude_prefixes" \