# # # patch "osx_bundle.sh" # from [3bea9cdf45f05ab8a937ed60e568f6061b3aae0c] # to [0809401f2cccc212421fcbbf6020410b7de5ed6d] # ============================================================ --- osx_bundle.sh 3bea9cdf45f05ab8a937ed60e568f6061b3aae0c +++ osx_bundle.sh 0809401f2cccc212421fcbbf6020410b7de5ed6d @@ -1,47 +1,18 @@ #!/bin/bash # -# Create a distributable application package which already -# contains the needed Qt4 libraries in order to run the application. -# In the end a disk image is created for easy distribution which is put -# into the $BIN_DIR. +# Creates a distributable application package by including sparkle into +# the bundle and putting the whole thing into a dmg. # -# This script is provided "as-is" with no guarantees or whatsoever; if it -# damages your hd, its not my fault =) -# -# The most recent version of this script should be found in the monotone -# repository on http://venge.net in the branch "net.venge.monotone.guitone", -# as guitone (http://guitone.berlios.de) was the software for what I originally -# hacked it together. -# -# Questions, Comments, Donations can go to -# -# Thomas Keller (me AT thomaskeller DOT biz) -# -# Release History: -# -# 1.0 (2006-11-08) - Initial release -# -# -# Configuration start -# - # relative path to the directory which contains the created app bundle BIN_DIR="bin" # name of the binary BINARY_NAME="guitone" -# Qt libraries you've linked against -declare -a NEEDED_LIBS=( "QtCore" "QtGui") # additional files you'd like to get copied to the final dmg declare -a ADD_FILES=( "README" "COPYING" "NEWS") # sparkle framework SPARKLE_FRAMEWORK=/Library/Frameworks/Sparkle.framework -# absolute path to the directory containing the Qt frameworks -QT_FRAMEWORK_DIR="/Library/Frameworks" -# -# Configuration end, nothing should be edited from here on -# bundle_dir="$BIN_DIR/$BINARY_NAME.app" bundle_bin="$bundle_dir/Contents/MacOS/$BINARY_NAME" @@ -57,42 +28,6 @@ fi exit 1; fi -echo "Creating Frameworks directory in application bundle..." -mkdir -p "$framework_dir" - address@hidden -for (( i = 0 ; i < libcount ; i++ )) -do - lib=${NEEDED_LIBS[$i]} - echo "Processing $lib..." - - if [ ! -d "$QT_FRAMEWORK_DIR/$lib.framework" ]; then - echo "Couldn't find $lib.framework in $QT_FRAMEWORK_DIR." - exit 1 - fi - - rm -rf "$framework_dir/$lib.framework" - cp -fR "$QT_FRAMEWORK_DIR/$lib.framework" "$framework_dir" - echo "...$lib copied." - - install_name_tool \ - -id "@executable_path/../Frameworks/$lib.framework/Versions/4/$lib" \ - "$framework_dir/$lib.framework/Versions/4/$lib" - - # other Qt libs depend at least on QtCore - if [ "$lib" != "QtCore" ]; then - install_name_tool -change "QtCore.framework/Versions/4/QtCore" \ - "@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore" \ - "$framework_dir/$lib.framework/Versions/Current/$lib" - fi - - install_name_tool -change "$lib.framework/Versions/4/$lib" \ - "@executable_path/../Frameworks/$lib.framework/Versions/4/$lib" \ - "$bundle_bin" - - echo "...$lib done." -done - echo "Copying and configuring Sparkle framework..." rm -rf "$framework_dir/Sparkle.framework" cp -fR "$SPARKLE_FRAMEWORK" "$framework_dir" @@ -103,28 +38,24 @@ install_name_tool -change "$SPARKLE_FRAM "@executable_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle" \ "$bundle_bin" -echo "Removing any debug libraries and headers..." -find "$framework_dir" | egrep "debug|Headers" | xargs rm -rf +echo "Preparing image directory..." +tempdir="/tmp/`basename $0`.$$" +mkdir $tempdir +cp -R $bundle_dir $tempdir +echo "...Bundle copied" address@hidden +for (( i = 0 ; i < fcount ; i++ )) do + file=${ADD_FILES[$i]} + if [ ! -f "$file" ]; then + echo "WARNING: $file not found!" + else + cp "$file" $tempdir + echo "...$file copied" + fi +done +echo "Creating disk image..." +rm -f "$BIN_DIR/$BINARY_NAME.dmg" +# format UDBZ: bzip2 compressed (10.4+), UDZ0: zlib compressed (default) +hdiutil create -srcfolder $tempdir -format UDBZ -volname "$BINARY_NAME" "$BIN_DIR/$BINARY_NAME.dmg" +rm -rf $tempdir -if [ "$1" = "dmg" ]; then - echo "Preparing image directory..." - tempdir="/tmp/`basename $0`.$$" - mkdir $tempdir - cp -R $bundle_dir $tempdir - echo "...Bundle copied" - address@hidden - for (( i = 0 ; i < fcount ; i++ )) do - file=${ADD_FILES[$i]} - if [ ! -f "$file" ]; then - echo "WARNING: $file not found!" - else - cp "$file" $tempdir - echo "...$file copied" - fi - done - echo "Creating disk image..." - rm -f "$BIN_DIR/$BINARY_NAME.dmg" - # format UDBZ: bzip2 compressed (10.4+), UDZ0: zlib compressed (default) - hdiutil create -srcfolder $tempdir -format UDBZ -volname "$BINARY_NAME" "$BIN_DIR/$BINARY_NAME.dmg" - rm -rf $tempdir -fi