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
26 : ${HARRISONCHANNELSTRIP=harrison_channelstrip}
28 while [ $# -gt 0 ] ; do
33 # top level build targets
40 PRODUCT_PKG_DIR=ArdourSAE ;
50 PRODUCT_PKG_DIR=Mixbus;
56 PRODUCT_PKG_DIR=Ardour;
62 PRODUCT_PKG_DIR=Ardour ;
64 --test) SAE= ; WITH_LADSPA=; STRIP= ; shift ;;
67 # specific build flags
70 --noharvid) WITH_HARVID= ; shift ;;
71 --noladspa) WITH_LADSPA= ; shift ;;
72 --nostrip) STRIP= ; shift ;;
73 --sysdeps) PRINT_SYSDEPS=1; shift ;;
74 --nls) WITH_NLS=1 ; shift ;;
75 --chanstrip) HARRISONCHANNELSTRIP=$2 ; shift; shift ;;
79 if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then
80 echo "application or product-name was not specified"
84 . ../define_versions.sh
85 echo "Version is $release_version"
86 if [ "x$commit" != "x" ] ; then
87 info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`"
89 info_string="$release_version built on `hostname` by `whoami` on `date`"
91 echo "Info string is $info_string"
93 if [ x$DEBUG = xT ]; then
95 echo "Debug build, strip disabled"
97 if test x$STRIP != x ; then
98 echo "No debug build, strip enabled"
100 echo "No debug build, but strip disabled."
104 # setup directory structure
106 APPDIR=${APPNAME}${major_version}.app
107 APPROOT=$APPDIR/Contents
108 Frameworks=$APPROOT/lib
109 Resources=$APPROOT/Resources
111 # Since this is OS X, don't try to distinguish between etc and shared
112 # (machine dependent and independent data) - just put everything
117 Locale=$Resources/locale
119 # Bundled Plugins live in a top level folder
121 Plugins=$APPROOT/Plugins
122 Surfaces=$Frameworks/surfaces
123 Panners=$Frameworks/panners
124 Backends=$Frameworks/backends
125 MidiMaps=$Shared/midi_maps
126 ExportFormats=$Shared/export
127 Templates=$Shared/templates
128 PatchFiles=$Shared/patchfiles
129 LuaScripts=$Shared/scripts
130 MackieControl=$Shared/mcp
132 if [ x$PRINT_SYSDEPS != x ] ; then
134 # print system dependencies
137 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
138 if ! file $file | grep -qs Mach-O ; then
141 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
146 echo "Removing old $APPDIR tree ..."
150 echo "Building new app directory structure ..."
152 # only bother to make the longest paths
154 mkdir -p $APPROOT/MacOS
155 mkdir -p $APPROOT/Resources
161 mkdir -p $ExportFormats
163 mkdir -p $Frameworks/modules
165 mkdir -p $MackieControl
169 # maybe set variables
171 if test x$SAE != x ; then
172 appname="Ardour${major_version}-SAE"
173 EXECUTABLE=${appname}
174 env="$env<key>ARDOUR_SAE</key><string>true</string>"
176 # current default for SAE version is German keyboard layout without a keypad
178 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>de-nokeypad</string>"
179 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui_sae.conf</string>"
180 elif test x$MIXBUS != x ; then
182 EXECUTABLE=${appname}${major_version}
183 env="$env<key>ARDOUR_MIXBUS</key><string>true</string>"
185 # current default for MIXBUS version is US keyboard layout without a keypad
187 env="$env<key>ARDOUR_KEYBOARD_LAYOUT</key><string>us-nokeypad</string>"
188 env="$env<key>ARDOUR_UI_CONF</key><string>ardour3_ui.conf</string>"
190 appname="Ardour${major_version}"
191 EXECUTABLE=${appname}
195 # if we're not going to bundle JACK, make sure we can find
196 # jack in the places where it might be
199 env="$env<key>PATH</key><string>/usr/local/bin:/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>"
200 env="$env<key>DYLIB_FALLBACK_LIBRARY_PATH</key><string>/usr/local/lib:/opt/lib</string>"
202 env="<key>LSEnvironment</key><dict>$env<key>ARDOUR_BUNDLED</key><string>true</string></dict>"
206 sed -e "s?@ENV@?$env?g" \
207 -e "s?@VERSION@?$release_version?g" \
208 -e "s?@INFOSTRING@?$info_string?g" \
209 -e "s?@IDSUFFIX@?$EXECUTABLE?g" \
210 -e "s?@BUNDLENAME@?${APPNAME}${major_version}?g" \
211 -e "s?@EXECUTABLE@?$EXECUTABLE?g" < Info.plist.in > Info.plist
213 sed -e "s?@APPNAME@?$appname?" \
214 -e "s?@ENV@?$env?g" \
215 -e "s?@VERSION@?$release_version?g" \
216 -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1
220 cp Info.plist $APPROOT
221 cp -R Resources $APPROOT
225 rm -f Resources/InfoPlist.strings
228 # if we build a bundle without jack, then
229 # make the Ardour executable a helper
230 # script that checks to see if JACK is
234 cp startup_script $APPROOT/MacOS/$EXECUTABLE
235 chmod 775 $APPROOT/MacOS/$EXECUTABLE
236 MAIN_EXECUTABLE=Ardour.bin ## used in startup_script
238 echo "Copying ardour executable ...."
239 cp $BUILD_ROOT/gtk2_ardour/ardour-$release_version $APPROOT/MacOS/$MAIN_EXECUTABLE
240 if test x$SAE != x ; then
241 # cp $BUILD_ROOT/gtk2_ardour/evtest $APPROOT/MacOS/gtkevents
242 cp Ardour3-SAE.icns $Resources/appIcon.icns
243 elif test x$MIXBUS != x ; then
244 cp Mixbus.icns $Resources/appIcon.icns
246 cp Ardour.icns $Resources/appIcon.icns
248 cp typeArdour.icns $Resources/
250 set +e # things below are not error-free (optional files etc) :(
253 if test x$WITH_NLS != x ; then
254 echo "NLS support ..."
255 echo "I hope you remembered to run waf i18n"
258 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
259 files=`find ../../$pkg -name "*.mo"`
262 # the package name is appended with a number so that
263 # it can be parallel installed during a regular install
264 # with older (and newer) versions. it is just the major
265 # number of the release (i.e. leading digits)
268 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
270 if [ -z "$files" ]; then
272 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
279 lang=`basename $file | sed 's/\.mo//'`
280 mkdir -p $Locale/$lang/LC_MESSAGES
281 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
282 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
283 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
286 LINGUAS="$LINGUAS $lang"
293 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
294 echo "Copying GTK i18n files for $l..."
295 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
297 # try with just the language spec
298 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
299 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
300 echo "Copying GTK i18n files for $l..."
301 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
306 echo "Skipping NLS support"
310 # Copy stuff that may be dynamically loaded
313 cp -R $GTKSTACK_ROOT/etc/* $Etc
314 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
316 # We rely on clearlooks, so include a version from our own build tree
317 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
319 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
320 mkdir -p $GTK_ENGINE_DIR
322 echo "Copying GTK engines ..."
323 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
324 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
326 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
327 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
330 if test x$WITH_LADSPA != x ; then
331 if test x$SAE != x ; then
333 elif test x$MIXBUS != x ; then
334 plugdir=mixbus_ladspa
338 if [ -d $plugdir -a "x$(ls $plugdir)" != x ] ; then
339 echo "Copying `ls $plugdir | wc -l` plugins ..."
340 cp -r $plugdir/* $Plugins
344 # Control Surface shared libraries
345 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
346 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
349 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
352 for backend in jack wavesaudio dummy coreaudio; do
353 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
356 # Export Formats/Presets
357 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
358 cp "$f" $ExportFormats ;
361 # Session and Route templates
362 #for f in $BUILD_ROOT/../templates/* ; do
363 # if [ -d "$f" ] ; then
364 # cp -r "$f" $Templates ;
369 # got to be careful with names here
370 for x in $BUILD_ROOT/../midi_maps/*.map ; do
375 # got to be careful with names here
376 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
381 # got to be careful with names here
382 for x in $BUILD_ROOT/../scripts/*.lua ; do
387 # got to be careful with names here
388 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
389 cp "$x" $MackieControl
392 # VAMP plugins that we use
393 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
395 # Suil modules (new dir 'build-stack')
396 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
397 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
400 # Suil modules (old dir 'build-ardour-stack')
401 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
402 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
405 # VST scanner app and wrapper script, if they exist
406 if test -d $BUILD_ROOT/libs/fst ; then
407 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
411 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
412 mkdir -p $Frameworks/vfork
413 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
416 # TODO check if this is still needed, even when building on 10.5
417 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
418 STDCPP='|libstdc\+\+'
425 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib $Plugins/*.so ; do
426 if ! file $file | grep -qs Mach-O ; then
429 # libffi contains "S" (other section symbols) that should not be stripped.
430 if [[ $file == *"libffi"* ]] ; then
434 if test x$STRIP != x ; then
435 strip -u -r -arch all $file &>/dev/null
438 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
440 for dep in $deps ; do
442 if ! test -f $Frameworks/$base; then
443 if echo $dep | grep -sq '^libs' ; then
444 cp $BUILD_ROOT/$dep $Frameworks
452 if test x$missing = xfalse ; then
453 # everything has been found
459 echo "Copying other stuff to $APPDIR ..."
461 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
462 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
463 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
464 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
466 # Copied directly from source tree
468 cp ../../system_config $Resources/system_config
469 cp ../../instant.xml $Resources/instant.xml
470 cp -r ../../gtk2_ardour/icons $Resources
471 cp -r ../../gtk2_ardour/pixmaps $Resources
472 cp ../../gtk2_ardour/dark.colors $Resources
473 cp -R ../../gtk2_ardour/splash.png $Shared
474 cp -R ../../gtk2_ardour/small-splash.png $Shared
475 cp -R ../../gtk2_ardour/ArdourMono.ttf $Shared
477 # go through and recursively remove any .svn dirs in the bundle
478 for svndir in `find $APPDIR -name .svn -type dir`; do
482 # install bundled LV2s to <app>/Contents/lib/LV2/
483 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
485 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
486 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
487 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
488 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
489 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
493 # now fix up the executables
494 echo "Fixing up executable dependency names ..."
495 executables=$MAIN_EXECUTABLE
496 if test x$SAE != x ; then
497 executables="$executables"
500 for exe in $executables; do
501 EXE=$APPROOT/MacOS/$exe
503 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
505 changes="$changes -change $lib @executable_path/../lib/$base"
507 if test "x$changes" != "x" ; then
508 install_name_tool $changes $EXE
512 echo "Fixing up library names ..."
513 # now do the same for all the libraries we include
514 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends ; do
516 libbase=`basename $libdir`
518 for dylib in $libdir/*.dylib $libdir/*.so ; do
522 if test -L $dylib ; then
526 # change all the dependencies
529 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
531 if echo $lib | grep -s libbase; then
532 changes="$changes -change $lib @executable_path/../$libbase/$base"
534 changes="$changes -change $lib @executable_path/../lib/$base"
538 if test "x$changes" != x ; then
539 if install_name_tool $changes $dylib ; then
546 # now the change what the library thinks its own name is
548 base=`basename $dylib`
549 install_name_tool -id @executable_path/../$libbase/$base $dylib
554 # and now ... the DMG
557 rm -rf $PRODUCT_PKG_DIR
558 mkdir $PRODUCT_PKG_DIR
563 if [ x$SAE != x ] ; then
567 echo "Creating SAE packaging directory"
568 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
569 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
570 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
571 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
573 elif [ x$MIXBUS != x ] ; then
577 echo "Creating Mixbus packaging directory"
578 mv $APPDIR $PRODUCT_PKG_DIR/
579 DMGBACKGROUND=dmgbgMB
582 echo "Creating $APPNAME packaging directory"
583 mv $APPDIR $PRODUCT_PKG_DIR/
587 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
590 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
598 if test x$WITH_HARRISON_LV2 != x ; then
599 curl -s -S --fail -# \
600 -z "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
601 -o "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip" \
602 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_lv2s.${OSX_BENSID}.zip"
604 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
605 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
606 "${CACHEDIR}/harrison_lv2s.${OSX_BENSID}.zip"
609 if test x$WITH_HARVID != x ; then
610 echo "installing video tools.."
611 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
612 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
614 echo "copying harvid and xjadeo ..."
617 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
618 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
621 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
622 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
625 -C $PRODUCT_PKG_DIR/$APPROOT \
626 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
628 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
629 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
630 hdiutil detach "${JADEO}"
632 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
633 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
635 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
636 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
637 mv ${file}.thin ${file}
641 YPOS=$[ $DMGWINBOTTOM - 300 ]
642 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
644 DMGBACKGROUND=${DMGBACKGROUND}xj
647 ################################################################################
648 ### Mixbus plugins, etc
649 if test x$WITH_X42_LV2 != x ; then
650 echo "bundling x42 plugins"
651 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
653 METERS_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-meters.latest.txt)
654 rsync -a -q --partial \
655 rsync://x42-plugins.com/x42/osx/x42-meters-lv2-osx-${METERS_VERSION}.zip \
656 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
657 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
658 "$CACHEDIR/x42-meters-lv2-osx-${METERS_VERSION}.zip"
660 EQ_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-eq.latest.txt)
661 rsync -a -q --partial \
662 rsync://x42-plugins.com/x42/osx/x42-eq-lv2-osx-${EQ_VERSION}.zip \
663 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
664 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
665 "$CACHEDIR/x42-eq-lv2-osx-${EQ_VERSION}.zip"
667 SETBFREE_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/setBfree.latest.txt)
668 rsync -a -q --partial \
669 rsync://x42-plugins.com/x42/osx/setBfree-lv2-osx-${SETBFREE_VERSION}.zip \
670 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
671 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
672 "$CACHEDIR/setBfree-lv2-osx-${SETBFREE_VERSION}.zip"
674 MIDIFILTER_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/x42-midifilter.latest.txt)
675 rsync -a -q --partial \
676 rsync://x42-plugins.com/x42/osx/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip \
677 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
678 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
679 "$CACHEDIR/x42-midifilter-lv2-osx-${MIDIFILTER_VERSION}.zip"
681 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
682 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
683 mv ${file}.thin ${file}
687 if test -n "$MIXBUS"; then
688 echo "deploying harrison tools for $OSX_BENSID"
690 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
692 curl -s -S --fail -# \
693 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
694 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
695 "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
697 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
698 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
700 ################################################################################
702 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
704 echo "Building DMG ..."
706 # UC_DMG=$APPNAME-${release_version}-UC.dmg
707 # FINAL_DMG=$APPNAME-${release_version}.dmg
709 if [ x$DEBUG = xT ]; then
710 UC_DMG=$APPNAME-$release_version-dbg.dmg
712 UC_DMG=$APPNAME-$release_version.dmg
714 VOLNAME=$APPNAME-$release_version
716 MNTPATH=`mktemp -d -t ardourimg`
717 TMPDMG=`mktemp -t ardour`
718 ICNSTMP=`mktemp -t ardouricon`
720 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
722 echo "DMG MB = " $DMGMEGABYTES
724 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
728 TMPDMG="${TMPDMG}.dmg"
730 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
732 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
733 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
734 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
736 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
737 mkdir "${MNTPATH}/.background"
738 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
740 echo "setting DMG background ..."
742 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
746 # OSX 10.9.X and later
747 DISKNAME=`basename "${MNTPATH}"`
751 tell application "Finder"
753 tell disk "${DISKNAME}"
756 set current view of container window to icon view
757 set toolbar visible of container window to false
758 set statusbar visible of container window to false
759 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
760 set theViewOptions to the icon view options of container window
761 set arrangement of theViewOptions to not arranged
762 set icon size of theViewOptions to 64
763 set background picture of theViewOptions to file ".background:dmgbg.png"
764 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
765 set position of item "${APPDIR}" of container window to {90, 100}
766 set position of item "Applications" of container window to {310, 100}
772 update without registering applications
779 chmod -Rf go-w "${MNTPATH}"
783 echo "compressing Image ..."
785 # Umount the image ('eject' above may already have done that)
786 umount "${DiskDevice}" || true
787 hdiutil eject "${DiskDevice}" || true
788 # Create a read-only version, use zlib compression
789 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
791 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
792 echo "setting file icon ..."
794 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
795 sips -i ${ICNSTMP}.icns
796 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
797 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
798 SetFile -a C "$UC_DMG"
800 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
803 rm -rf ${PRODUCT_PKG_DIR}
806 echo "packaging suceeded."