2020-01-30 01:27:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
# cd "$( dirname "${BASH_SOURCE[0]}" )"
|
|
|
|
|
|
|
|
copy_deps() {
|
|
|
|
local dep=$1
|
|
|
|
local dir=$2
|
|
|
|
local depname=$(basename $dep)
|
|
|
|
|
|
|
|
[[ -e $dir/$depname ]] || install -m755 $dep $dir
|
|
|
|
|
2020-01-31 10:30:23 +00:00
|
|
|
otool -L $dep | awk '/\usr\/local\/.*\.dylib /{print $1}' | while read lib; do
|
2020-01-30 01:27:49 +00:00
|
|
|
local libname=$(basename $lib)
|
|
|
|
[[ $depname = $libname ]] && continue
|
|
|
|
echo $libname
|
|
|
|
install_name_tool -change $lib @loader_path/$libname $dir/$depname
|
|
|
|
[[ -e $dir/$libname ]] && continue
|
2020-01-31 10:30:23 +00:00
|
|
|
install -m755 $lib $dir
|
2020-01-30 01:27:49 +00:00
|
|
|
copy_deps $lib $dir
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-01-30 18:02:41 +00:00
|
|
|
if [[ $OSTYPE =~ darwin ]]
|
|
|
|
then
|
|
|
|
echo "[KawAnime] Collecting dylibs"
|
|
|
|
|
|
|
|
set +x
|
|
|
|
copy_deps /usr/local/lib/libmpv.1.dylib public/mpv
|
|
|
|
copy_deps bindings/build/Release/libtorrent-rasterbar.10.dylib public
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# See <https://github.com/Kagami/boram/issues/11>.
|
2020-01-31 10:30:23 +00:00
|
|
|
# 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 ./public/mpv/libavfilter.7.dylib
|
2020-01-30 18:02:41 +00:00
|
|
|
install_name_tool -change /usr/local/opt/mpv/lib/libmpv.1.dylib '@loader_path/libmpv.1.dylib' ./public/mpv/mpvjs.node
|
|
|
|
|
|
|
|
install_name_tool -change "@rpath/libtorrent-rasterbar.10.dylib" "@loader_path/libtorrent-rasterbar.10.dylib" bindings/build/Release/kawabinds.node
|
|
|
|
install_name_tool -change "@rpath/libboost_system.dylib" "@loader_path/libboost_system.dylib" bindings/build/Release/kawabinds.node
|
|
|
|
fi
|