comparison deploy/osx/combine.sh @ 335:aa852b477e4d

More OS/X deployment: Try to set shared library dependencies separately for each source arch
author Chris Cannam
date Wed, 02 Mar 2011 15:58:34 +0000
parents 2b2f0ba33262
children
comparison
equal deleted inserted replaced
320:67feb05754ee 335:aa852b477e4d
1 #!/bin/bash 1 #!/bin/bash
2 app=EasyMercurial.app 2 app=EasyMercurial
3 if [ ! -d "$app.carbon" ] || [ ! -d "$app.cocoa" ]; then 3 if [ ! -d "$app.carbon.app" ] || [ ! -d "$app.cocoa.app" ]; then
4 echo Carbon or Cocoa bundle not found 4 echo Carbon or Cocoa bundle not found
5 exit 1 5 exit 1
6 fi 6 fi
7 (cd "$app.cocoa" ; find . -type f -print) | while read f; do 7 (cd "$app.cocoa.app" ; find . -type f -print) | while read f; do
8 d=$(dirname "$f") 8 d=$(dirname "$f")
9 mkdir -p "$app.output/$d" 9 mkdir -p "$app.app/$d"
10 case $(file "$app.cocoa/$f") in 10 case $(file "$app.cocoa.app/$f") in
11 *universal*x86_64*)
12 lipo "$app.cocoa.app/$f" -extract x86_64 -output "/tmp/$$.x86_64";;
11 *x86_64*) 13 *x86_64*)
12 lipo "$app.cocoa/$f" -extract x86_64 -output "/tmp/$$.x86_64" 14 lipo "$app.cocoa.app/$f" -create -output "/tmp/$$.x86_64";;
13 case $(file "$app.carbon/$f") in 15 *)
14 *x86_64*) 16 cp "$app.cocoa.app/$f" "$app.app/$f"
15 lipo "$app.carbon/$f" -remove x86_64 -output "/tmp/$$.rest" 17 continue;;
16 ;; 18 esac
17 *) 19 case $(file "$app.carbon.app/$f") in
18 cp "$app.carbon/$f" "/tmp/$$.rest" 20 *x86_64*)
19 ;; 21 lipo "$app.carbon.app/$f" -remove x86_64 -output "/tmp/$$.rest"
20 esac 22 ;;
21 lipo "/tmp/$$.x86_64" "/tmp/$$.rest" -create -output "$app.output/$f" 23 *universal*)
22 rm "/tmp/$$".* 24 cp "$app.carbon.app/$f" "/tmp/$$.rest"
23 ;; 25 ;;
24 *) 26 *)
25 cp "$app.cocoa/$f" "$app.output/$f" 27 lipo "$app.carbon.app/$f" -create -output "/tmp/$$.rest"
26 ;; 28 ;;
27 esac 29 esac
30 lipo "/tmp/$$.x86_64" "/tmp/$$.rest" -create -output "$app.app/$f"
31 rm "/tmp/$$".*
28 done 32 done
29 33
30 34