Skip to content

Instantly share code, notes, and snippets.

@singalen
Created February 25, 2020 02:01
Show Gist options
  • Save singalen/ba84d4260b29d4f9bd199fa275d87c11 to your computer and use it in GitHub Desktop.
Save singalen/ba84d4260b29d4f9bd199fa275d87c11 to your computer and use it in GitHub Desktop.
function package_deps() {
BINARY=$1
DEPS=$(otool -L $BINARY \
| grep "/opt/local/lib" \
| tr -s ' ' \
| cut -d ' ' -f 1)
for DEP in $DEPS; do
cp $DEP Far2l.app/Contents/MacOS/
BASE_DEP=$(basename $DEP)
install_name_tool -change $DEP "@loader_path/$BASE_DEP" $BINARY
done
echo "Done with $BINARY:"
otool -L $BINARY
}
cp -f far2l/cmake-build-debug/install/far2l Far2l.app/Contents/MacOS/
cp -rf far2l/cmake-build-debug/install/Plugins Far2l.app/Contents/MacOS/
package_deps Far2l.app/Contents/MacOS/far2l
for PLUG in Far2l.app/Contents/MacOS/Plugins/*/plug/*.far-plug*; do
package_deps $PLUG
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment