Chris@315: #!/bin/bash Chris@335: app=EasyMercurial Chris@335: if [ ! -d "$app.carbon.app" ] || [ ! -d "$app.cocoa.app" ]; then Chris@315: echo Carbon or Cocoa bundle not found Chris@315: exit 1 Chris@315: fi Chris@335: (cd "$app.cocoa.app" ; find . -type f -print) | while read f; do Chris@315: d=$(dirname "$f") Chris@335: mkdir -p "$app.app/$d" Chris@335: case $(file "$app.cocoa.app/$f") in Chris@335: *universal*x86_64*) Chris@335: lipo "$app.cocoa.app/$f" -extract x86_64 -output "/tmp/$$.x86_64";; Chris@315: *x86_64*) Chris@335: lipo "$app.cocoa.app/$f" -create -output "/tmp/$$.x86_64";; Chris@335: *) Chris@335: cp "$app.cocoa.app/$f" "$app.app/$f" Chris@335: continue;; Chris@335: esac Chris@335: case $(file "$app.carbon.app/$f") in Chris@335: *x86_64*) Chris@335: lipo "$app.carbon.app/$f" -remove x86_64 -output "/tmp/$$.rest" Chris@335: ;; Chris@335: *universal*) Chris@335: cp "$app.carbon.app/$f" "/tmp/$$.rest" Chris@315: ;; Chris@315: *) Chris@335: lipo "$app.carbon.app/$f" -create -output "/tmp/$$.rest" Chris@315: ;; Chris@315: esac Chris@335: lipo "/tmp/$$.x86_64" "/tmp/$$.rest" -create -output "$app.app/$f" Chris@335: rm "/tmp/$$".* Chris@315: done Chris@315: Chris@315: