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
146 Themes=$Shared/themes
148 if [ x$PRINT_SYSDEPS != x ] ; then
150 # print system dependencies
153 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
154 if ! file $file | grep -qs Mach-O ; then
157 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
162 echo "Removing old $APPDIR tree ..."
166 echo "Building new app directory structure ..."
168 # only bother to make the longest paths
170 mkdir -p $APPROOT/MacOS
171 mkdir -p $APPROOT/Resources
177 mkdir -p $ExportFormats
179 mkdir -p $Frameworks/modules
181 mkdir -p $MackieControl
185 # maybe set variables
187 if test x$SAE != x ; then
188 appname="Ardour${major_version}-SAE"
189 EXECUTABLE=${appname}
190 env="$env<key>ARDOUR_SAE</key><string>true</string>"
192 # current default for SAE version is German keyboard layout without a keypad
194 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>de-nokeypad</string>"
195 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui_sae.conf</string>"
196 elif test x$MIXBUS != x ; then
198 EXECUTABLE=${appname}${major_version}
199 env="$env<key>ARDOUR_MIXBUS</key><string>true</string>"
201 # current default for MIXBUS version is US keyboard layout without a keypad
203 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>us-nokeypad</string>"
204 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui.conf</string>"
206 appname="Ardour${major_version}"
207 EXECUTABLE=${appname}
211 # if we're not going to bundle JACK, make sure we can find
212 # jack in the places where it might be
215 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
216 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
218 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
222 sed -e "s?@ENV@?$env?g" \
223 -e "s?@VERSION@?$release_version?g" \
224 -e "s?@INFOSTRING@?$info_string?g" \
225 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
226 -e "s?@BUNDLENAME@?${APPNAME}${major_version}?g" \
227 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
229 sed -e "s?@APPNAME@?$appname?" \
230 -e "s?@ENV@?$env?g" \
231 -e "s?@VERSION@?$release_version?g" \
232 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
236 cp Info.plist $APPROOT
237 cp -R Resources $APPROOT
241 rm -f Resources/InfoPlist.strings
244 # if we build a bundle without jack, then
245 # make the Ardour executable a helper
246 # script that checks to see if JACK is
250 cp startup_script $APPROOT/MacOS/$EXECUTABLE
251 chmod 775 $APPROOT/MacOS/$EXECUTABLE
252 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
254 echo "Copying ardour executable ...."
255 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
256 if test x$SAE != x ; then
257 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
258 cp Ardour3-SAE.icns $Resources/appIcon.icns
259 elif test x$MIXBUS32C != x ; then
260 cp Mixbus32C.icns $Resources/appIcon.icns
261 elif test x$MIXBUS != x ; then
262 cp Mixbus.icns $Resources/appIcon.icns
264 cp Ardour.icns $Resources/appIcon.icns
266 cp typeArdour.icns $Resources/
268 set +e # things below are not error-free (optional files etc) :(
271 if test x$WITH_NLS != x ; then
272 echo "NLS support ..."
273 echo "I hope you remembered to run waf i18n"
276 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
277 files=`find ../../$pkg -name "*.mo"`
280 # the package name is appended with a number so that
281 # it can be parallel installed during a regular install
282 # with older (and newer) versions. it is just the major
283 # number of the release (i.e. leading digits)
286 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
288 if [ -z "$files" ]; then
290 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
297 lang=`basename $file | sed 's/\.mo//'`
298 mkdir -p $Locale/$lang/LC_MESSAGES
299 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
300 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
301 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
304 LINGUAS="$LINGUAS $lang"
311 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
312 echo "Copying GTK i18n files for $l..."
313 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
315 # try with just the language spec
316 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
317 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
318 echo "Copying GTK i18n files for $l..."
319 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
324 echo "Skipping NLS support"
328 # Copy stuff that may be dynamically loaded
331 cp -R $GTKSTACK_ROOT/etc/* $Etc
332 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
334 # We rely on clearlooks, so include a version from our own build tree
335 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
337 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
338 mkdir -p $GTK_ENGINE_DIR
340 echo "Copying GTK engines ..."
341 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
342 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
344 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
345 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
348 if test x$WITH_LADSPA != x ; then
349 if test x$SAE != x ; then
351 elif test x$MIXBUS != x ; then
352 plugdir=mixbus_ladspa
356 if [ -d $plugdir -a "x$(ls $plugdir)" != x ] ; then
357 echo "Copying `ls $plugdir | wc -l` plugins ..."
358 cp -r $plugdir/* $Plugins
362 # Control Surface shared libraries
363 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
364 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
367 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
370 for backend in jack wavesaudio dummy coreaudio; do
371 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
374 # Export Formats/Presets
375 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
376 cp "$f" $ExportFormats ;
379 # Session and Route templates
380 #for f in $BUILD_ROOT/../templates/* ; do
381 # if [ -d "$f" ] ; then
382 # cp -r "$f" $Templates ;
387 # got to be careful with names here
388 for x in $BUILD_ROOT/../midi_maps/*.map ; do
393 # got to be careful with names here
394 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
399 # got to be careful with names here
400 for x in $BUILD_ROOT/../scripts/*.lua ; do
405 # got to be careful with names here
406 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
407 cp "$x" $MackieControl
410 # VAMP plugins that we use
411 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
413 # Suil modules (new dir 'build-stack')
414 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
415 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
418 # Suil modules (old dir 'build-ardour-stack')
419 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
420 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
423 # VST scanner app and wrapper script, if they exist
424 if test -d $BUILD_ROOT/libs/fst ; then
425 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
429 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
430 mkdir -p $Frameworks/vfork
431 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
434 # TODO check if this is still needed, even when building on 10.5
435 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
436 STDCPP='|libstdc\+\+'
443 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
444 if ! file $file | grep -qs Mach-O ; then
447 # libffi contains "S" (other section symbols) that should not be stripped.
448 if [[ $file == *"libffi"* ]] ; then
452 if test x$STRIP != x ; then
453 strip -u -r -arch all $file &>/dev/null
456 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
458 for dep in $deps ; do
460 if ! test -f $Frameworks/$base; then
461 if echo $dep | grep -sq '^libs' ; then
462 cp $BUILD_ROOT/$dep $Frameworks
470 if test x$missing = xfalse ; then
471 # everything has been found
477 echo "Copying other stuff to $APPDIR ..."
479 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
480 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
481 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
482 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
484 # Copied directly from source tree
486 mkdir ${Resources}/icons
487 mkdir ${Resources}/resources
488 cp ../../system_config $Resources/system_config
489 cp ../../instant.xml $Resources/instant.xml
490 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
491 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
492 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
493 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
496 # Themes: only install those named for this app
497 lower_case_appname=`echo $APPNAME | tr '[:upper:]' '[:lower:]'`
498 cp `echo ../../gtk2_ardour/themes/*-${lower_case_appname}.colors` $Themes
500 # go through and recursively remove any .svn dirs in the bundle
501 for svndir in `find $APPDIR -name .svn -type dir`; do
505 # install bundled LV2s to <app>/Contents/lib/LV2/
506 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
508 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
509 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
510 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
511 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
512 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
516 # now fix up the executables
517 echo "Fixing up executable dependency names ..."
518 executables=$MAIN_EXECUTABLE
519 if test x$SAE != x ; then
520 executables="$executables"
523 for exe in $executables; do
524 EXE=$APPROOT/MacOS/$exe
526 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
528 changes="$changes -change $lib @executable_path/../lib/$base"
530 if test "x$changes" != "x" ; then
531 install_name_tool $changes $EXE
535 echo "Fixing up library names ..."
536 # now do the same for all the libraries we include
537 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends ; do
539 libbase=`basename $libdir`
541 for dylib in $libdir/*.dylib $libdir/*.so ; do
545 if test -L $dylib ; then
549 # change all the dependencies
552 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
554 if echo $lib | grep -s libbase; then
555 changes="$changes -change $lib @executable_path/../$libbase/$base"
557 changes="$changes -change $lib @executable_path/../lib/$base"
561 if test "x$changes" != x ; then
562 if install_name_tool $changes $dylib ; then
569 # now the change what the library thinks its own name is
571 base=`basename $dylib`
572 install_name_tool -id @executable_path/../$libbase/$base $dylib
577 # and now ... the DMG
580 rm -rf $PRODUCT_PKG_DIR
581 mkdir $PRODUCT_PKG_DIR
586 if [ x$SAE != x ] ; then
590 echo "Creating SAE packaging directory"
591 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
592 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
593 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
594 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
596 elif [ x$MIXBUS != x ] ; then
600 echo "Creating Mixbus packaging directory"
601 mv $APPDIR $PRODUCT_PKG_DIR/
602 DMGBACKGROUND=dmgbgMB
605 echo "Creating $APPNAME packaging directory"
606 mv $APPDIR $PRODUCT_PKG_DIR/
610 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
613 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
621 if test x$WITH_HARRISON_LV2 != x ; then
622 curl -s -S --fail -# \
623 -z "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
624 -o "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
625 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_lv2s.${OSX_BENSID}.zip"
627 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
628 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
629 "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip"
632 if test x$WITH_HARVID != x ; then
633 echo "installing video tools.."
634 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
635 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
637 echo "copying harvid and xjadeo ..."
640 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
641 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
644 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
645 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
648 -C $PRODUCT_PKG_DIR/$APPROOT \
649 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
651 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
652 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
653 hdiutil detach "${JADEO}"
655 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
656 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
658 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
659 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
660 mv ${file}.thin ${file}
664 YPOS=$[ $DMGWINBOTTOM - 300 ]
665 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
667 DMGBACKGROUND=${DMGBACKGROUND}xj
670 ################################################################################
671 ### Mixbus plugins, etc
672 if test x$WITH_X42_LV2 != x ; then
673 echo "bundling x42 plugins"
674 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
676 METERS_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-meters.latest.txt)
677 rsync -a -q --partial \
678 rsync://x42-plugins.com/x42/osx/x42-meters-lv2-osx-${METERS_VERSION}.zip \
679 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
680 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
681 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
683 EQ_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-eq.latest.txt)
684 rsync -a -q --partial \
685 rsync://x42-plugins.com/x42/osx/x42-eq-lv2-osx-${EQ_VERSION}.zip \
686 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
687 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
688 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
690 SETBFREE_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/setBfree.latest.txt)
691 rsync -a -q --partial \
692 rsync://x42-plugins.com/x42/osx/setBfree-lv2-osx-${SETBFREE_VERSION}.zip \
693 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
694 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
695 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
697 MIDIFILTER_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-midifilter.latest.txt)
698 rsync -a -q --partial \
699 rsync://x42-plugins.com/x42/osx/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip \
700 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
701 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
702 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
704 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
705 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
706 mv ${file}.thin ${file}
710 if test -n "$MIXBUS"; then
711 echo "deploying harrison channelstrip for $OSX_BENSID"
713 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
715 curl -s -S --fail -# \
716 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
717 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
718 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
720 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
721 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
723 echo "deploying harrison vamp plugins for $OSX_BENSID"
725 curl -s -S --fail -# \
726 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
727 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
728 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_vamp.${OSX_BENSID}.dylib"
730 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
731 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
733 ################################################################################
735 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
737 echo "Building DMG ..."
739 # UC_DMG=$APPNAME-${release_version}-UC.dmg
740 # FINAL_DMG=$APPNAME-${release_version}.dmg
742 if [ x$DEBUG = xT ]; then
743 UC_DMG=$APPNAME-$release_version-dbg.dmg
745 UC_DMG=$APPNAME-$release_version.dmg
747 VOLNAME=$APPNAME-$release_version
749 MNTPATH=`mktemp -d -t ardourimg`
750 TMPDMG=`mktemp -t ardour`
751 ICNSTMP=`mktemp -t ardouricon`
753 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
755 echo "DMG MB = " $DMGMEGABYTES
757 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
761 TMPDMG="${TMPDMG}.dmg"
763 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
765 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
766 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
767 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
769 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
770 mkdir "${MNTPATH}/.background"
771 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
773 echo "setting DMG background ..."
775 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
779 # OSX 10.9.X and later
780 DISKNAME=`basename "${MNTPATH}"`
784 tell application "Finder"
786 tell disk "${DISKNAME}"
789 set current view of container window to icon view
790 set toolbar visible of container window to false
791 set statusbar visible of container window to false
792 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
793 set theViewOptions to the icon view options of container window
794 set arrangement of theViewOptions to not arranged
795 set icon size of theViewOptions to 64
796 set background picture of theViewOptions to file ".background:dmgbg.png"
797 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
798 set position of item "${APPDIR}" of container window to {90, 100}
799 set position of item "Applications" of container window to {310, 100}
805 update without registering applications
812 chmod -Rf go-w "${MNTPATH}"
816 echo "compressing Image ..."
818 # Umount the image ('eject' above may already have done that)
819 umount "${DiskDevice}" || true
820 hdiutil eject "${DiskDevice}" || true
821 # Create a read-only version, use zlib compression
822 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
824 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
825 echo "setting file icon ..."
827 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
828 sips -i ${ICNSTMP}.icns
829 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
830 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
831 SetFile -a C "$UC_DMG"
833 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
836 rm -rf ${PRODUCT_PKG_DIR}
839 echo "packaging suceeded."