2 # OS X .dmg maker for distributable builds
5 # run scons so that a complete and valid build is made in the normal Binary path
8 trap "echo; exit" SIGINT SIGTERM
10 temp_dir
="Dolphin-r`svn info | grep "Revision
" | awk '{print $2}'`"
12 fix_shared_object_depends
() {
15 # Get list of files to work on
16 file_list
=`find $temp_dir/Dolphin.app -name *.dylib`
18 # Loop over the files, and update the path
19 for file in ${file_list}; do
20 orig_paths
=(`otool -L ${file} | grep ${search_string} | awk '{print $1}'`)
22 for orig_path
in ${orig_paths[@]}; do
23 if test "x${orig_path}" != x
; then
24 new_path
=`echo ${orig_path} | xargs basename`
25 echo "$file\t$orig_path"
27 cp ${orig_path} $temp_dir/Dolphin.app
/Contents
/MacOS
/${new_path}
28 install_name_tool
-change ${orig_path} @executable_path/${new_path} ${file}
33 # wxw shoves all the paths into one string, so the looping is really just for dealing with wxw crap
34 orig_paths
=(`otool -L $temp_dir/Dolphin.app/Contents/MacOS/Dolphin | grep ${search_string} | awk '{print $1}'`)
36 for orig_path
in ${orig_paths[@]}; do
37 if test "x${orig_path}" != x
; then
38 new_path
=`echo ${orig_path} | xargs basename`
39 cp ${orig_path} $temp_dir/Dolphin.app
/Contents
/MacOS
/${new_path}
40 install_name_tool
-change ${orig_path} @executable_path
/${new_path} $temp_dir/Dolphin.app
/Contents
/MacOS
/Dolphin
41 echo "Fixing $orig_path"
47 if [ $?
!= 0 ]; then echo "Did you build dolphin yet?"; exit; fi
49 mkdir
-p $temp_dir/Dolphin.app
50 cp -r Darwin-i386
/Dolphin.app
$temp_dir
51 fix_shared_object_depends libwx
52 fix_shared_object_depends libSDL
53 fix_shared_object_depends libGLEW
54 fix_shared_object_depends libz
56 mkdir
-p $temp_dir/Dolphin.app
/Contents
/Library
/Frameworks
/Cg.framework
57 cp /Library
/Frameworks
/Cg.framework
/Cg
$temp_dir/Dolphin.app
/Contents
/Library
/Frameworks
/Cg.framework
/Cg
59 find $temp_dir -name .svn
-exec rm -fr {} \
; 2>/dev
/null
60 rm $temp_dir.dmg
2>/dev
/null
62 hdiutil create
-srcfolder $temp_dir -format UDBZ
$temp_dir.dmg