forked from Mirrors/openclonk
Mac: Bundling was *still* wrong
The libraries we bundle might use other bundled libraries. Therefore we have to change the search paths for them, too.
parent
bb957295b2
commit
7b3ff34eea
|
@ -1,7 +1,7 @@
|
|||
|
||||
# Project data
|
||||
NAME = OpenClonk
|
||||
VERSION = 2.0
|
||||
VERSION = 5.2.1.0
|
||||
|
||||
# Assume default XCode output directory
|
||||
SOURCE_DIR = ../../Release
|
||||
|
|
|
@ -5,16 +5,29 @@ LIBS_TO_BUNDLE=".*?/lib(jpeg|GLEW|llvm|SDL|SDL_mixer|freetype|ogg|vorbis|vorbisf
|
|||
|
||||
cd $TARGET_BUILD_DIR
|
||||
echo "Bundling libraries..."
|
||||
for lib in `otool -L $EXECUTABLE_PATH | grep -Eo "$LIBS_TO_BUNDLE" | grep -v "@executable_path.*"`; do
|
||||
echo "Bundling $lib"
|
||||
base=`basename $lib`
|
||||
mkdir -p $FRAMEWORKS_FOLDER_PATH
|
||||
bundle_path=$FRAMEWORKS_FOLDER_PATH/$base
|
||||
id=@executable_path/../Frameworks/$base
|
||||
|
||||
function bundle () {
|
||||
|
||||
echo Bundling $base... cp $lib $bundle_path
|
||||
cp $lib $bundle_path
|
||||
chmod u+w $bundle_path
|
||||
install_name_tool -id $id $bundle_path
|
||||
install_name_tool -change $lib $id $EXECUTABLE_PATH
|
||||
done
|
||||
for lib in `otool -L $1 | grep -Eo "$LIBS_TO_BUNDLE" | grep -v "@executable_path.*"`; do
|
||||
|
||||
base=`basename $lib`
|
||||
mkdir -p $FRAMEWORKS_FOLDER_PATH
|
||||
bundle_path=$FRAMEWORKS_FOLDER_PATH/$base
|
||||
|
||||
echo Changing search path for $base in $1
|
||||
id=@executable_path/../Frameworks/$base
|
||||
install_name_tool -change $lib $id $1
|
||||
|
||||
if [ ! -e $bundle_path ]; then
|
||||
echo Bundling $lib from $bundle_path
|
||||
cp $lib $bundle_path
|
||||
chmod u+w $bundle_path
|
||||
install_name_tool -id $id $bundle_path
|
||||
|
||||
bundle $bundle_path
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
bundle $EXECUTABLE_PATH
|
||||
|
|
Loading…
Reference in New Issue