7 # script for pulling together a Linux app bundle.
18 while [ $# -gt 0 ] ; do
23 # top level build targets
41 --public) WITH_NLS=1 ;
54 --test) SAE= ; INTERNAL_JACK=; WITH_LADSPA=; STRIP= ; shift ;;
57 # specific build flags
60 --nojack) INTERNAL_JACK= ; shift ;;
61 --noladspa) WITH_LADSPA= ; shift ;;
62 --nostrip) STRIP= ; shift ;;
63 --sysdeps) PRINT_SYSDEPS=1; shift ;;
64 --nls) WITH_NLS=1 ; shift ;;
65 --external_jack) EXTERNAL_JACK=$2; shift ; shift ;;
69 if [ x$EXTERNAL_JACK != x -a x$INTERNAL_JACK != x ] ; then
70 echo "It makes no sense to package JACK internally and externally. Please pick one."
73 release_version=`grep -m 1 '^ardour_version' ../../SConstruct | cut -d' ' -f 3 | sed "s/'//g"`
74 svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d' ' -f 6 | sed 's/[";]//g'`
75 echo "Version is $release_version / $svn_version"
76 info_string="$release_version/$svn_version built on `hostname` by `whoami` on `date`"
77 echo "Info string is $info_string"
79 # setup directory structure
87 Plugins=$APPLIB/plugins
88 Surfaces=$APPLIB/surfaces
89 Panners=$APPLIB/panners
91 Modules=$Libraries/modules
92 Loaders=$Libraries/loaders
94 if [ x$PRINT_SYSDEPS != x ] ; then
96 # print system dependencies
99 for file in $APPBIN/* $Libraries/* $Modules/* $Plugins/*.so ; do
100 if ! file $file | grep -qs Mach-O ; then
103 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
108 echo "Removing old $APPDIR tree ..."
112 echo "Building new app directory structure ..."
114 # only bother to make the longest paths
127 mkdir -p $Shared/templates
129 # maybe set variables
130 ENVIRONMENT=environment
134 if test x$SAE != x ; then
135 appname="Ardour2/SAE"
136 echo "export ARDOUR_SAE=true" >> $ENVIRONMENT
138 # current default for SAE version is German keyboard layout without a keypad
140 echo export ARDOUR_KEYBOARD_LAYOUT=de-nokeypad >> $ENVIRONMENT
141 echo export ARDOUR_UI_CONF=ardour2_ui_sae.conf >> $ENVIRONMENT
142 echo export ARDOUR2_UI_RC=ardour2_ui_dark_sae.rc >> $ENVIRONMENT
143 elif test x$MIXBUS != x ; then
144 appname="Ardour2/Mixbus"
145 echo export ARDOUR_MIXBUS=true >> $ENVIRONMENT
147 # current default for MIXBUS version is US keyboard layout without a keypad
149 echo export ARDOUR_KEYBOARD_LAYOUT=us-nokeypad >> $ENVIRONMENT
150 echo export ARDOUR_UI_CONF=ardour2_ui.conf >> $ENVIRONMENT
151 echo export ARDOUR2_UI_RC=ardour2_ui_dark.rc >> $ENVIRONMENT
157 # if we're not going to bundle JACK, make sure we can find
158 # jack in the places where it might be
161 echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT
163 # create startup helper script
165 sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' < ardour.sh.in > $APPBIN/ardour2
166 rm $ENVIRONMENT && chmod 775 $APPBIN/ardour2
167 MAIN_EXECUTABLE=ardour-$release_version
169 echo "Copying ardour executable ...."
170 cp ../../gtk2_ardour/$MAIN_EXECUTABLE $APPBIN
171 if test x$STRIP != x ; then
172 strip $APPBIN/$MAIN_EXECUTABLE
176 if test x$WITH_NLS != x ; then
177 echo "NLS support ..."
178 echo "I hope you remembered to run scons msgupdate!"
180 for file in ../../gtk2_ardour/*.mo
182 lang=`basename $file | sed 's/\.mo//'`
183 mkdir -p $Locale/$lang/LC_MESSAGES
184 cp $file $Locale/$lang/LC_MESSAGES/gtk2_ardour.mo
185 LINGUAS="$LINGUAS $lang"
187 for file in ../../libs/ardour/*.mo
189 lang=`basename $file | sed 's/\.mo//'`
190 mkdir -p $Locale/$lang/LC_MESSAGES
191 cp $file $Locale/$lang/LC_MESSAGES/libardour.mo
194 GTK_MESSAGES="atk10.mo gdk-pixbuf.mo gtk20-properties.mo gtk20.mo atk10.mo glib20.mo"
195 LOCALEROOT=/usr/share/locale
197 for l in $LINGUAS ; do
198 echo "Copying GTK i18n files for $l..."
199 for MO in $GTK_MESSAGES ; do
200 if [ -f $LOCALEROOT/$l/LC_MESSAGES/$MO ] ; then
201 cp $LOCALEROOT/$l/LC_MESSAGES/$MO $Locale/$l/LC_MESSAGES
203 # try with just the language spec
204 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
205 if [ -f $LOCALEROOT/$just_lang/LC_MESSAGES/$MO ] ; then
206 cp $LOCALEROOT/$just_lang/LC_MESSAGES/$MO $Locale/$just_lang/LC_MESSAGES
212 echo "Skipping NLS support"
215 GTKROOT=`pkg-config --libs-only-L gtk+-2.0 | sed s/-L//`
216 GTKROOT=`dirname $GTKROOT`
217 echo GTK stack root is $GTKROOT
219 GTKETC=${GTKROOT}/etc/gtk-2.0
220 GTKLIB=${GTKROOT}/lib/gtk-2.0/2.10.0
221 PANGOLIB=${GTKROOT}/lib/pango/1.6.0
222 GDKPIXBUFLIB=${GTKROOT}/lib/gdk-pixbuf-2.0/2.10.0
225 echo "Copying all Pango modules ..."
226 cp -R $PANGOLIB/modules/*.so $Modules
227 echo "Copying all GDK Pixbuf loaders ..."
228 cp -R $GDKPIXBUFLIB/loaders/*.so $Loaders
232 if test x$WITH_LADSPA != x ; then
233 if test x$SAE != x ; then
235 elif test x$MIXBUS != x ; then
236 plugdir=mixbus_ladspa
240 echo "Copying `ls $plugdir | wc -l` plugins ..."
241 if [ -d $plugdir ] ; then
242 cp -r $plugdir/* $Plugins
246 pango-querymodules | sed "s?$GTKROOT/lib/pango/[0-9][0-9]*\.[0-9][0-9]*.[0-9][0-9]*/?@ROOTDIR@/?" > $Etc/pango.modules.in
247 gdk-pixbuf-query-loaders | sed "s?$GTKROOT/lib/gdk-pixbuf-2.0/[0-9][0-9]*\.[0-9][0-9]*.[0-9][0-9]*/?@ROOTDIR@/?" > $Etc/gdk-pixbuf.loaders.in
249 # We sort of rely on clearlooks, so include a version
250 # this one is special - we will set GTK_PATH to $Libraries/clearlooks
251 cp /usr/lib64/gtk-2.0/2.10.0/engines/libclearlooks.so $Libraries
252 mkdir -p $Libraries/clearlooks/engines
253 (cd $Libraries/clearlooks/engines && ln -s ../../libclearlooks.so* )
255 # XXX STILL NEED TO DO PANNERS FOR TRUNK
256 cp ../../libs/surfaces/*/libardour_*.so* $Surfaces
257 # hack ... move libardour_cp back into Libraries
258 mv $Surfaces/libardour_cp.so* $Libraries
260 # VAMP plugins that we use
261 cp ../../libs/vamp-plugins/libardourvampplugins.so* $Libraries
264 OURLIBS=$OURLIBDIR/vamp-sdk:$OURLIBDIR/surfaces/control_protocol:$OURLIBDIR/ardour:$OURLIBDIR/midi++2:$OURLIBDIR/pbd:$OURLIBDIR/rubberband:$OURLIBDIR/soundtouch:$OURLIBDIR/gtkmm2ext:$OURLIBDIR/sigc++2:$OURLIBDIR/glibmm2:$OURLIBDIR/gtkmm2/atk:$OURLIBDIR/gtkmm2/pango:$OURLIBDIR/gtkmm2/gdk:$OURLIBDIR/gtkmm2/gtk:$OURLIBDIR/libgnomecanvasmm:$OURLIBDIR/libsndfile
268 for file in $APPBIN/* $Libraries/* $Modules/* $Plugins/*.so ; do
269 if ! file $file | grep -qs ELF ; then
272 # do not include libjack
273 deps=`LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | awk '{print $3}' | egrep "(/opt/|/local/|libs/|/usr/lib|/gtk)" | grep -v 'libjack\.'`
274 # LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | egrep "(/opt/|/local/|libs/|/usr/lib|/gtk)" | grep -v 'libjack\.'
276 for dep in $deps ; do
277 if [ "x$dep" = "xnot" ] ; then
278 echo "Missing dependant library. Use ldd to find and fix"
282 # don't use anything mapped at a specific address
283 if echo $dep | grep -qs '0x' ; then continue; fi
284 # don't include any X Window libraries
285 if echo $dep | grep -qs libX ; then continue; fi
287 if echo $dep | grep -qs 'libc\.' ; then continue; fi
290 if ! test -f $Libraries/$base; then
291 if echo $dep | grep -sq '^libs' ; then
292 # echo Copying ../../$dep
293 cp ../../$dep $Libraries
302 if test x$missing = xfalse ; then
303 # everything has been found
310 echo Stripping libraries
313 echo "Copying other stuff to $APPDIR ..."
315 cp ../../gtk2_ardour/ergonomic-us.bindings $Etc
316 cp ../../gtk2_ardour/mnemonic-us.bindings $Etc
317 cp ../../gtk2_ardour/SAE-de-keypad.bindings $Etc
318 cp ../../gtk2_ardour/SAE-de-nokeypad.bindings $Etc
319 cp ../../gtk2_ardour/SAE-us-keypad.bindings $Etc
320 cp ../../gtk2_ardour/SAE-us-nokeypad.bindings $Etc
321 cp ../../gtk2_ardour/ardour.menus $Etc
322 cp ../../gtk2_ardour/ardour-sae.menus $Etc
323 if test x$SAE != x ; then
324 cp ../../ardour_system_sae.rc $Etc/ardour_system.rc
325 echo cp ../../ardour_system_sae.rc $Etc/ardour_system.rc
326 cp ../../instant.xml.sae $Etc/instant.xml
327 echo cp ../../instant.xml.sae $Etc/instant.xml
329 # cp ../../ardour_system.rc $Etc/ardour_system.rc
330 # echo FOO cp ../../ardour_system.rc $Etc/ardour_system.rc
331 cp ../../instant.xml $Etc/instant.xml
332 echo cp ../../instant.xml $Etc/instant.xml
334 cp ../../gtk2_ardour/ardour2_ui_sae.conf $Etc
335 cp ../../gtk2_ardour/ardour2_ui_default.conf $Etc
336 cp ../../gtk2_ardour/ardour2_ui_default.conf $Etc/ardour2_ui.conf
337 cp ../../gtk2_ardour/ardour2_ui_light.rc $Etc
338 cp ../../gtk2_ardour/ardour2_ui_dark.rc $Etc
339 cp ../../gtk2_ardour/ardour2_ui_light_sae.rc $Etc
340 cp ../../gtk2_ardour/ardour2_ui_dark_sae.rc $Etc
342 cp -r ../../gtk2_ardour/icons $Etc
343 cp -r ../../gtk2_ardour/pixmaps $Etc
346 # put sooper sekrit ingredients here and they will be copied
349 if [ -d specialSauce ] ; then
350 cp -r specialSauce $Etc
355 cp -R ../../gtk2_ardour/splash.png $Shared
356 cp ../../templates/*.template $Shared/templates/
358 # go through and recursively remove any .svn dirs in the bundle
359 for svndir in `find $APPDIR -name .svn -type d`; do
364 # and now ... the final package
367 if [ x$SAE != x ] ; then
371 echo "Creating SAE packaging directory"
372 cp HowToInstallArdourSAE.pdf "$APPDIR/How To Install Ardour SAE.pdf"
373 cp SAE-de-keypad.pdf "$APPDIR/Ardour SAE Shortcuts (keypad).pdf"
374 cp SAE-de-nokeypad.pdf "$APPDIR/Ardour SAE Shortcuts.pdf"
376 elif [ x$MIXBUS != x ] ; then
380 echo "Creating Mixbus packaging directory"
381 cp MixBus_Install_QuickStart.pdf "$APPDIR/Mixbus Install & Quick Start Guide.pdf"
383 if [ -x $EXTERNAL_JACK != x ] ; then
384 cp $EXTERNAL_JACK $PRODUCT_PKG_DIR
388 #echo "Building tarball ..."
390 #rm -f $APPNAME-$release_version.tar.bz2
391 #tar -jcf $APPNAME-$release_version.tar.bz2 $APPDIR