mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
R OSX bundle dylib fixing tool
.. see util/osx_bundle_fix.sh .. couldn't quite get it fully automated, for some reason you may need to run it multiple times.
This commit is contained in:
@@ -1,10 +1,42 @@
|
||||
#!/bin/sh
|
||||
LOCAL_RLIBS=`otool -L GoldenCheetah.app/Contents/MacOS/GoldenCheetah | grep R.framework | awk '{ print $1}'`
|
||||
|
||||
for lib in $LOCAL_RLIBS
|
||||
localise() {
|
||||
|
||||
if [ $2 -gt 4 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# increase a level
|
||||
target=$1
|
||||
level=$2
|
||||
level=`expr $level + 1`
|
||||
|
||||
echo "level=" $level "target=" $target
|
||||
|
||||
for lib in `otool -L $target | grep R.framework | awk '{ print $1}'`
|
||||
do
|
||||
|
||||
# copy if its not there
|
||||
if [ ! -e GoldenCheetah.app/Contents/MacOS/`basename $lib` ]; then
|
||||
cp $lib GoldenCheetah.app/Contents/MacOS
|
||||
fi
|
||||
|
||||
echo install_name_tool -change $lib "@executable_path/"`basename $lib` $target
|
||||
install_name_tool -change $lib "@executable_path/"`basename $lib` $target
|
||||
|
||||
# go down a level
|
||||
localise GoldenCheetah.app/Contents/MacOS/`basename $lib` $level
|
||||
done
|
||||
}
|
||||
|
||||
localise GoldenCheetah.app/Contents/MacOS/GoldenCheetah 1
|
||||
|
||||
# now all the things we copied
|
||||
for i in GoldenCheetah.app/Contents/MacOS/*.dylib
|
||||
do
|
||||
echo cp $lib GoldenCheetah.app/Contents/MacOS
|
||||
cp $lib GoldenCheetah.app/Contents/MacOS
|
||||
echo install_name_tool -change $lib "@executable_path/"`basename $lib` GoldenCheetah.app/Contents/MacOS/GoldenCheetah
|
||||
install_name_tool -change $lib "@executable_path/"`basename $lib` GoldenCheetah.app/Contents/MacOS/GoldenCheetah
|
||||
localise $i 1
|
||||
done
|
||||
|
||||
echo "**** you may need to run this a few times ****"
|
||||
echo "run otool -L on the contents of the MacOS directory to check"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user