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
27 : ${HARRISONCHANNELSTRIP=harrison_channelstrip}
28 : ${HARRISONLV2=harrison_lv2s-n}
29 : ${HARRISONDSPURL=http://www.harrisonconsoles.com/plugins/releases/public}
31 . ../define_versions.sh
33 while [ $# -gt 0 ] ; do
38 # top level build targets
44 PRODUCT_PKG_DIR=ArdourSAE ;
46 BUNDLENAME=Ardour${major_version} ;
47 lower_case_appname=ardour;
55 PRODUCT_PKG_DIR=Mixbus;
57 BUNDLENAME=Mixbus${major_version} ;
58 lower_case_appname=mixbus;
60 --mixbus32c) MIXBUS=1;
67 PRODUCT_PKG_DIR=Mixbus32C;
68 lower_case_appname=mixbus32c;
70 BUNDLENAME=Mixbus32C-${major_version} ;
76 PRODUCT_PKG_DIR=Ardour;
78 BUNDLENAME=Ardour${major_version} ;
79 lower_case_appname=ardour;
83 PRODUCT_PKG_DIR=Ardour ;
85 --test) SAE= ; STRIP= ; shift ;;
88 # specific build flags
91 --noharvid) WITH_HARVID= ; shift ;;
92 --nostrip) STRIP= ; shift ;;
93 --sysdeps) PRINT_SYSDEPS=1; shift ;;
94 --nls) WITH_NLS=1 ; shift ;;
95 --chanstrip) HARRISONCHANNELSTRIP=$2 ; shift; shift ;;
99 if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
100 echo "application or product-name was not specified"
104 echo "Version is $release_version"
105 if [ "x$commit" != "x" ] ; then
106 info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
108 info_string="$release_version built on `hostname` by `whoami` on `date`"
110 echo "Info string is $info_string"
112 if [ x$DEBUG = xT ]; then
114 echo "Debug build, strip disabled"
116 if test x$STRIP != x ; then
117 echo "No debug build, strip enabled"
119 echo "No debug build, but strip disabled."
123 # setup directory structure
125 APPDIR=${BUNDLENAME}.app
126 APPROOT=$APPDIR/Contents
127 Frameworks=$APPROOT/lib
128 Resources=$APPROOT/Resources
130 # Since this is OS X, don't try to distinguish between etc and shared
131 # (machine dependent and independent data) - just put everything
136 Locale=$Resources/locale
138 # Bundled Plugins live in a top level folder
140 Plugins=$APPROOT/Plugins
141 Surfaces=$Frameworks/surfaces
142 Panners=$Frameworks/panners
143 Backends=$Frameworks/backends
144 MidiMaps=$Shared/midi_maps
145 ExportFormats=$Shared/export
146 Templates=$Shared/templates
147 PatchFiles=$Shared/patchfiles
148 LuaScripts=$Shared/scripts
149 MackieControl=$Shared/mcp
151 Themes=$Shared/themes
153 if [ x$PRINT_SYSDEPS != x ] ; then
155 # print system dependencies
158 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
159 if ! file $file | grep -qs Mach-O ; then
162 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
167 echo "Removing old $APPDIR tree ..."
171 echo "Building new app directory structure ..."
173 # only bother to make the longest paths
175 mkdir -p $APPROOT/MacOS
176 mkdir -p $APPROOT/Resources
182 mkdir -p $ExportFormats
184 mkdir -p $Frameworks/modules
186 mkdir -p $MackieControl
194 EXECUTABLE=${BUNDLENAME}
197 # if we're not going to bundle JACK, make sure we can find
198 # jack in the places where it might be
202 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
203 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
205 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
209 sed -e "s?@ENV@?$env?g" \
210 -e "s?@VERSION@?$release_version?g" \
211 -e "s?@INFOSTRING@?$info_string?g" \
212 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
213 -e "s?@BUNDLENAME@?$BUNDLENAME?g" \
214 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
216 sed -e "s?@APPNAME@?$appname?" \
217 -e "s?@ENV@?$env?g" \
218 -e "s?@VERSION@?$release_version?g" \
219 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
223 cp Info.plist $APPROOT
224 cp -R Resources $APPROOT
228 rm -f Resources/InfoPlist.strings
231 # if we build a bundle without jack, then
232 # make the Ardour executable a helper
233 # script that checks to see if JACK is
237 cp startup_script $APPROOT/MacOS/$EXECUTABLE
238 chmod 775 $APPROOT/MacOS/$EXECUTABLE
239 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
241 echo "Copying ardour executable ...."
242 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
243 if test x$SAE != x ; then
244 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
245 cp Ardour3-SAE.icns $Resources/appIcon.icns
246 elif test x$MIXBUS32C != x ; then
247 cp Mixbus32C.icns $Resources/appIcon.icns
248 elif test x$MIXBUS != x ; then
249 cp Mixbus.icns $Resources/appIcon.icns
251 cp Ardour.icns $Resources/appIcon.icns
253 cp typeArdour.icns $Resources/
255 set +e # things below are not error-free (optional files etc) :(
258 if test x$WITH_NLS != x ; then
259 echo "NLS support ..."
260 echo "I hope you remembered to run waf i18n"
263 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
264 files=`find ../../$pkg -name "*.mo"`
267 # the package name is appended with a number so that
268 # it can be parallel installed during a regular install
269 # with older (and newer) versions. it is just the major
270 # number of the release (i.e. leading digits)
273 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
275 if [ -z "$files" ]; then
277 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
284 lang=`basename $file | sed 's/\.mo//'`
285 mkdir -p $Locale/$lang/LC_MESSAGES
286 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
287 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
288 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
291 LINGUAS="$LINGUAS $lang"
298 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
299 echo "Copying GTK i18n files for $l..."
300 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
302 # try with just the language spec
303 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
304 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
305 echo "Copying GTK i18n files for $l..."
306 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
311 echo "Skipping NLS support"
315 # Copy stuff that may be dynamically loaded
318 cp -R $GTKSTACK_ROOT/etc/* $Etc
319 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
321 # We rely on clearlooks, so include a version from our own build tree
322 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
324 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
325 mkdir -p $GTK_ENGINE_DIR
327 echo "Copying GTK engines ..."
328 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
329 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
331 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
332 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
335 # Control Surface shared libraries
336 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
337 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
340 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
343 for backend in jack wavesaudio dummy coreaudio; do
344 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
347 # Export Formats/Presets
348 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
349 cp "$f" $ExportFormats ;
352 # Session and Route templates
353 #for f in $BUILD_ROOT/../templates/* ; do
354 # if [ -d "$f" ] ; then
355 # cp -r "$f" $Templates ;
360 # got to be careful with names here
361 for x in $BUILD_ROOT/../midi_maps/*.map ; do
366 # got to be careful with names here
367 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
372 # got to be careful with names here
373 for x in $BUILD_ROOT/../scripts/*.lua ; do
375 if test "${BN:0:1}" = "_"; then
382 # got to be careful with names here
383 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
384 cp "$x" $MackieControl
388 # got to be careful with names here
389 for x in $BUILD_ROOT/../osc/*.preset ; do
393 # VAMP plugins that we use
394 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
396 # Suil modules (new dir 'build-stack')
397 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
398 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
401 # Suil modules (old dir 'build-ardour-stack')
402 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
403 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
406 # VST scanner app and wrapper script, if they exist
407 if test -d $BUILD_ROOT/libs/fst ; then
408 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
412 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
413 mkdir -p $Frameworks/vfork
414 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
418 HAVE_SESSION_UTILS=false
419 for file in $BUILD_ROOT/session_utils/${lower_case_appname}${major_version}-*; do
421 cp -v $file $Frameworks/
422 if test x$STRIP = xall ; then
423 strip -s $Frameworks/${BN}
425 ln -s ../lib/ardour-util.sh ${APPROOT}/MacOS/${BN}
426 HAVE_SESSION_UTILS=true
429 # TODO check if this is still needed, even when building on 10.5
430 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
431 STDCPP='|libstdc\+\+'
438 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
439 if ! file $file | grep -qs Mach-O ; then
442 # libffi contains "S" (other section symbols) that should not be stripped.
443 if [[ $file == *"libffi"* ]] ; then
447 if test x$STRIP != x ; then
448 strip -u -r -arch all $file &>/dev/null
451 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
453 for dep in $deps ; do
455 if ! test -f $Frameworks/$base; then
456 if echo $dep | grep -sq '^libs' ; then
457 cp $BUILD_ROOT/$dep $Frameworks
465 if test x$missing = xfalse ; then
466 # everything has been found
472 echo "Copying other stuff to $APPDIR ..."
474 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
475 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
476 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
477 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
479 # Copied directly from source tree
481 mkdir ${Resources}/icons
482 mkdir ${Resources}/resources
483 cp ../../system_config $Resources/system_config
484 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
485 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
486 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
487 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
490 # Themes: only install those named for this app
491 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
493 # go through and recursively remove any .svn dirs in the bundle
494 for svndir in `find $APPDIR -name .svn -type dir`; do
498 # session utils start script
499 if test "$HAVE_SESSION_UTILS" = true ; then
500 cat >> $Frameworks/ardour-util.sh << EOF
503 BIN_DIR=\$(dirname "\$0")
504 BUNDLE_DIR=\$(dirname "\$BIN_DIR")
506 export ARDOUR_DATA_PATH="\$BUNDLE_DIR/share"
507 export ARDOUR_CONFIG_PATH="\$BUNDLE_DIR/etc"
508 export ARDOUR_DLL_PATH="\$BUNDLE_DIR/lib"
509 export VAMP_PATH="\$BUNDLE_DIR/lib"\${VAMP_PATH:+:\$VAMP_PATH}
511 SELF=\$(basename "\$0")
512 exec "\$BUNDLE_DIR/lib/\$SELF" "\$@"
514 chmod +x $Frameworks/ardour-util.sh
518 # install bundled LV2s to <app>/Contents/lib/LV2/
519 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
521 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
522 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
523 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
524 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
525 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
529 # now fix up the executables
530 echo "Fixing up executable dependency names ..."
531 executables=$MAIN_EXECUTABLE
532 if test x$SAE != x ; then
533 executables="$executables"
535 if test "$HAVE_SESSION_UTILS" = true ; then
536 for file in $Frameworks/${lower_case_appname}${major_version}-*; do
538 executables="$executables ../lib/${BN}"
542 if test -f "$Frameworks/ardour-vst-scanner"; then
543 executables="$executables ../lib/ardour-vst-scanner"
546 for exe in $executables; do
547 echo "Processing Executable: $exe"
548 EXE=$APPROOT/MacOS/$exe
550 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
552 changes="$changes -change $lib @executable_path/../lib/$base"
554 if test "x$changes" != "x" ; then
555 install_name_tool $changes $EXE
559 echo "Fixing up library names ..."
560 # now do the same for all the libraries we include
561 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends $Frameworks/LV2/* ; do
563 libbase=`basename $libdir`
565 for dylib in $libdir/*.dylib $libdir/*.so ; do
569 if test -L $dylib ; then
573 # change all the dependencies
576 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
578 if echo $lib | grep -s libbase; then
579 changes="$changes -change $lib @executable_path/../$libbase/$base"
581 changes="$changes -change $lib @executable_path/../lib/$base"
585 if test "x$changes" != x ; then
586 if install_name_tool $changes $dylib ; then
593 # now the change what the library thinks its own name is
595 base=`basename $dylib`
596 install_name_tool -id @executable_path/../$libbase/$base $dylib
601 # and now ... the DMG
604 rm -rf $PRODUCT_PKG_DIR
605 mkdir $PRODUCT_PKG_DIR
610 if [ x$SAE != x ] ; then
614 echo "Creating SAE packaging directory"
615 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
616 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
617 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
618 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
620 elif [ x$MIXBUS != x ] ; then
624 echo "Creating Mixbus packaging directory"
625 mv $APPDIR $PRODUCT_PKG_DIR/
626 DMGBACKGROUND=dmgbgMB
629 echo "Creating $APPNAME packaging directory"
630 mv $APPDIR $PRODUCT_PKG_DIR/
634 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
637 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
645 if test x$WITH_HARRISON_LV2 != x ; then
646 curl -s -S --fail -# \
647 -z "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
648 -o "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
649 "${HARRISONDSPURL}/${HARRISONLV2}.${OSX_BENSID}.zip"
651 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
652 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
653 "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip"
656 if test x$WITH_HARVID != x ; then
657 echo "installing video tools.."
658 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
659 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
661 echo "copying harvid and xjadeo ..."
664 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
665 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
668 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
669 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
672 -C $PRODUCT_PKG_DIR/$APPROOT \
673 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
675 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
676 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
677 hdiutil detach "${JADEO}"
679 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
680 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
682 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
683 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
684 mv ${file}.thin ${file}
688 YPOS=$[ $DMGWINBOTTOM - 300 ]
689 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
691 DMGBACKGROUND=${DMGBACKGROUND}xj
694 ################################################################################
695 ### Mixbus plugins, etc
697 echo "Bundling General MIDI Synth LV2"
698 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
700 for proj in x42-gmsynth; do
701 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
702 rsync -a -q --partial \
703 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
704 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
705 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
706 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
709 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
710 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
711 mv ${file}.thin ${file}
716 if test x$WITH_X42_LV2 != x ; then
717 echo "bundling x42 plugins"
718 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
720 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums; do
721 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
722 rsync -a -q --partial \
723 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
724 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
725 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
726 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
729 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
730 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
731 mv ${file}.thin ${file}
735 if test -n "$MIXBUS"; then
736 echo "deploying harrison channelstrip for $OSX_BENSID"
738 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
740 curl -s -S --fail -# \
741 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
742 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
743 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
745 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
746 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
748 echo "deploying harrison vamp plugins for $OSX_BENSID"
750 curl -s -S --fail -# \
751 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
752 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
753 "${HARRISONDSPURL}/harrison_vamp.${OSX_BENSID}.dylib"
755 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
756 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
759 ################################################################################
761 if test x$DEMO_SESSION_URL != x ; then
762 mkdir -p $Shared/sessions
763 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
764 for demo in $DEMO_SESSIONS; do
765 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
769 ################################################################################
771 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
773 echo "Building DMG ..."
775 # UC_DMG=$APPNAME-${release_version}-UC.dmg
776 # FINAL_DMG=$APPNAME-${release_version}.dmg
778 if [ x$DEBUG = xT ]; then
779 UC_DMG=$APPNAME-$release_version-dbg.dmg
781 UC_DMG=$APPNAME-$release_version.dmg
783 VOLNAME=$APPNAME-$release_version
785 MNTPATH=`mktemp -d -t ardourimg`
786 TMPDMG=`mktemp -t ardour`
787 ICNSTMP=`mktemp -t ardouricon`
789 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
791 echo "DMG MB = " $DMGMEGABYTES
793 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
797 TMPDMG="${TMPDMG}.dmg"
799 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
801 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
802 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
803 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
805 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
806 mkdir "${MNTPATH}/.background"
807 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
809 echo "setting DMG background ..."
811 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
815 # OSX 10.9.X and later
816 DISKNAME=`basename "${MNTPATH}"`
820 tell application "Finder"
822 tell disk "${DISKNAME}"
825 set current view of container window to icon view
826 set toolbar visible of container window to false
827 set statusbar visible of container window to false
828 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
829 set theViewOptions to the icon view options of container window
830 set arrangement of theViewOptions to not arranged
831 set icon size of theViewOptions to 64
832 set background picture of theViewOptions to file ".background:dmgbg.png"
833 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
834 set position of item "${APPDIR}" of container window to {90, 100}
835 set position of item "Applications" of container window to {310, 100}
841 update without registering applications
843 set position of item "${APPDIR}" of container window to {90, 100}
844 set position of item "Applications" of container window to {310, 100}
850 update without registering applications
857 chmod -Rf go-w "${MNTPATH}"
861 echo "compressing Image ..."
863 # Umount the image ('eject' above may already have done that)
864 umount "${DiskDevice}" || true
865 hdiutil eject "${DiskDevice}" || true
866 # Create a read-only version, use zlib compression
867 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
869 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
870 echo "setting file icon ..."
872 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
873 sips -i ${ICNSTMP}.icns
874 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
875 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
876 SetFile -a C "$UC_DMG"
878 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
881 rm -rf ${PRODUCT_PKG_DIR}
884 echo "packaging suceeded."