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 if test -x $BUILD_ROOT/tools/luadevel/luasession; then
432 BN=${lower_case_appname}${major_version}-lua
433 cp -v $BUILD_ROOT/tools/luadevel/luasession $Frameworks/$BN
434 if test x$STRIP = xall ; then
435 strip -s $Frameworks/${BN}
437 ln -s ../lib/ardour-util.sh ${APPROOT}/MacOS/${BN}
438 HAVE_SESSION_UTILS=true
441 # dynamically loaded NSS/SSL libs
442 nsslibs="libsoftokn3.dylib libnsspem.dylib libnssckbi.dylib libfreebl3.dylib libnssdbm3.dylib libplds4.dylib"
443 for nsslib in $nsslibs; do
444 cp $GTKSTACK_ROOT/lib/$nsslib $Frameworks/ || true
447 # TODO check if this is still needed, even when building on 10.5
448 if file $BUILD_ROOT/gtk2_ardour/ardour-$release_version | grep -q ppc; then
449 STDCPP='|libstdc\+\+'
456 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Panners/*.dylib $Backends/*.dylib $Surfaces/*.dylib ; do
457 if ! file $file | grep -qs Mach-O ; then
460 # libffi contains "S" (other section symbols) that should not be stripped.
461 if [[ $file == *"libffi"* ]] ; then
465 if test x$STRIP != x ; then
466 strip -u -r -arch all $file &>/dev/null
469 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
471 for dep in $deps ; do
473 if ! test -f $Frameworks/$base; then
474 if echo $dep | grep -sq '^libs' ; then
475 cp $BUILD_ROOT/$dep $Frameworks
480 chmod 755 $Frameworks/$base
484 if test x$missing = xfalse ; then
485 # everything has been found
491 echo "Copying other stuff to $APPDIR ..."
493 cp $BUILD_ROOT/gtk2_ardour/ardour.keys $Resources
494 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Resources
495 cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Resources
496 cp $BUILD_ROOT/gtk2_ardour/clearlooks.rc $Resources
498 # Copied directly from source tree
500 mkdir ${Resources}/icons
501 mkdir ${Resources}/resources
502 cp ../../system_config $Resources/system_config
503 cp ../../gtk2_ardour/icons/*.png ${Resources}/icons/
504 cp -r ../../gtk2_ardour/icons/cursor_* ${Resources}/icons/
505 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
506 cp ../../gtk2_ardour/resources/${PRODUCT_PKG_DIR}-* ${Resources}/resources/
509 # Themes: only install those named for this app
510 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
512 # go through and recursively remove any .svn dirs in the bundle
513 for svndir in `find $APPDIR -name .svn -type dir`; do
517 # session utils start script
518 if test "$HAVE_SESSION_UTILS" = true ; then
519 cat >> $Frameworks/ardour-util.sh << EOF
522 BIN_DIR=\$(dirname "\$0")
523 BUNDLE_DIR=\$(dirname "\$BIN_DIR")
525 export ARDOUR_DATA_PATH="\$BUNDLE_DIR/share"
526 export ARDOUR_CONFIG_PATH="\$BUNDLE_DIR/etc"
527 export ARDOUR_DLL_PATH="\$BUNDLE_DIR/lib"
528 export VAMP_PATH="\$BUNDLE_DIR/lib"\${VAMP_PATH:+:\$VAMP_PATH}
530 SELF=\$(basename "\$0")
531 exec "\$BUNDLE_DIR/lib/\$SELF" "\$@"
533 chmod +x $Frameworks/ardour-util.sh
537 # install bundled LV2s to <app>/Contents/lib/LV2/
538 cp -R $BUILD_ROOT/libs/LV2 $Frameworks/
540 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
541 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
542 cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
543 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
544 cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $Frameworks/LV2/
548 # now fix up the executables
549 echo "Fixing up executable dependency names ..."
550 executables=$MAIN_EXECUTABLE
551 if test x$SAE != x ; then
552 executables="$executables"
554 if test "$HAVE_SESSION_UTILS" = true ; then
555 for file in $Frameworks/${lower_case_appname}${major_version}-*; do
557 executables="$executables ../lib/${BN}"
561 if test -f "$Frameworks/ardour-vst-scanner"; then
562 executables="$executables ../lib/ardour-vst-scanner"
565 for exe in $executables; do
566 echo "Processing Executable: $exe"
567 EXE=$APPROOT/MacOS/$exe
569 for lib in `otool -L $EXE | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
571 changes="$changes -change $lib @executable_path/../lib/$base"
573 if test "x$changes" != "x" ; then
574 install_name_tool $changes $EXE
578 echo "Fixing up library names ..."
579 # now do the same for all the libraries we include
580 for libdir in $Frameworks $Frameworks/modules $Surfaces $Panners $Backends $Frameworks/LV2/* ; do
582 libbase=`basename $libdir`
584 for dylib in $libdir/*.dylib $libdir/*.so ; do
588 if test -L $dylib ; then
592 # change all the dependencies
595 for lib in `otool -L $dylib | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | awk '{print $1}' | grep -v 'libjack\.'` ; do
597 if echo $lib | grep -s libbase; then
598 changes="$changes -change $lib @executable_path/../$libbase/$base"
600 changes="$changes -change $lib @executable_path/../lib/$base"
604 if test "x$changes" != x ; then
605 if install_name_tool $changes $dylib ; then
612 # now the change what the library thinks its own name is
614 base=`basename $dylib`
615 install_name_tool -id @executable_path/../$libbase/$base $dylib
620 # and now ... the DMG
623 rm -rf $PRODUCT_PKG_DIR
624 mkdir $PRODUCT_PKG_DIR
629 if [ x$SAE != x ] ; then
633 echo "Creating SAE packaging directory"
634 mv $APPDIR $PRODUCT_PKG_DIR/Ardour3-SAE.app
635 cp HowToInstallArdourSAE.pdf "$PRODUCT_PKG_DIR/How To Install Ardour SAE.pdf"
636 cp SAE-de-keypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts (keypad).pdf"
637 cp SAE-de-nokeypad.pdf "$PRODUCT_PKG_DIR/Ardour SAE Shortcuts.pdf"
639 elif [ x$MIXBUS != x ] ; then
643 echo "Creating Mixbus packaging directory"
644 mv $APPDIR $PRODUCT_PKG_DIR/
645 DMGBACKGROUND=dmgbgMB
648 echo "Creating $APPNAME packaging directory"
649 mv $APPDIR $PRODUCT_PKG_DIR/
653 if file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q x86_64; then
656 elif file ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/$MAIN_EXECUTABLE | grep -q ppc; then
664 if test x$WITH_HARRISON_LV2 != x ; then
665 curl -s -S --fail -# \
666 -z "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
667 -o "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip" \
668 "${HARRISONDSPURL}/${HARRISONLV2}.${OSX_BENSID}.zip"
670 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
671 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
672 "${CACHEDIR}/${HARRISONLV2}.${OSX_BENSID}.zip"
675 if test x$WITH_HARVID != x ; then
676 echo "installing video tools.."
677 if test $OSX_ARCH = ppc; then
679 HARVID_VERSION=v0.8.2
680 XJADEO_VERSION=v0.8.8
682 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
683 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
686 echo "copying harvid and xjadeo ..."
689 rsync://ardour.org/video-tools/harvid-osx-${HARVID_VERSION}.tgz \
690 "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz"
693 rsync://ardour.org/video-tools/jadeo-${XJADEO_VERSION:1}.dmg \
694 "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg"
697 -C $PRODUCT_PKG_DIR/$APPROOT \
698 -f "$CACHEDIR/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz" || exit 1
700 JADEO=$(hdiutil attach "$CACHEDIR/jadeo-${XJADEO_VERSION:1}.dmg" | grep Apple_HFS | grep dev/ | cut -f 3)
701 cp -r "${JADEO}/Jadeo.app" "$PRODUCT_PKG_DIR/"
702 hdiutil detach "${JADEO}"
704 XJCONTENT=${PRODUCT_PKG_DIR}/Jadeo.app/Contents
705 HVLIBS=${PRODUCT_PKG_DIR}/$APPROOT/lib/harvid
707 for file in ${XJCONTENT}/MacOS/Jadeo-bin ${XJCONTENT}/Frameworks/*.dylib ${HVLIBS}/*.dylib ${PRODUCT_PKG_DIR}/$APPROOT/MacOS/*harvid* ; do
708 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin && \
709 mv ${file}.thin ${file}
713 YPOS=$[ $DMGWINBOTTOM - 300 ]
714 XJADEOPOS="set position of item \"Jadeo.app\" of container window to {310, ${YPOS}}"
716 DMGBACKGROUND=${DMGBACKGROUND}xj
719 ################################################################################
720 ### Mixbus plugins, etc
722 echo "Bundling General MIDI Synth LV2"
723 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
725 for proj in x42-gmsynth; do
726 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
727 rsync -a -q --partial \
728 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
729 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
730 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
731 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
734 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
735 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
736 mv ${file}.thin ${file}
741 if test x$WITH_X42_LV2 != x ; then
742 echo "bundling x42 plugins"
743 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2"
745 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums x42-whirl x42-limiter; do
746 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/osx/${proj}.latest.txt)
747 rsync -a -q --partial \
748 rsync://x42-plugins.com/x42/osx/${proj}-lv2-osx-${X42_VERSION}.zip \
749 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
750 bsdtar -C "${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/" -xf \
751 "$CACHEDIR/${proj}-lv2-osx-${X42_VERSION}.zip"
754 for file in ${PRODUCT_PKG_DIR}/${APPROOT}/lib/LV2/*/*.dylib ; do
755 lipo -extract_family ${OSX_ARCH} ${file} -output ${file}.thin
756 mv ${file}.thin ${file}
760 if test -n "$MIXBUS"; then
761 echo "deploying harrison channelstrip for $OSX_BENSID"
763 mkdir -p "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip"
765 curl -s -S --fail -# \
766 -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
767 -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
768 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so"
770 cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${OSX_BENSID}.so" \
771 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/ladspa/strip/${HARRISONCHANNELSTRIP}.so"
773 echo "deploying harrison vamp plugins for $OSX_BENSID"
775 curl -s -S --fail -# \
776 -z "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
777 -o "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
778 "${HARRISONDSPURL}/harrison_vamp.${OSX_BENSID}.dylib"
780 cp "${CACHEDIR}/harrison_vamp.${OSX_BENSID}.dylib" \
781 "${PRODUCT_PKG_DIR}/${APPROOT}/lib/harrison_vamp.dylib"
784 ################################################################################
786 if test x$DEMO_SESSION_URL != x ; then
787 mkdir -p $Shared/sessions
788 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
789 for demo in $DEMO_SESSIONS; do
790 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
794 ################################################################################
796 ( cd $PRODUCT_PKG_DIR ; find . ) > file_list.txt
798 echo "Building DMG ..."
800 # UC_DMG=$APPNAME-${release_version}-UC.dmg
801 # FINAL_DMG=$APPNAME-${release_version}.dmg
803 if [ x$DEBUG = xT ]; then
804 UC_DMG=$APPNAME-$release_version-dbg.dmg
806 UC_DMG=$APPNAME-$release_version.dmg
808 VOLNAME=$APPNAME-$release_version
810 MNTPATH=`mktemp -d -t ardourimg`
811 TMPDMG=`mktemp -t ardour`
812 ICNSTMP=`mktemp -t ardouricon`
814 DMGMEGABYTES=$[ `du -sk "$PRODUCT_PKG_DIR" | cut -f 1` * 1024 / 1048576 + $EXTRA_SPACE_MB ]
816 echo "DMG MB = " $DMGMEGABYTES
818 rm -f $UC_DMG "$TMPDMG" "${TMPDMG}.dmg" "$ICNSTMP"
822 TMPDMG="${TMPDMG}.dmg"
824 trap "rm -rf $MNTPATH $TMPDMG ${TMPDMG}.dmg $ICNSTMP" EXIT
826 hdiutil create -megabytes $DMGMEGABYTES -fs HFS+ -volname "${VOLNAME}" "$TMPDMG"
827 DiskDevice=$(hdid -nomount "$TMPDMG" | grep Apple_HFS | cut -f 1 -d ' ')
828 mount -t hfs -o nobrowse "${DiskDevice}" "${MNTPATH}"
830 cp -r ${PRODUCT_PKG_DIR}/* "${MNTPATH}" || exit
831 mkdir "${MNTPATH}/.background"
832 cp -vi ${DMGBACKGROUND}.png "${MNTPATH}/.background/dmgbg.png"
834 echo "setting DMG background ..."
836 if test $(sw_vers -productVersion | cut -d '.' -f 2) -lt 9; then
840 # OSX 10.9.X and later
841 DISKNAME=`basename "${MNTPATH}"`
845 tell application "Finder"
847 tell disk "${DISKNAME}"
850 set current view of container window to icon view
851 set toolbar visible of container window to false
852 set statusbar visible of container window to false
853 set the bounds of container window to {400, 200, 800, ${DMGWINBOTTOM}}
854 set theViewOptions to the icon view options of container window
855 set arrangement of theViewOptions to not arranged
856 set icon size of theViewOptions to 64
857 set background picture of theViewOptions to file ".background:dmgbg.png"
858 make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
859 set position of item "${APPDIR}" of container window to {90, 100}
860 set position of item "Applications" of container window to {310, 100}
866 update without registering applications
868 set position of item "${APPDIR}" of container window to {90, 100}
869 set position of item "Applications" of container window to {310, 100}
875 update without registering applications
882 chmod -Rf go-w "${MNTPATH}"
886 echo "compressing Image ..."
888 # Umount the image ('eject' above may already have done that)
889 umount "${DiskDevice}" || true
890 hdiutil eject "${DiskDevice}" || true
891 # Create a read-only version, use zlib compression
892 hdiutil convert -format UDZO "${TMPDMG}" -imagekey zlib-level=9 -o "${UC_DMG}"
894 if test $(sw_vers -productVersion | cut -d '.' -f 2) -gt 5; then
895 echo "setting file icon ..."
897 cp ${PRODUCT_PKG_DIR}/$Resources/appIcon.icns ${ICNSTMP}.icns
898 sips -i ${ICNSTMP}.icns
899 DeRez -only icns ${ICNSTMP}.icns > ${ICNSTMP}.rsrc
900 Rez -append ${ICNSTMP}.rsrc -o "$UC_DMG"
901 SetFile -a C "$UC_DMG"
903 rm ${ICNSTMP}.icns ${ICNSTMP}.rsrc
906 rm -rf ${PRODUCT_PKG_DIR}
909 echo "packaging suceeded."