3 # script for pulling together a MacOSX app bundle.
5 GTKQUARTZ_ROOT=/opt/gtk
11 while [ $# -gt 0 ] ; do
14 --sae) SAE=1 ; shift ;;
15 --nojack) WITH_JACK= ; shift ;;
16 --noladpsa) WITH_LADSPA= ; shift ;;
20 version=`grep -m 1 '^ardour_version' ../../SConstruct | cut -d' ' -f 3 | sed "s/'//g"`
21 echo "Version is $version"
23 # setup directory structure
25 APPROOT=Ardour2.app/Contents
26 Frameworks=$APPROOT/Frameworks
27 Resources=$APPROOT/Resources
28 Plugins=$APPROOT/Plugins
29 Shared=$Resources/share
32 echo "Removing old Ardour2.app tree ..."
36 echo "Building new app directory structure ..."
38 # only bother to make the longest paths
40 mkdir -p $APPROOT/MacOS
41 mkdir -p $APPROOT/Resources
42 mkdir -p $APPROOT/Plugins
43 mkdir -p $Frameworks/modules
44 mkdir -p $Shared/templates
49 if test x$SAE != x ; then
50 env="$env<key>ARDOUR_SAE</key><string>true</string>"
53 if test x$WITH_JACK != x ; then
54 env="$env<key>ARDOUR_WITH_JACK</key><string>true</string>"
57 env="<key>LSEnvironment</key><dict><key>ARDOUR_BUNDLED</key><string>true</string>$env</dict>"
60 sed -e "s?@ENV@?$env?g" -e "s?@VERSION@?$version?g" < Info.plist.in > Info.plist
64 cp Info.plist $APPROOT
65 cp -R Resources $APPROOT
67 echo "Copying ardour executable ...."
68 cp ../../gtk2_ardour/ardour-$version $APPROOT/MacOS/Ardour2
69 strip $APPROOT/MacOS/Ardour2
70 if test x$WITH_JACK != x ; then
71 cp /usr/local/lib/jack/jack_coreaudio.so $Frameworks
72 cp /usr/local/bin/jackd $APPROOT/MacOS
75 cp -R $GTKQUARTZ_ROOT/etc/* $Etc
76 echo "Copying all Pango modules ..."
77 cp -R $GTKQUARTZ_ROOT/lib/pango/1.6.0/modules/*.so $Frameworks/modules
78 echo "Copying all GDK Pixbuf loaders ..."
79 cp -R $GTKQUARTZ_ROOT/lib/gtk-2.0/2.10.0/loaders/*.so $Frameworks/modules
81 cp -R $GTKQUARTZ_ROOT/lib/charset.alias $Resources
85 if test x$WITH_LADSPA != x ; then
86 echo "Copying `ls ladspa | wc -l` plugins ..."
87 cp -r ladspa/* $Plugins
90 # generate new Pango module file
93 ModulesPath=$GTKQUARTZ_ROOT/lib/pango/1.6.0/modules
95 env PANGO_RC_FILE=pangorc $GTKQUARTZ_ROOT/bin/pango-querymodules | sed "s?$GTKQUARTZ_ROOT/lib/pango/1.6.0/modules/?@executable_path/../Frameworks/modules/?" > $Resources/pango.modules
98 # generate a new GDK pixbufs loaders file
99 sed "s?$GTKQUARTZ_ROOT/lib/gtk-2.0/2.10.0/loaders/?@executable_path/../Frameworks/modules/?" < $GTKQUARTZ_ROOT/etc/gtk-2.0/gdk-pixbuf.loaders > $Resources/gdk-pixbuf.loaders
101 # this one is special - we will set GTK_PATH to $Frameworks/clearlooks
102 cp ../../libs/clearlooks/libclearlooks.dylib $Frameworks
103 mkdir -p $Frameworks/clearlooks/engines
104 (cd $Frameworks/clearlooks/engines && ln -s ../../libclearlooks.dylib libclearlooks.dylib && ln -s ../../libclearlooks.dylib libclearlooks.so)
106 # XXX STILL NEED TO DO SURFACES AND PANNERS
108 cp ../../libs/surfaces/control_protocol/libardour_cp.dylib $Frameworks
112 for file in $APPROOT/MacOS/* $Frameworks/* $Frameworks/modules/* $Plugins/*.so ; do
113 if ! file $file | grep -qs Mach-O ; then
116 deps=`otool -L $file | awk '{print $1}' | egrep "($GTKQUARTZ_ROOT|/local/|libs/)"`
118 for dep in $deps ; do
120 if ! test -f $Frameworks/$base; then
121 if echo $dep | grep -sq '^libs' ; then
122 cp ../../$dep $Frameworks
130 if test x$missing = xfalse ; then
131 # everything has been found
137 echo "Copying other stuff to Ardour2.app ..."
139 cp ../../gtk2_ardour/ardour.bindings $Resources
140 cp ../../gtk2_ardour/ardour.menus $Resources
141 cp ../../gtk2_ardour/ardour-sae.menus $Resources
142 cp ../../ardour_system.rc $Resources
143 cp ../../gtk2_ardour/ardour2_ui_default.conf $Resources
144 cp ../../gtk2_ardour/ardour2_ui_light.rc $Resources
145 cp ../../gtk2_ardour/ardour2_ui_dark.rc $Resources
147 cp -r ../../gtk2_ardour/icons $Resources
148 cp -r ../../gtk2_ardour/pixmaps $Resources
152 cp -R ../../gtk2_ardour/splash.png $Shared
153 cp ../../templates/*.template $Shared/templates/
155 # go through and recursively remove any .svn dirs in the bundle
156 for svndir in `find Ardour2.app -name .svn -type dir`; do
160 # now fix up the executables
161 echo "Fixing up executable dependency names ..."
163 if test x$WITH_JACK != x ; then
164 executables="$executables jackd"
167 for exe in $executables; do
168 EXE=$APPROOT/MacOS/$exe
170 for lib in `otool -L $EXE | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
172 changes="$changes -change $lib @executable_path/../Frameworks/$base"
174 if test "x$changes" != "x" ; then
175 install_name_tool $changes $EXE
179 echo "Fixing up library names ..."
180 # now do the same for all the libraries we include
181 for dylib in $Frameworks/*.dylib $Frameworks/modules/*.so ; do
183 if test ! -L $dylib ; then
185 # change all the dependencies
188 for lib in `otool -L $dylib | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
190 changes="$changes -change $lib @executable_path/../Frameworks/$base"
193 if test "x$changes" != x ; then
194 if install_name_tool $changes $dylib ; then
201 # now the change what the library thinks its own name is
203 base=`basename $dylib`
204 install_name_tool -id @executable_path/../Frameworks/$base $dylib