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 Surfaces=$Frameworks/surfaces
139 Panners=$Frameworks/panners
140 Backends=$Frameworks/backends
141 MidiMaps=$Shared/midi_maps
142 PluginMetadata=$Shared/plugin_metadata
143 MixerSettings=$Shared/mixer_settings
144 ExportFormats=$Shared/export
145 Templates=$Shared/templates
146 PatchFiles=$Shared/patchfiles
147 LuaScripts=$Shared/scripts
148 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/* ; 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
180 mkdir -p $ExportFormats
181 mkdir -p $Frameworks/modules
183 mkdir -p $MackieControl
191 EXECUTABLE=${BUNDLENAME}
194 # if we're not going to bundle JACK, make sure we can find
195 # 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@?$BUNDLENAME?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$MIXBUS32C != x ; then
244 cp Mixbus32C.icns $Resources/appIcon.icns
245 elif test x$MIXBUS != x ; then
246 cp Mixbus.icns $Resources/appIcon.icns
248 cp Ardour.icns $Resources/appIcon.icns
250 cp typeArdour.icns $Resources/
252 set +e # things below are not error-free (optional files etc) :(
255 if test x$WITH_NLS != x ; then
256 echo "NLS support ..."
257 echo "I hope you remembered to run waf i18n"
260 for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
261 files=`find ../../$pkg -name "*.mo"`
264 # the package name is appended with a number so that
265 # it can be parallel installed during a regular install
266 # with older (and newer) versions. it is just the major
267 # number of the release (i.e. leading digits)
270 vsuffix=`echo $release_version | sed 's/^\([0-9][0-9]*\).*/\1/'`
272 if [ -z "$files" ]; then
274 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
281 lang=`basename $file | sed 's/\.mo//'`
282 mkdir -p $Locale/$lang/LC_MESSAGES
283 cp $file $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
284 echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
285 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
288 LINGUAS="$LINGUAS $lang"
295 if [ -d $GTKSTACK_ROOT/share/locale/$l ] ; then
296 echo "Copying GTK i18n files for $l..."
297 cp -r $GTKSTACK_ROOT/share/locale/$l $Locale
299 # try with just the language spec
300 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
301 if [ -d $GTKSTACK_ROOT/share/locale/$just_lang ] ; then
302 echo "Copying GTK i18n files for $l..."
303 cp -r $GTKSTACK_ROOT/share/locale/$just_lang $Locale
308 echo "Skipping NLS support"
312 # Copy stuff that may be dynamically loaded
315 cp -R $GTKSTACK_ROOT/etc/* $Etc
316 cp -R $GTKSTACK_ROOT/lib/charset.alias $Resources
318 # We rely on clearlooks, so include a version from our own build tree
319 # this one is special - we will set GTK_PATH to $Frameworks/gtkengines
321 GTK_ENGINE_DIR=$Frameworks/gtkengines/engines
322 mkdir -p $GTK_ENGINE_DIR
324 echo "Copying GTK engines ..."
325 cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.dylib $Frameworks
326 (cd $GTK_ENGINE_DIR && ln -s ../../libclearlooks.dylib . && ln -s ../../libclearlooks.dylib libclearlooks.so)
328 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Frameworks
329 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so)
332 # Control Surface shared libraries
333 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.dylib $Surfaces
334 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp*.dylib $Frameworks
337 cp $BUILD_ROOT/libs/panners/*/lib*.dylib $Panners
340 for backend in jack wavesaudio dummy coreaudio; do
341 cp $BUILD_ROOT/libs/backends/$backend/lib*.dylib $Backends
344 # Export Formats/Presets
345 for f in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
346 cp "$f" $ExportFormats ;
350 cp -av $BUILD_ROOT/../templates $Templates
353 cp -av $BUILD_ROOT/../plugin_metadata $PluginMetadata
356 # got to be careful with names here
357 for x in $BUILD_ROOT/../midi_maps/*.map ; do
362 # got to be careful with names here
363 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
368 # got to be careful with names here
369 for x in $BUILD_ROOT/../scripts/*.lua ; do
371 if test "${BN:0:1}" = "_"; then
378 # got to be careful with names here
379 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
380 cp "$x" $MackieControl
384 # got to be careful with names here
385 for x in $BUILD_ROOT/../osc/*.preset ; do
389 # Mixbus MixerSettings (if any)
390 for x in $BUILD_ROOT/../mixer_settings/*.lua ; do
391 mkdir -p $MixerSettings # create on demand
392 cp "$x" $MixerSettings
395 # VAMP plugins that we use
396 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.dylib $Frameworks
398 # Suil modules (new dir 'build-stack')
399 if test -d $GTKSTACK_ROOT/lib/suil-0/ ; then
400 cp $GTKSTACK_ROOT/lib/suil-0/lib* $Frameworks
403 # Suil modules (old dir 'build-ardour-stack')
404 if test -d $ARDOURSTACK_ROOT/lib/suil-0/ ; then
405 cp $ARDOURSTACK_ROOT/lib/suil-0/lib* $Frameworks
408 # VST scanner app and wrapper script, if they exist
409 if test -d $BUILD_ROOT/libs/fst ; then
410 cp $BUILD_ROOT/libs/fst/ardour-vst-scanner* $Frameworks/
414 if test -f $BUILD_ROOT/libs/vfork/ardour-exec-wrapper ; then
415 mkdir -p $Frameworks/vfork
416 cp $BUILD_ROOT/libs/vfork/ardour-exec-wrapper $Frameworks/
420 HAVE_SESSION_UTILS=false
421 for file in $BUILD_ROOT/session_utils/${lower_case_appname}${major_version}-*; do
423 cp -v $file $Frameworks/
424 if test x$STRIP = xall ; then
425 strip -s $Frameworks/${BN}
427 ln -s ../lib/ardour-util.sh ${APPROOT}/MacOS/${BN}
428 HAVE_SESSION_UTILS=true
431 # dynamically loaded NSS/SSL libs
432 nsslibs="libsoftokn3.dylib libnsspem.dylib libnssckbi.dylib libfreebl3.dylib libnssdbm3.dylib libplds4.dylib"
433 for nsslib in $nsslibs; do
434 cp $GTKSTACK_ROOT/lib/$nsslib $Frameworks/ || true
437 # TODO check if this is still needed, even when building on 10.5
438 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
439 STDCPP='|libstdc\+\+'
446 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib ; do
447 if ! file $file | grep -qs Mach-O ; then
450 # libffi contains "S" (other section symbols) that should not be stripped.
451 if [[ $file == *"libffi"* ]] ; then
455 if test x$STRIP != x ; then
456 strip -u -r -arch all $file &>/dev/null
459 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
461 for dep in $deps ; do
463 if ! test -f $Frameworks/$base; then
464 if echo $dep | grep -sq '^libs' ; then
465 cp $BUILD_ROOT/$dep $Frameworks
473 if test x$missing = xfalse ; then
474 # everything has been found
480 echo "Copying other stuff to $APPDIR ..."
482 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
483 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
484 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
485 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
487 # Copied directly from source tree
489 mkdir ${Resources}/icons
490 mkdir ${Resources}/resources
491 cp ../../system_config $Resources/system_config
492 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
493 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
494 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
495 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
498 # Themes: only install those named for this app
499 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
501 # go through and recursively remove any .svn dirs in the bundle
502 for svndir in `find $APPDIR -name .svn -type dir`; do
506 # session utils start script
507 if test "$HAVE_SESSION_UTILS" = true ; then
508 cat >> $Frameworks/ardour-util.sh << EOF
511 BIN_DIR=\$(dirname "\$0")
512 BUNDLE_DIR=\$(dirname "\$BIN_DIR")
514 export ARDOUR_DATA_PATH="\$BUNDLE_DIR/share"
515 export ARDOUR_CONFIG_PATH="\$BUNDLE_DIR/etc"
516 export ARDOUR_DLL_PATH="\$BUNDLE_DIR/lib"
517 export VAMP_PATH="\$BUNDLE_DIR/lib"\${VAMP_PATH:+:\$VAMP_PATH}
519 SELF=\$(basename "\$0")
520 exec "\$BUNDLE_DIR/lib/\$SELF" "\$@"
522 chmod +x $Frameworks/ardour-util.sh
526 # install bundled LV2s to <app>/Contents/lib/LV2/
527 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
529 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
530 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
531 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
532 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
533 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
537 # now fix up the executables
538 echo "Fixing up executable dependency names ..."
539 executables=$MAIN_EXECUTABLE
540 if test x$SAE != x ; then
541 executables="$executables"
543 if test "$HAVE_SESSION_UTILS" = true ; then
544 for file in $Frameworks/${lower_case_appname}${major_version}-*; do
546 executables="$executables ../lib/${BN}"
550 if test -f "$Frameworks/ardour-vst-scanner"; then
551 executables="$executables ../lib/ardour-vst-scanner"
554 for exe in $executables; do
555 echo "Processing Executable: $exe"
556 EXE=$APPROOT/MacOS/$exe
558 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
560 changes="$changes -change $lib @executable_path/../lib/$base"
562 if test "x$changes" != "x" ; then
563 install_name_tool $changes $EXE
567 echo "Fixing up library names ..."
568 # now do the same for all the libraries we include
569 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends $Frameworks/LV2/* ; do
571 libbase=`basename $libdir`
573 for dylib in $libdir/*.dylib $libdir/*.so ; do
577 if test -L $dylib ; then
581 # change all the dependencies
584 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
586 if echo $lib | grep -s libbase; then
587 changes="$changes -change $lib @executable_path/../$libbase/$base"
589 changes="$changes -change $lib @executable_path/../lib/$base"
593 if test "x$changes" != x ; then
594 if install_name_tool $changes $dylib ; then
601 # now the change what the library thinks its own name is
603 base=`basename $dylib`
604 install_name_tool -id @executable_path/../$libbase/$base $dylib
609 # and now ... the DMG
612 rm -rf $PRODUCT_PKG_DIR
613 mkdir $PRODUCT_PKG_DIR
618 if [ x$SAE != x ] ; then
622 echo "Creating SAE packaging directory"
623 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
624 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
625 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
626 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
628 elif [ x$MIXBUS != x ] ; then
632 echo "Creating Mixbus packaging directory"
633 mv $APPDIR $PRODUCT_PKG_DIR/
634 DMGBACKGROUND=dmgbgMB
637 echo "Creating $APPNAME packaging directory"
638 mv $APPDIR $PRODUCT_PKG_DIR/
642 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
645 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
653 if test x$WITH_HARRISON_LV2 != x ; then
654 curl -s -S --fail -# \
655 -z "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
656 -o "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
657 "${HARRISONDSPURL}/${HARRISONLV2}.${OSX_BENSID}.zip"
659 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
660 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
661 "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip"
664 if test x$WITH_HARVID != x ; then
665 echo "installing video tools.."
666 if test $OSX_ARCH = ppc; then
668 HARVID_VERSION=v0.8.2
669 XJADEO_VERSION=v0.8.8
671 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
672 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
675 echo "copying harvid and xjadeo ..."
678 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
679 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
682 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
683 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
686 -C $PRODUCT_PKG_DIR/$APPROOT \
687 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
689 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
690 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
691 hdiutil detach "${JADEO}"
693 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
694 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
696 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
697 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
698 mv ${file}.thin ${file}
702 YPOS=$[ $DMGWINBOTTOM - 300 ]
703 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
705 DMGBACKGROUND=${DMGBACKGROUND}xj
708 ################################################################################
709 ### Mixbus plugins, etc
711 echo "Bundling General MIDI Synth LV2"
712 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
714 for proj in x42-gmsynth; do
715 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
716 rsync -a -q --partial \
717 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
718 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
719 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
720 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
723 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
724 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
725 mv ${file}.thin ${file}
730 if test x$WITH_X42_LV2 != x ; then
731 echo "bundling x42 plugins"
732 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
734 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums x42-whirl x42-limiter; do
735 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
736 rsync -a -q --partial \
737 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
738 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
739 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
740 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
743 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
744 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
745 mv ${file}.thin ${file}
749 if test -n "$MIXBUS"; then
750 echo "deploying harrison channelstrip for $OSX_BENSID"
752 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
754 curl -s -S --fail -# \
755 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
756 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
757 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
759 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
760 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
762 echo "deploying harrison vamp plugins for $OSX_BENSID"
764 curl -s -S --fail -# \
765 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
766 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
767 "${HARRISONDSPURL}/harrison_vamp.${OSX_BENSID}.dylib"
769 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
770 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
773 ################################################################################
775 if test x$DEMO_SESSION_URL != x ; then
776 mkdir -p $Shared/sessions
777 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
778 for demo in $DEMO_SESSIONS; do
779 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
783 ################################################################################
785 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
787 echo "Building DMG ..."
789 # UC_DMG=$APPNAME-${release_version}-UC.dmg
790 # FINAL_DMG=$APPNAME-${release_version}.dmg
792 if [ x$DEBUG = xT ]; then
793 UC_DMG=$APPNAME-$release_version-dbg.dmg
795 UC_DMG=$APPNAME-$release_version.dmg
797 VOLNAME=$APPNAME-$release_version
799 MNTPATH=`mktemp -d -t ardourimg`
800 TMPDMG=`mktemp -t ardour`
801 ICNSTMP=`mktemp -t ardouricon`
803 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
805 echo "DMG MB = " $DMGMEGABYTES
807 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
811 TMPDMG="${TMPDMG}.dmg"
813 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
815 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
816 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
817 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
819 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
820 mkdir "${MNTPATH}/.background"
821 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
823 echo "setting DMG background ..."
825 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
829 # OSX 10.9.X and later
830 DISKNAME=`basename "${MNTPATH}"`
834 tell application "Finder"
836 tell disk "${DISKNAME}"
839 set current view of container window to icon view
840 set toolbar visible of container window to false
841 set statusbar visible of container window to false
842 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
843 set theViewOptions to the icon view options of container window
844 set arrangement of theViewOptions to not arranged
845 set icon size of theViewOptions to 64
846 set background picture of theViewOptions to file ".background:dmgbg.png"
847 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
848 set position of item "${APPDIR}" of container window to {90, 100}
849 set position of item "Applications" of container window to {310, 100}
855 update without registering applications
857 set position of item "${APPDIR}" of container window to {90, 100}
858 set position of item "Applications" of container window to {310, 100}
864 update without registering applications
871 chmod -Rf go-w "${MNTPATH}"
875 echo "compressing Image ..."
877 # Umount the image ('eject' above may already have done that)
878 umount "${DiskDevice}" || true
879 hdiutil eject "${DiskDevice}" || true
880 # Create a read-only version, use zlib compression
881 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
883 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
884 echo "setting file icon ..."
886 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
887 sips -i ${ICNSTMP}.icns
888 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
889 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
890 SetFile -a C "$UC_DMG"
892 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
895 rm -rf ${PRODUCT_PKG_DIR}
898 echo "packaging suceeded."