Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[3f9ab6]: mac / complete-bundle.sh Maximize Restore History

Download this file

complete-bundle.sh    49 lines (35 with data), 1.5 kB

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
# $Id: complete-bundle.sh $
dylib_dir="$REPOSITORY_DIR/lib"
old_install_name_dirname="$REPOSITORY_ABSOLUTE_PATH/lib"
dylib_install_loc="Libraries"
new_install_name_dirname="@executable_path/../$dylib_install_loc"
App="$TARGET_BUILD_DIR/$PRODUCT_NAME.app"
archs="ppc i386 ppc64 x86_64"
libs="libwx_macu-$WX_MAJOR_VERSION libpano13 libboost_thread-mt libboost_thread-mt libboost_thread-mt-1_35 libpng libtiff libjpeg libIex libImath libIlmImf libIlmThread libHalf libexpat"
binaries="$App/Contents/$dylib_install_loc/*.dylib $App/Contents/MacOS/* $App/Contents/Frameworks/Hugin*.framework/Hugin*"
#------------------------------------------------
rm -Rf "$App/Contents/$dylib_install_loc"
mkdir -p "$App/Contents/$dylib_install_loc"
for dylib in $libs
do
cp -Rf $dylib_dir/$dylib.*ylib "$App/Contents/$dylib_install_loc/"
done
#replace any "$old_install_name_dirname[/*]/" in install_name to "$new_install_name_dirname/"
for exec_file in $binaries
do
echo "Processing: $exec_file"
if [[ $exec_file = *.dylib ]]
then
for lib in $(otool -D $exec_file | grep $old_install_name_dirname | sed -e 's/ (.*$//' -e 's/^.*\///')
do
echo " Changing own install name."
install_name_tool -id "$new_install_name_dirname/$lib" $exec_file
done
fi
for lib in $(otool -L $exec_file | grep $old_install_name_dirname | sed -e 's/ (.*$//' -e 's/^.*\///')
do
echo " Changing install name for: $lib"
install_name_tool -change "$old_install_name_dirname/$lib" "$new_install_name_dirname/$lib" $exec_file
done
done