-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathcollect-dylib-deps.sh
executable file
·29 lines (25 loc) · 997 Bytes
/
collect-dylib-deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -ex
cd "$( dirname "${BASH_SOURCE[0]}" )"
rm -rf dist
mkdir dist
copy_deps() {
local dep=$1
local depname=$(basename $dep)
[[ -e dist/$depname ]] || install -m755 $dep dist
otool -L $dep | awk '/\/usr\/local.*\.dylib /{print $1}' | while read lib; do
local libname=$(basename $lib)
[[ $depname = $libname ]] && continue
echo $libname
install_name_tool -change $lib @loader_path/$libname dist/$depname
[[ -e dist/$libname ]] && continue
install -m755 $lib dist
copy_deps $lib
done
}
set +x
copy_deps /usr/local/lib/libmpv.1.dylib
set -x
# See <https://github.com/Kagami/boram/issues/11>.
install_name_tool -change /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage /System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/Versions/A/CoreImage dist/libavfilter.7.dylib
install_name_tool -change /usr/local/opt/mpv/lib/libmpv.1.dylib '@loader_path/libmpv.1.dylib' ../build/Release/mpvjs.node