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
183 mkdir -p $Frameworks/modules
185 mkdir -p $MackieControl
193 EXECUTABLE=${BUNDLENAME}
196 # if we're not going to bundle JACK, make sure we can find
197 # jack in the places where it might be
201 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
202 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
204 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
208 sed -e "s?@ENV@?$env?g" \
209 -e "s?@VERSION@?$release_version?g" \
210 -e "s?@INFOSTRING@?$info_string?g" \
211 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
212 -e "s?@BUNDLENAME@?$BUNDLENAME?g" \
213 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
215 sed -e "s?@APPNAME@?$appname?" \
216 -e "s?@ENV@?$env?g" \
217 -e "s?@VERSION@?$release_version?g" \
218 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
222 cp Info.plist $APPROOT
223 cp -R Resources $APPROOT
227 rm -f Resources/InfoPlist.strings
230 # if we build a bundle without jack, then
231 # make the Ardour executable a helper
232 # script that checks to see if JACK is
236 cp startup_script $APPROOT/MacOS/$EXECUTABLE
237 chmod 775 $APPROOT/MacOS/$EXECUTABLE
238 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
240 echo "Copying ardour executable ...."
241 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
242 if test x$SAE != x ; then
243 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
244 cp Ardour3-SAE.icns $Resources/appIcon.icns
245 elif test x$MIXBUS32C != x ; then
246 cp Mixbus32C.icns $Resources/appIcon.icns
247 elif test x$MIXBUS != x ; then
248 cp Mixbus.icns $Resources/appIcon.icns
250 cp Ardour.icns $Resources/appIcon.icns
252 cp typeArdour.icns $Resources/
254 set +e # things below are not error-free (optional files etc) :(
257 if test x$WITH_NLS != x ; then
258 echo "NLS support ..."
259 echo "I hope you remembered to run waf i18n"
262 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
263 files=`find ../../$pkg -name "*.mo"`
266 # the package name is appended with a number so that
267 # it can be parallel installed during a regular install
268 # with older (and newer) versions. it is just the major
269 # number of the release (i.e. leading digits)
272 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
274 if [ -z "$files" ]; then
276 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
283 lang=`basename $file | sed 's/\.mo//'`
284 mkdir -p $Locale/$lang/LC_MESSAGES
285 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
286 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
287 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
290 LINGUAS="$LINGUAS $lang"
297 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
298 echo "Copying GTK i18n files for $l..."
299 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
301 # try with just the language spec
302 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
303 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
304 echo "Copying GTK i18n files for $l..."
305 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
310 echo "Skipping NLS support"
314 # Copy stuff that may be dynamically loaded
317 cp -R $GTKSTACK_ROOT/etc/* $Etc
318 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
320 # We rely on clearlooks, so include a version from our own build tree
321 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
323 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
324 mkdir -p $GTK_ENGINE_DIR
326 echo "Copying GTK engines ..."
327 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
328 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
330 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
331 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
334 # Control Surface shared libraries
335 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
336 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
339 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
342 for backend in jack wavesaudio dummy coreaudio; do
343 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
346 # Export Formats/Presets
347 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
348 cp "$f" $ExportFormats ;
352 cp -av $BUILD_ROOT/../templates $Templates
355 # got to be careful with names here
356 for x in $BUILD_ROOT/../midi_maps/*.map ; do
361 # got to be careful with names here
362 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
367 # got to be careful with names here
368 for x in $BUILD_ROOT/../scripts/*.lua ; do
370 if test "${BN:0:1}" = "_"; then
377 # got to be careful with names here
378 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
379 cp "$x" $MackieControl
383 # got to be careful with names here
384 for x in $BUILD_ROOT/../osc/*.preset ; do
388 # VAMP plugins that we use
389 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
391 # Suil modules (new dir 'build-stack')
392 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
393 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
396 # Suil modules (old dir 'build-ardour-stack')
397 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
398 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
401 # VST scanner app and wrapper script, if they exist
402 if test -d $BUILD_ROOT/libs/fst ; then
403 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
407 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
408 mkdir -p $Frameworks/vfork
409 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
413 HAVE_SESSION_UTILS=false
414 for file in $BUILD_ROOT/session_utils/${lower_case_appname}${major_version}-*; do
416 cp -v $file $Frameworks/
417 if test x$STRIP = xall ; then
418 strip -s $Frameworks/${BN}
420 ln -s ../lib/ardour-util.sh ${APPROOT}/MacOS/${BN}
421 HAVE_SESSION_UTILS=true
424 # TODO check if this is still needed, even when building on 10.5
425 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
426 STDCPP='|libstdc\+\+'
433 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
434 if ! file $file | grep -qs Mach-O ; then
437 # libffi contains "S" (other section symbols) that should not be stripped.
438 if [[ $file == *"libffi"* ]] ; then
442 if test x$STRIP != x ; then
443 strip -u -r -arch all $file &>/dev/null
446 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
448 for dep in $deps ; do
450 if ! test -f $Frameworks/$base; then
451 if echo $dep | grep -sq '^libs' ; then
452 cp $BUILD_ROOT/$dep $Frameworks
460 if test x$missing = xfalse ; then
461 # everything has been found
467 echo "Copying other stuff to $APPDIR ..."
469 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
470 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
471 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
472 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
474 # Copied directly from source tree
476 mkdir ${Resources}/icons
477 mkdir ${Resources}/resources
478 cp ../../system_config $Resources/system_config
479 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
480 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
481 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
482 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
485 # Themes: only install those named for this app
486 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
488 # go through and recursively remove any .svn dirs in the bundle
489 for svndir in `find $APPDIR -name .svn -type dir`; do
493 # session utils start script
494 if test "$HAVE_SESSION_UTILS" = true ; then
495 cat >> $Frameworks/ardour-util.sh << EOF
498 BIN_DIR=\$(dirname "\$0")
499 BUNDLE_DIR=\$(dirname "\$BIN_DIR")
501 export ARDOUR_DATA_PATH="\$BUNDLE_DIR/share"
502 export ARDOUR_CONFIG_PATH="\$BUNDLE_DIR/etc"
503 export ARDOUR_DLL_PATH="\$BUNDLE_DIR/lib"
504 export VAMP_PATH="\$BUNDLE_DIR/lib"\${VAMP_PATH:+:\$VAMP_PATH}
506 SELF=\$(basename "\$0")
507 exec "\$BUNDLE_DIR/lib/\$SELF" "\$@"
509 chmod +x $Frameworks/ardour-util.sh
513 # install bundled LV2s to <app>/Contents/lib/LV2/
514 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
516 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
517 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
518 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
519 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
520 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
524 # now fix up the executables
525 echo "Fixing up executable dependency names ..."
526 executables=$MAIN_EXECUTABLE
527 if test x$SAE != x ; then
528 executables="$executables"
530 if test "$HAVE_SESSION_UTILS" = true ; then
531 for file in $Frameworks/${lower_case_appname}${major_version}-*; do
533 executables="$executables ../lib/${BN}"
537 if test -f "$Frameworks/ardour-vst-scanner"; then
538 executables="$executables ../lib/ardour-vst-scanner"
541 for exe in $executables; do
542 echo "Processing Executable: $exe"
543 EXE=$APPROOT/MacOS/$exe
545 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
547 changes="$changes -change $lib @executable_path/../lib/$base"
549 if test "x$changes" != "x" ; then
550 install_name_tool $changes $EXE
554 echo "Fixing up library names ..."
555 # now do the same for all the libraries we include
556 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends $Frameworks/LV2/* ; do
558 libbase=`basename $libdir`
560 for dylib in $libdir/*.dylib $libdir/*.so ; do
564 if test -L $dylib ; then
568 # change all the dependencies
571 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
573 if echo $lib | grep -s libbase; then
574 changes="$changes -change $lib @executable_path/../$libbase/$base"
576 changes="$changes -change $lib @executable_path/../lib/$base"
580 if test "x$changes" != x ; then
581 if install_name_tool $changes $dylib ; then
588 # now the change what the library thinks its own name is
590 base=`basename $dylib`
591 install_name_tool -id @executable_path/../$libbase/$base $dylib
596 # and now ... the DMG
599 rm -rf $PRODUCT_PKG_DIR
600 mkdir $PRODUCT_PKG_DIR
605 if [ x$SAE != x ] ; then
609 echo "Creating SAE packaging directory"
610 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
611 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
612 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
613 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
615 elif [ x$MIXBUS != x ] ; then
619 echo "Creating Mixbus packaging directory"
620 mv $APPDIR $PRODUCT_PKG_DIR/
621 DMGBACKGROUND=dmgbgMB
624 echo "Creating $APPNAME packaging directory"
625 mv $APPDIR $PRODUCT_PKG_DIR/
629 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
632 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
640 if test x$WITH_HARRISON_LV2 != x ; then
641 curl -s -S --fail -# \
642 -z "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
643 -o "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
644 "${HARRISONDSPURL}/${HARRISONLV2}.${OSX_BENSID}.zip"
646 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
647 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
648 "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip"
651 if test x$WITH_HARVID != x ; then
652 echo "installing video tools.."
653 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
654 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
656 echo "copying harvid and xjadeo ..."
659 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
660 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
663 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
664 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
667 -C $PRODUCT_PKG_DIR/$APPROOT \
668 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
670 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
671 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
672 hdiutil detach "${JADEO}"
674 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
675 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
677 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
678 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
679 mv ${file}.thin ${file}
683 YPOS=$[ $DMGWINBOTTOM - 300 ]
684 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
686 DMGBACKGROUND=${DMGBACKGROUND}xj
689 ################################################################################
690 ### Mixbus plugins, etc
692 echo "Bundling General MIDI Synth LV2"
693 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
695 for proj in x42-gmsynth; do
696 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
697 rsync -a -q --partial \
698 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
699 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
700 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
701 "$CACHEDIR/${proj}-lv2-osx-${X42_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}
711 if test x$WITH_X42_LV2 != x ; then
712 echo "bundling x42 plugins"
713 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
715 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums; do
716 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
717 rsync -a -q --partial \
718 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
719 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
720 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
721 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
724 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
725 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
726 mv ${file}.thin ${file}
730 if test -n "$MIXBUS"; then
731 echo "deploying harrison channelstrip for $OSX_BENSID"
733 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
735 curl -s -S --fail -# \
736 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
737 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
738 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
740 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
741 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
743 echo "deploying harrison vamp plugins for $OSX_BENSID"
745 curl -s -S --fail -# \
746 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
747 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
748 "${HARRISONDSPURL}/harrison_vamp.${OSX_BENSID}.dylib"
750 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
751 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
754 ################################################################################
756 if test x$DEMO_SESSION_URL != x ; then
757 mkdir -p $Shared/sessions
758 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
759 for demo in $DEMO_SESSIONS; do
760 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
764 ################################################################################
766 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
768 echo "Building DMG ..."
770 # UC_DMG=$APPNAME-${release_version}-UC.dmg
771 # FINAL_DMG=$APPNAME-${release_version}.dmg
773 if [ x$DEBUG = xT ]; then
774 UC_DMG=$APPNAME-$release_version-dbg.dmg
776 UC_DMG=$APPNAME-$release_version.dmg
778 VOLNAME=$APPNAME-$release_version
780 MNTPATH=`mktemp -d -t ardourimg`
781 TMPDMG=`mktemp -t ardour`
782 ICNSTMP=`mktemp -t ardouricon`
784 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
786 echo "DMG MB = " $DMGMEGABYTES
788 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
792 TMPDMG="${TMPDMG}.dmg"
794 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
796 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
797 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
798 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
800 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
801 mkdir "${MNTPATH}/.background"
802 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
804 echo "setting DMG background ..."
806 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
810 # OSX 10.9.X and later
811 DISKNAME=`basename "${MNTPATH}"`
815 tell application "Finder"
817 tell disk "${DISKNAME}"
820 set current view of container window to icon view
821 set toolbar visible of container window to false
822 set statusbar visible of container window to false
823 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
824 set theViewOptions to the icon view options of container window
825 set arrangement of theViewOptions to not arranged
826 set icon size of theViewOptions to 64
827 set background picture of theViewOptions to file ".background:dmgbg.png"
828 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
829 set position of item "${APPDIR}" of container window to {90, 100}
830 set position of item "Applications" of container window to {310, 100}
836 update without registering applications
838 set position of item "${APPDIR}" of container window to {90, 100}
839 set position of item "Applications" of container window to {310, 100}
845 update without registering applications
852 chmod -Rf go-w "${MNTPATH}"
856 echo "compressing Image ..."
858 # Umount the image ('eject' above may already have done that)
859 umount "${DiskDevice}" || true
860 hdiutil eject "${DiskDevice}" || true
861 # Create a read-only version, use zlib compression
862 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
864 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
865 echo "setting file icon ..."
867 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
868 sips -i ${ICNSTMP}.icns
869 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
870 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
871 SetFile -a C "$UC_DMG"
873 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
876 rm -rf ${PRODUCT_PKG_DIR}
879 echo "packaging suceeded."