5 # script for pulling together a MacOSX app bundle.
7 GTKSTACK_ROOT=$HOME/gtk/inst
8 ARDOURSTACK_ROOT=$HOME/a3/inst
11 # where harvid and xjadeo binaries are cached
12 if test -z "$CACHEDIR" -o ! -d "$CACHEDIR"; then
28 : ${HARRISONCHANNELSTRIP=harrison_channelstrip}
30 . ../define_versions.sh
32 while [ $# -gt 0 ] ; do
37 # top level build targets
44 PRODUCT_PKG_DIR=ArdourSAE ;
54 PRODUCT_PKG_DIR=Mixbus;
57 --mixbus32c) MIXBUS=1;
65 PRODUCT_PKG_DIR=Mixbus32C;
66 APPNAME=Mixbus32C-${major_version} ;
72 PRODUCT_PKG_DIR=Ardour;
78 PRODUCT_PKG_DIR=Ardour ;
80 --test) SAE= ; WITH_LADSPA=; STRIP= ; shift ;;
83 # specific build flags
86 --noharvid) WITH_HARVID= ; shift ;;
87 --noladspa) WITH_LADSPA= ; shift ;;
88 --nostrip) STRIP= ; shift ;;
89 --sysdeps) PRINT_SYSDEPS=1; shift ;;
90 --nls) WITH_NLS=1 ; shift ;;
91 --chanstrip) HARRISONCHANNELSTRIP=$2 ; shift; shift ;;
95 if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
96 echo "application or product-name was not specified"
100 echo "Version is $release_version"
101 if [ "x$commit" != "x" ] ; then
102 info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
104 info_string="$release_version built on `hostname` by `whoami` on `date`"
106 echo "Info string is $info_string"
108 if [ x$DEBUG = xT ]; then
110 echo "Debug build, strip disabled"
112 if test x$STRIP != x ; then
113 echo "No debug build, strip enabled"
115 echo "No debug build, but strip disabled."
119 # setup directory structure
121 APPDIR=${APPNAME}${major_version}.app
122 APPROOT=$APPDIR/Contents
123 Frameworks=$APPROOT/lib
124 Resources=$APPROOT/Resources
126 # Since this is OS X, don't try to distinguish between etc and shared
127 # (machine dependent and independent data) - just put everything
132 Locale=$Resources/locale
134 # Bundled Plugins live in a top level folder
136 Plugins=$APPROOT/Plugins
137 Surfaces=$Frameworks/surfaces
138 Panners=$Frameworks/panners
139 Backends=$Frameworks/backends
140 MidiMaps=$Shared/midi_maps
141 ExportFormats=$Shared/export
142 Templates=$Shared/templates
143 PatchFiles=$Shared/patchfiles
144 LuaScripts=$Shared/scripts
145 MackieControl=$Shared/mcp
147 if [ x$PRINT_SYSDEPS != x ] ; then
149 # print system dependencies
152 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
153 if ! file $file | grep -qs Mach-O ; then
156 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
161 echo "Removing old $APPDIR tree ..."
165 echo "Building new app directory structure ..."
167 # only bother to make the longest paths
169 mkdir -p $APPROOT/MacOS
170 mkdir -p $APPROOT/Resources
176 mkdir -p $ExportFormats
178 mkdir -p $Frameworks/modules
180 mkdir -p $MackieControl
184 # maybe set variables
186 if test x$SAE != x ; then
187 appname="Ardour${major_version}-SAE"
188 EXECUTABLE=${appname}
189 env="$env<key>ARDOUR_SAE</key><string>true</string>"
191 # current default for SAE version is German keyboard layout without a keypad
193 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>de-nokeypad</string>"
194 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui_sae.conf</string>"
195 elif test x$MIXBUS != x ; then
197 EXECUTABLE=${appname}${major_version}
198 env="$env<key>ARDOUR_MIXBUS</key><string>true</string>"
200 # current default for MIXBUS version is US keyboard layout without a keypad
202 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>us-nokeypad</string>"
203 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui.conf</string>"
205 appname="Ardour${major_version}"
206 EXECUTABLE=${appname}
210 # if we're not going to bundle JACK, make sure we can find
211 # jack in the places where it might be
214 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
215 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
217 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
221 sed -e "s?@ENV@?$env?g" \
222 -e "s?@VERSION@?$release_version?g" \
223 -e "s?@INFOSTRING@?$info_string?g" \
224 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
225 -e "s?@BUNDLENAME@?${APPNAME}${major_version}?g" \
226 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
228 sed -e "s?@APPNAME@?$appname?" \
229 -e "s?@ENV@?$env?g" \
230 -e "s?@VERSION@?$release_version?g" \
231 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
235 cp Info.plist $APPROOT
236 cp -R Resources $APPROOT
240 rm -f Resources/InfoPlist.strings
243 # if we build a bundle without jack, then
244 # make the Ardour executable a helper
245 # script that checks to see if JACK is
249 cp startup_script $APPROOT/MacOS/$EXECUTABLE
250 chmod 775 $APPROOT/MacOS/$EXECUTABLE
251 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
253 echo "Copying ardour executable ...."
254 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
255 if test x$SAE != x ; then
256 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
257 cp Ardour3-SAE.icns $Resources/appIcon.icns
258 elif test x$MIXBUS32C != x ; then
259 cp Mixbus32C.icns $Resources/appIcon.icns
260 elif test x$MIXBUS != x ; then
261 cp Mixbus.icns $Resources/appIcon.icns
263 cp Ardour.icns $Resources/appIcon.icns
265 cp typeArdour.icns $Resources/
267 set +e # things below are not error-free (optional files etc) :(
270 if test x$WITH_NLS != x ; then
271 echo "NLS support ..."
272 echo "I hope you remembered to run waf i18n"
275 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
276 files=`find ../../$pkg -name "*.mo"`
279 # the package name is appended with a number so that
280 # it can be parallel installed during a regular install
281 # with older (and newer) versions. it is just the major
282 # number of the release (i.e. leading digits)
285 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
287 if [ -z "$files" ]; then
289 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
296 lang=`basename $file | sed 's/\.mo//'`
297 mkdir -p $Locale/$lang/LC_MESSAGES
298 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
299 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
300 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
303 LINGUAS="$LINGUAS $lang"
310 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
311 echo "Copying GTK i18n files for $l..."
312 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
314 # try with just the language spec
315 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
316 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
317 echo "Copying GTK i18n files for $l..."
318 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
323 echo "Skipping NLS support"
327 # Copy stuff that may be dynamically loaded
330 cp -R $GTKSTACK_ROOT/etc/* $Etc
331 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
333 # We rely on clearlooks, so include a version from our own build tree
334 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
336 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
337 mkdir -p $GTK_ENGINE_DIR
339 echo "Copying GTK engines ..."
340 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
341 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
343 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
344 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
347 if test x$WITH_LADSPA != x ; then
348 if test x$SAE != x ; then
350 elif test x$MIXBUS != x ; then
351 plugdir=mixbus_ladspa
355 if [ -d $plugdir -a "x$(ls $plugdir)" != x ] ; then
356 echo "Copying `ls $plugdir | wc -l` plugins ..."
357 cp -r $plugdir/* $Plugins
361 # Control Surface shared libraries
362 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
363 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
366 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
369 for backend in jack wavesaudio dummy coreaudio; do
370 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
373 # Export Formats/Presets
374 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
375 cp "$f" $ExportFormats ;
378 # Session and Route templates
379 #for f in $BUILD_ROOT/../templates/* ; do
380 # if [ -d "$f" ] ; then
381 # cp -r "$f" $Templates ;
386 # got to be careful with names here
387 for x in $BUILD_ROOT/../midi_maps/*.map ; do
392 # got to be careful with names here
393 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
398 # got to be careful with names here
399 for x in $BUILD_ROOT/../scripts/*.lua ; do
404 # got to be careful with names here
405 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
406 cp "$x" $MackieControl
409 # VAMP plugins that we use
410 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
412 # Suil modules (new dir 'build-stack')
413 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
414 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
417 # Suil modules (old dir 'build-ardour-stack')
418 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
419 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
422 # VST scanner app and wrapper script, if they exist
423 if test -d $BUILD_ROOT/libs/fst ; then
424 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
428 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
429 mkdir -p $Frameworks/vfork
430 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
433 # TODO check if this is still needed, even when building on 10.5
434 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
435 STDCPP='|libstdc\+\+'
442 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
443 if ! file $file | grep -qs Mach-O ; then
446 # libffi contains "S" (other section symbols) that should not be stripped.
447 if [[ $file == *"libffi"* ]] ; then
451 if test x$STRIP != x ; then
452 strip -u -r -arch all $file &>/dev/null
455 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
457 for dep in $deps ; do
459 if ! test -f $Frameworks/$base; then
460 if echo $dep | grep -sq '^libs' ; then
461 cp $BUILD_ROOT/$dep $Frameworks
469 if test x$missing = xfalse ; then
470 # everything has been found
476 echo "Copying other stuff to $APPDIR ..."
478 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
479 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
480 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
481 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
483 # Copied directly from source tree
485 mkdir ${Resources}/icons
486 mkdir ${Resources}/resources
487 cp ../../system_config $Resources/system_config
488 cp ../../instant.xml $Resources/instant.xml
489 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
490 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
491 cp ../../gtk2_ardour/*.colors $Resources
492 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
493 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
495 # go through and recursively remove any .svn dirs in the bundle
496 for svndir in `find $APPDIR -name .svn -type dir`; do
500 # install bundled LV2s to <app>/Contents/lib/LV2/
501 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
503 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
504 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
505 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
506 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
507 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
511 # now fix up the executables
512 echo "Fixing up executable dependency names ..."
513 executables=$MAIN_EXECUTABLE
514 if test x$SAE != x ; then
515 executables="$executables"
518 for exe in $executables; do
519 EXE=$APPROOT/MacOS/$exe
521 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
523 changes="$changes -change $lib @executable_path/../lib/$base"
525 if test "x$changes" != "x" ; then
526 install_name_tool $changes $EXE
530 echo "Fixing up library names ..."
531 # now do the same for all the libraries we include
532 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends ; do
534 libbase=`basename $libdir`
536 for dylib in $libdir/*.dylib $libdir/*.so ; do
540 if test -L $dylib ; then
544 # change all the dependencies
547 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
549 if echo $lib | grep -s libbase; then
550 changes="$changes -change $lib @executable_path/../$libbase/$base"
552 changes="$changes -change $lib @executable_path/../lib/$base"
556 if test "x$changes" != x ; then
557 if install_name_tool $changes $dylib ; then
564 # now the change what the library thinks its own name is
566 base=`basename $dylib`
567 install_name_tool -id @executable_path/../$libbase/$base $dylib
572 # and now ... the DMG
575 rm -rf $PRODUCT_PKG_DIR
576 mkdir $PRODUCT_PKG_DIR
581 if [ x$SAE != x ] ; then
585 echo "Creating SAE packaging directory"
586 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
587 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
588 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
589 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
591 elif [ x$MIXBUS != x ] ; then
595 echo "Creating Mixbus packaging directory"
596 mv $APPDIR $PRODUCT_PKG_DIR/
597 DMGBACKGROUND=dmgbgMB
600 echo "Creating $APPNAME packaging directory"
601 mv $APPDIR $PRODUCT_PKG_DIR/
605 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
608 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
616 if test x$WITH_HARRISON_LV2 != x ; then
617 curl -s -S --fail -# \
618 -z "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
619 -o "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
620 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_lv2s.${OSX_BENSID}.zip"
622 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
623 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
624 "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip"
627 if test x$WITH_HARVID != x ; then
628 echo "installing video tools.."
629 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
630 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
632 echo "copying harvid and xjadeo ..."
635 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
636 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
639 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
640 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
643 -C $PRODUCT_PKG_DIR/$APPROOT \
644 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
646 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
647 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
648 hdiutil detach "${JADEO}"
650 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
651 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
653 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
654 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
655 mv ${file}.thin ${file}
659 YPOS=$[ $DMGWINBOTTOM - 300 ]
660 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
662 DMGBACKGROUND=${DMGBACKGROUND}xj
665 ################################################################################
666 ### Mixbus plugins, etc
667 if test x$WITH_X42_LV2 != x ; then
668 echo "bundling x42 plugins"
669 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
671 METERS_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-meters.latest.txt)
672 rsync -a -q --partial \
673 rsync://x42-plugins.com/x42/osx/x42-meters-lv2-osx-${METERS_VERSION}.zip \
674 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
675 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
676 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
678 EQ_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-eq.latest.txt)
679 rsync -a -q --partial \
680 rsync://x42-plugins.com/x42/osx/x42-eq-lv2-osx-${EQ_VERSION}.zip \
681 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
682 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
683 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
685 SETBFREE_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/setBfree.latest.txt)
686 rsync -a -q --partial \
687 rsync://x42-plugins.com/x42/osx/setBfree-lv2-osx-${SETBFREE_VERSION}.zip \
688 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
689 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
690 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
692 MIDIFILTER_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-midifilter.latest.txt)
693 rsync -a -q --partial \
694 rsync://x42-plugins.com/x42/osx/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip \
695 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
696 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
697 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
699 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
700 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
701 mv ${file}.thin ${file}
705 if test -n "$MIXBUS"; then
706 echo "deploying harrison tools for $OSX_BENSID"
708 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
710 curl -s -S --fail -# \
711 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
712 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
713 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
715 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
716 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
718 ################################################################################
720 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
722 echo "Building DMG ..."
724 # UC_DMG=$APPNAME-${release_version}-UC.dmg
725 # FINAL_DMG=$APPNAME-${release_version}.dmg
727 if [ x$DEBUG = xT ]; then
728 UC_DMG=$APPNAME-$release_version-dbg.dmg
730 UC_DMG=$APPNAME-$release_version.dmg
732 VOLNAME=$APPNAME-$release_version
734 MNTPATH=`mktemp -d -t ardourimg`
735 TMPDMG=`mktemp -t ardour`
736 ICNSTMP=`mktemp -t ardouricon`
738 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
740 echo "DMG MB = " $DMGMEGABYTES
742 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
746 TMPDMG="${TMPDMG}.dmg"
748 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
750 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
751 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
752 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
754 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
755 mkdir "${MNTPATH}/.background"
756 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
758 echo "setting DMG background ..."
760 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
764 # OSX 10.9.X and later
765 DISKNAME=`basename "${MNTPATH}"`
769 tell application "Finder"
771 tell disk "${DISKNAME}"
774 set current view of container window to icon view
775 set toolbar visible of container window to false
776 set statusbar visible of container window to false
777 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
778 set theViewOptions to the icon view options of container window
779 set arrangement of theViewOptions to not arranged
780 set icon size of theViewOptions to 64
781 set background picture of theViewOptions to file ".background:dmgbg.png"
782 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
783 set position of item "${APPDIR}" of container window to {90, 100}
784 set position of item "Applications" of container window to {310, 100}
790 update without registering applications
797 chmod -Rf go-w "${MNTPATH}"
801 echo "compressing Image ..."
803 # Umount the image ('eject' above may already have done that)
804 umount "${DiskDevice}" || true
805 hdiutil eject "${DiskDevice}" || true
806 # Create a read-only version, use zlib compression
807 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
809 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
810 echo "setting file icon ..."
812 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
813 sips -i ${ICNSTMP}.icns
814 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
815 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
816 SetFile -a C "$UC_DMG"
818 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
821 rm -rf ${PRODUCT_PKG_DIR}
824 echo "packaging suceeded."