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;
69 APPNAME=Mixbus32C-${major_version} ;
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
150 Themes=$Shared/themes
152 if [ x$PRINT_SYSDEPS != x ] ; then
154 # print system dependencies
157 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
158 if ! file $file | grep -qs Mach-O ; then
161 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
166 echo "Removing old $APPDIR tree ..."
170 echo "Building new app directory structure ..."
172 # only bother to make the longest paths
174 mkdir -p $APPROOT/MacOS
175 mkdir -p $APPROOT/Resources
181 mkdir -p $ExportFormats
183 mkdir -p $Frameworks/modules
185 mkdir -p $MackieControl
192 EXECUTABLE=${BUNDLENAME}
195 # if we're not going to bundle JACK, make sure we can find
196 # jack in the places where it might be
200 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
201 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
203 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
207 sed -e "s?@ENV@?$env?g" \
208 -e "s?@VERSION@?$release_version?g" \
209 -e "s?@INFOSTRING@?$info_string?g" \
210 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
211 -e "s?@BUNDLENAME@?$BUNDLENAME?g" \
212 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
214 sed -e "s?@APPNAME@?$appname?" \
215 -e "s?@ENV@?$env?g" \
216 -e "s?@VERSION@?$release_version?g" \
217 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
221 cp Info.plist $APPROOT
222 cp -R Resources $APPROOT
226 rm -f Resources/InfoPlist.strings
229 # if we build a bundle without jack, then
230 # make the Ardour executable a helper
231 # script that checks to see if JACK is
235 cp startup_script $APPROOT/MacOS/$EXECUTABLE
236 chmod 775 $APPROOT/MacOS/$EXECUTABLE
237 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
239 echo "Copying ardour executable ...."
240 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
241 if test x$SAE != x ; then
242 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
243 cp Ardour3-SAE.icns $Resources/appIcon.icns
244 elif test x$MIXBUS32C != x ; then
245 cp Mixbus32C.icns $Resources/appIcon.icns
246 elif test x$MIXBUS != x ; then
247 cp Mixbus.icns $Resources/appIcon.icns
249 cp Ardour.icns $Resources/appIcon.icns
251 cp typeArdour.icns $Resources/
253 set +e # things below are not error-free (optional files etc) :(
256 if test x$WITH_NLS != x ; then
257 echo "NLS support ..."
258 echo "I hope you remembered to run waf i18n"
261 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
262 files=`find ../../$pkg -name "*.mo"`
265 # the package name is appended with a number so that
266 # it can be parallel installed during a regular install
267 # with older (and newer) versions. it is just the major
268 # number of the release (i.e. leading digits)
271 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
273 if [ -z "$files" ]; then
275 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
282 lang=`basename $file | sed 's/\.mo//'`
283 mkdir -p $Locale/$lang/LC_MESSAGES
284 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
285 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
286 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
289 LINGUAS="$LINGUAS $lang"
296 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
297 echo "Copying GTK i18n files for $l..."
298 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
300 # try with just the language spec
301 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
302 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
303 echo "Copying GTK i18n files for $l..."
304 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
309 echo "Skipping NLS support"
313 # Copy stuff that may be dynamically loaded
316 cp -R $GTKSTACK_ROOT/etc/* $Etc
317 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
319 # We rely on clearlooks, so include a version from our own build tree
320 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
322 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
323 mkdir -p $GTK_ENGINE_DIR
325 echo "Copying GTK engines ..."
326 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
327 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
329 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
330 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
333 # Control Surface shared libraries
334 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
335 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
338 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
341 for backend in jack wavesaudio dummy coreaudio; do
342 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
345 # Export Formats/Presets
346 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
347 cp "$f" $ExportFormats ;
350 # Session and Route templates
351 #for f in $BUILD_ROOT/../templates/* ; do
352 # if [ -d "$f" ] ; then
353 # cp -r "$f" $Templates ;
358 # got to be careful with names here
359 for x in $BUILD_ROOT/../midi_maps/*.map ; do
364 # got to be careful with names here
365 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
370 # got to be careful with names here
371 for x in $BUILD_ROOT/../scripts/*.lua ; do
373 if test "${BN:0:1}" = "_"; then
380 # got to be careful with names here
381 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
382 cp "$x" $MackieControl
385 # VAMP plugins that we use
386 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
388 # Suil modules (new dir 'build-stack')
389 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
390 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
393 # Suil modules (old dir 'build-ardour-stack')
394 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
395 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
398 # VST scanner app and wrapper script, if they exist
399 if test -d $BUILD_ROOT/libs/fst ; then
400 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
404 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
405 mkdir -p $Frameworks/vfork
406 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
410 HAVE_SESSION_UTILS=false
411 for file in $BUILD_ROOT/session_utils/${lower_case_appname}${major_version}-*; do
413 cp -v $file $Frameworks/
414 if test x$STRIP = xall ; then
415 strip -s $Frameworks/${BN}
417 ln -s ../lib/ardour-util.sh ${APPROOT}/MacOS/${BN}
418 HAVE_SESSION_UTILS=true
421 # TODO check if this is still needed, even when building on 10.5
422 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
423 STDCPP='|libstdc\+\+'
430 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
431 if ! file $file | grep -qs Mach-O ; then
434 # libffi contains "S" (other section symbols) that should not be stripped.
435 if [[ $file == *"libffi"* ]] ; then
439 if test x$STRIP != x ; then
440 strip -u -r -arch all $file &>/dev/null
443 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
445 for dep in $deps ; do
447 if ! test -f $Frameworks/$base; then
448 if echo $dep | grep -sq '^libs' ; then
449 cp $BUILD_ROOT/$dep $Frameworks
457 if test x$missing = xfalse ; then
458 # everything has been found
464 echo "Copying other stuff to $APPDIR ..."
466 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
467 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
468 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
469 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
471 # Copied directly from source tree
473 mkdir ${Resources}/icons
474 mkdir ${Resources}/resources
475 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
476 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
477 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
478 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
481 # Themes: only install those named for this app
482 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
484 # go through and recursively remove any .svn dirs in the bundle
485 for svndir in `find $APPDIR -name .svn -type dir`; do
489 # session utils start script
490 if test "$HAVE_SESSION_UTILS" = true ; then
491 cat >> $Frameworks/ardour-util.sh << EOF
494 BIN_DIR=\$(dirname "\$0")
495 BUNDLE_DIR=\$(dirname "\$BIN_DIR")
497 export ARDOUR_DATA_PATH="\$BUNDLE_DIR/share"
498 export ARDOUR_CONFIG_PATH="\$BUNDLE_DIR/etc"
499 export ARDOUR_DLL_PATH="\$BUNDLE_DIR/lib"
500 export VAMP_PATH="\$BUNDLE_DIR/lib"\${VAMP_PATH:+:\$VAMP_PATH}
502 SELF=\$(basename "\$0")
503 exec "\$BUNDLE_DIR/lib/\$SELF" "\$@"
505 chmod +x $Frameworks/ardour-util.sh
509 # install bundled LV2s to <app>/Contents/lib/LV2/
510 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
512 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
513 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
514 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
515 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
516 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
520 # now fix up the executables
521 echo "Fixing up executable dependency names ..."
522 executables=$MAIN_EXECUTABLE
523 if test x$SAE != x ; then
524 executables="$executables"
526 if test "$HAVE_SESSION_UTILS" = true ; then
527 for file in $Frameworks/${lower_case_appname}${major_version}-*; do
529 executables="$executables ../lib/${BN}"
533 if test -f "$Frameworks/ardour-vst-scanner"; then
534 executables="$executables ../lib/ardour-vst-scanner"
537 for exe in $executables; do
538 echo "Processing Executable: $exe"
539 EXE=$APPROOT/MacOS/$exe
541 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
543 changes="$changes -change $lib @executable_path/../lib/$base"
545 if test "x$changes" != "x" ; then
546 install_name_tool $changes $EXE
550 echo "Fixing up library names ..."
551 # now do the same for all the libraries we include
552 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends $Frameworks/LV2/* ; do
554 libbase=`basename $libdir`
556 for dylib in $libdir/*.dylib $libdir/*.so ; do
560 if test -L $dylib ; then
564 # change all the dependencies
567 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
569 if echo $lib | grep -s libbase; then
570 changes="$changes -change $lib @executable_path/../$libbase/$base"
572 changes="$changes -change $lib @executable_path/../lib/$base"
576 if test "x$changes" != x ; then
577 if install_name_tool $changes $dylib ; then
584 # now the change what the library thinks its own name is
586 base=`basename $dylib`
587 install_name_tool -id @executable_path/../$libbase/$base $dylib
592 # and now ... the DMG
595 rm -rf $PRODUCT_PKG_DIR
596 mkdir $PRODUCT_PKG_DIR
601 if [ x$SAE != x ] ; then
605 echo "Creating SAE packaging directory"
606 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
607 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
608 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
609 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
611 elif [ x$MIXBUS != x ] ; then
615 echo "Creating Mixbus packaging directory"
616 mv $APPDIR $PRODUCT_PKG_DIR/
617 DMGBACKGROUND=dmgbgMB
620 echo "Creating $APPNAME packaging directory"
621 mv $APPDIR $PRODUCT_PKG_DIR/
625 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
628 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
636 if test x$WITH_HARRISON_LV2 != x ; then
637 curl -s -S --fail -# \
638 -z "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
639 -o "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
640 "${HARRISONDSPURL}/${HARRISONLV2}.${OSX_BENSID}.zip"
642 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
643 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
644 "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip"
647 if test x$WITH_HARVID != x ; then
648 echo "installing video tools.."
649 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
650 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
652 echo "copying harvid and xjadeo ..."
655 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
656 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
659 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
660 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
663 -C $PRODUCT_PKG_DIR/$APPROOT \
664 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
666 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
667 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
668 hdiutil detach "${JADEO}"
670 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
671 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
673 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
674 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
675 mv ${file}.thin ${file}
679 YPOS=$[ $DMGWINBOTTOM - 300 ]
680 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
682 DMGBACKGROUND=${DMGBACKGROUND}xj
685 ################################################################################
686 ### Mixbus plugins, etc
688 echo "Bundling General MIDI Synth LV2"
689 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
691 for proj in x42-gmsynth; do
692 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
693 rsync -a -q --partial \
694 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
695 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
696 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
697 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
700 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
701 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
702 mv ${file}.thin ${file}
707 if test x$WITH_X42_LV2 != x ; then
708 echo "bundling x42 plugins"
709 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
711 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums; do
712 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
713 rsync -a -q --partial \
714 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
715 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
716 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
717 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
720 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
721 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
722 mv ${file}.thin ${file}
726 if test -n "$MIXBUS"; then
727 echo "deploying harrison channelstrip for $OSX_BENSID"
729 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
731 curl -s -S --fail -# \
732 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
733 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
734 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
736 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
737 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
739 echo "deploying harrison vamp plugins for $OSX_BENSID"
741 curl -s -S --fail -# \
742 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
743 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
744 "${HARRISONDSPURL}/harrison_vamp.${OSX_BENSID}.dylib"
746 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
747 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
750 ################################################################################
752 if test x$DEMO_SESSION_URL != x ; then
753 mkdir -p $Shared/sessions
754 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
755 for demo in $DEMO_SESSIONS; do
756 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
760 ################################################################################
762 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
764 echo "Building DMG ..."
766 # UC_DMG=$APPNAME-${release_version}-UC.dmg
767 # FINAL_DMG=$APPNAME-${release_version}.dmg
769 if [ x$DEBUG = xT ]; then
770 UC_DMG=$APPNAME-$release_version-dbg.dmg
772 UC_DMG=$APPNAME-$release_version.dmg
774 VOLNAME=$APPNAME-$release_version
776 MNTPATH=`mktemp -d -t ardourimg`
777 TMPDMG=`mktemp -t ardour`
778 ICNSTMP=`mktemp -t ardouricon`
780 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
782 echo "DMG MB = " $DMGMEGABYTES
784 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
788 TMPDMG="${TMPDMG}.dmg"
790 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
792 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
793 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
794 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
796 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
797 mkdir "${MNTPATH}/.background"
798 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
800 echo "setting DMG background ..."
802 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
806 # OSX 10.9.X and later
807 DISKNAME=`basename "${MNTPATH}"`
811 tell application "Finder"
813 tell disk "${DISKNAME}"
816 set current view of container window to icon view
817 set toolbar visible of container window to false
818 set statusbar visible of container window to false
819 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
820 set theViewOptions to the icon view options of container window
821 set arrangement of theViewOptions to not arranged
822 set icon size of theViewOptions to 64
823 set background picture of theViewOptions to file ".background:dmgbg.png"
824 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
825 set position of item "${APPDIR}" of container window to {90, 100}
826 set position of item "Applications" of container window to {310, 100}
832 update without registering applications
839 chmod -Rf go-w "${MNTPATH}"
843 echo "compressing Image ..."
845 # Umount the image ('eject' above may already have done that)
846 umount "${DiskDevice}" || true
847 hdiutil eject "${DiskDevice}" || true
848 # Create a read-only version, use zlib compression
849 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
851 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
852 echo "setting file icon ..."
854 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
855 sips -i ${ICNSTMP}.icns
856 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
857 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
858 SetFile -a C "$UC_DMG"
860 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
863 rm -rf ${PRODUCT_PKG_DIR}
866 echo "packaging suceeded."