try fixing borkage caused by excluding more libs
[ardour.git] / tools / linux_packaging / build
1 #!/bin/bash
2
3 #
4
5 . ./buildenv
6
7 # script for pulling together a Linux app bundle.
8 #
9 # This will create a bundle for a single architecture.
10 # Execute this scirpt on both x86 and x86_64 and then use
11 # package to merge the 2 bundles into a final package with the
12 # installer.
13
14 MIXBUS=
15 WITH_LADSPA=0
16 STRIP=all
17 PRINT_SYSDEPS=
18 WITH_NLS=
19 EXTERNAL_JACK=
20 VENDOR=Ardour ;
21 BUILDTYPE=""
22
23 if [ $# -eq 0 ] ; then
24         echo ""  
25         echo "ERROR - Please specify build type"
26         echo "    --public"
27         echo "    --mixbus"
28         echo ""  
29         exit 1
30 fi
31
32 while [ $# -gt 0 ] ; do
33         echo "arg = $1"
34         case $1 in
35
36         #
37         # top level build targets
38         #
39
40         --mixbus)
41                 MIXBUS=1; 
42                 WITH_NLS=1 ; 
43                 WITH_LADSPA=; 
44                 STRIP=all
45                 APPNAME=Mixbus ;
46                 VENDOR=Harrison ;
47                 shift ;;
48         --public)
49                 WITH_NLS=1 ; 
50                 WITH_LADSPA=; 
51                 STRIP=all ; 
52                 APPNAME=Ardour ;
53                 shift ;;
54         --allinone)
55                 WITH_NLS= ; 
56                 WITH_LADSPA=1; 
57                 STRIP=all; 
58                 shift ;;
59         --test) WITH_LADSPA=; STRIP= ; shift ;;
60
61         #
62         # specific build flags
63         #
64
65         --nojack) INTERNAL_JACK= ; shift ;;
66         --noladspa) WITH_LADSPA= ; shift ;;
67         --strip) STRIP=$2 ; shift ; shift ;;
68         --sysdeps) PRINT_SYSDEPS=1; shift ;;
69         --nls) WITH_NLS=1 ; shift ;;
70
71         *)
72                 #catch all for unknown arguments
73                 echo ""
74                 echo "!!! ERROR !!! - Unknown argument $1"
75                 echo ""
76                 exit 1
77                 ;;
78         esac
79 done
80
81 if test x$STRIP != xall -a x$STRIP != xnone -a x$STRIP != xsome ; then
82     echo "Unknown strip option \"$STRIP\""
83     echo "Legal values are: all, none, some"
84     exit 1
85 fi
86
87 release_version=`grep -m 1 '^VERSION' ../../wscript | awk '{print $3}' | sed "s/'//g"`
88 svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d"'" -f 2`
89 echo "Version is $release_version / $svn_version"
90 info_string="$release_version/$svn_version built on `hostname` by `whoami` on `date`"
91 echo "Info string is $info_string"
92
93 # Figure out our CPU type
94 case `uname -m` in
95         i[3456789]86|x86|i86pc)
96                 echo "Architecture is x86"
97                 ARCH='x86'
98                 ARCH_BITS='32-bit'
99                 ;;
100         x86_64|amd64|AMD64)
101                 echo "Architecture is x86_64"
102                 ARCH='x86_64'
103                 ARCH_BITS='64-bit'
104                 ;;
105         *)
106                 echo ""
107                 echo "ERROR - Unknown architecture `uname -m`"
108                 echo ""
109                 exit 1
110                 ;;
111 esac
112
113 # Figure out the Build Type
114 if grep -q "DEBUG = True" ../../build/c4che/default.cache.py; then
115         DEBUG="T"
116 else
117         DEBUG="F"
118 fi
119
120 if [ x$DEBUG = xT ]; then
121     BUILDTYPE="dbg"
122     if [ x$STRIP = xall ] ; then
123         echo "A debug build with --strip all makes no sense - STRIP reset to \"some\""
124         STRIP=some
125     fi
126 fi
127
128 # the waf build tree to use when copying built/generated files
129
130 BUILD_ROOT=../../build
131
132 # setup directory structure
133
134 if [ -z "${BUILDTYPE}" ]; then
135         APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}
136         APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}
137 else
138         APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}-${BUILDTYPE}
139         APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}-${BUILDTYPE}
140 fi
141
142 APPBIN=$APPDIR/bin
143 APPLIB=$APPDIR/lib
144 Libraries=$APPLIB
145 Etc=$APPDIR/etc
146 Shared=$APPDIR/share
147
148 Plugins=$APPLIB/plugins
149 Surfaces=$APPLIB/surfaces
150 Panners=$APPLIB/panners
151
152 Modules=$Libraries/modules
153 Loaders=$Libraries/loaders
154
155 Templates=$Shared/templates
156 ExportFormats=$Shared/export
157 Locale=$Shared/locale
158 MidiMaps=$Shared/midi_maps
159 PatchFiles=$Shared/patchfiles
160 MackieControl=$Shared/mcp
161
162 if [ x$PRINT_SYSDEPS != x ] ; then
163 #
164 # print system dependencies
165 #
166
167         for file in $APPBIN/* $Libraries/* $Modules/* $Plugins/*.so ; do 
168                 if ! file $file | grep -qs Mach-O ; then
169                         continue
170                 fi
171                 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)" 
172         done | sort | uniq
173         exit 0
174 fi
175
176 echo "Removing old $APPDIR tree ..."
177 rm -rf $APPDIR/
178
179 echo "Building new app directory structure ..."
180
181 # only bother to make the longest paths
182
183 mkdir -p $APPDIR
184 mkdir -p $APPBIN
185 mkdir -p $APPLIB
186 mkdir -p $Etc
187 mkdir -p $Plugins
188 mkdir -p $Modules
189 mkdir -p $Loaders
190 mkdir -p $Shared
191 mkdir -p $Locale
192 mkdir -p $Surfaces
193 mkdir -p $MidiMaps
194 mkdir -p $PatchFiles
195 mkdir -p $MackieControl
196 mkdir -p $ExportFormats
197 mkdir -p $Panners
198 mkdir -p $Templates
199 mkdir -p $Shared/templates
200 mkdir -p $Shared/doc
201
202 # maybe set variables
203 ENVIRONMENT=environment
204 rm -f $ENVIRONMENT
205 touch $ENVIRONMENT
206
207 if test x$MIXBUS != x ; then
208         echo export ARDOUR_MIXBUS=true >> $ENVIRONMENT
209         #
210         # current default for MIXBUS version is US keyboard layout without a keypad
211         #
212         echo export ARDOUR_KEYBOARD_LAYOUT=us-nokeypad >> $ENVIRONMENT
213         echo export ARDOUR_UI_CONF=ardour3_ui.conf >> $ENVIRONMENT
214         echo export ARDOUR3_UI_RC=ardour3_ui_dark.rc >> $ENVIRONMENT
215 fi
216
217 #
218 # if we're not going to bundle JACK, make sure we can find
219 # jack in the places where it might be
220 #
221
222 echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT
223
224 # create startup helper script
225
226 sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour3
227 rm $ENVIRONMENT && chmod 775 $APPBIN/ardour3
228 #MAIN_EXECUTABLE=ardour-$release_version
229 MAIN_EXECUTABLE=ardour-3.0
230
231 echo "Copying ardour executable ...."
232 cp $BUILD_ROOT/gtk2_ardour/$MAIN_EXECUTABLE $APPBIN
233 if test x$STRIP = xall ; then
234         strip $APPBIN/$MAIN_EXECUTABLE
235 fi
236
237 # copy locale files
238 # note that at present(feb 2011), the .mo files end up in the source tree which is
239 # not really as it should be.
240 if test x$WITH_NLS != x ; then
241         echo "NLS support ..."
242         echo "I hope you remembered to run scons msgupdate!"
243         LINGUAS=
244
245         for dl in gtk2_ardour libs/ardour libs/gtkmm2ext ; do 
246             files=`find ../../$dl -name "*.mo"`
247
248             if [ -z "$files" ]; then
249                 echo ""
250                 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$dl"
251                 echo ""
252             fi
253  
254             for file in $files 
255             do
256                 echo $file
257                 lang=`basename $file | sed 's/\.mo//'`
258                 mkdir -p $Locale/$lang/LC_MESSAGES
259                 cp $file $Locale/$lang/LC_MESSAGES/`basename $dl`
260                 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
261                     :
262                 else 
263                     LINGUAS="$LINGUAS $lang"
264                 fi
265             done
266         done
267
268         GTK_MESSAGES="atk10.mo gdk-pixbuf.mo gtk20-properties.mo gtk20.mo atk10.mo glib20.mo"
269         LOCALEROOT=/usr/share/locale
270
271         for l in $LINGUAS ; do
272                 echo "Copying GTK i18n files for $l..."
273                 for MO in $GTK_MESSAGES ; do 
274                         if [ -f $LOCALEROOT/$l/LC_MESSAGES/$MO ] ; then
275                                 cp $LOCALEROOT/$l/LC_MESSAGES/$MO $Locale/$l/LC_MESSAGES
276                         else
277                                 # try with just the language spec
278                                 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
279                                 if [ -f $LOCALEROOT/$just_lang/LC_MESSAGES/$MO ] ; then
280                                         cp $LOCALEROOT/$just_lang/LC_MESSAGES/$MO $Locale/$just_lang/LC_MESSAGES
281                                 fi
282                         fi
283                 done
284         done
285 else
286         echo "Skipping NLS support"
287 fi
288
289 ### Find fontconfig ###
290 FCROOT=`pkg-config --libs-only-L fontconfig | sed -e "s/-L//" -e "s/[[:space:]]//g"`
291 if [ ! -z "$FCROOT" ]; then
292         echo "Found FCOOT using pkg-config"
293         FCETC=`dirname $FCROOT`/etc
294 elif [ -d /usr/lib/gtk-2.0 ]; then
295         FCETC="/etc"
296 elif [ -d /usr/local/lib/gtk-2.0 ]; then
297         FCETC="/usr/local/etc"
298 else
299         echo ""
300         echo "!!! ERROR !!! - Unable to locate fontconfig directory. Packager will exit"
301         echo ""
302         exit 1
303 fi
304
305 echo "Copying Fontconfig files to $Etc ..."
306 cp -r $FCETC/fonts $Etc
307
308 ### Find gtk ###
309 GTKROOT=`pkg-config --libs-only-L gtk+-2.0 | sed -e "s/-L//" -e "s/[[:space:]]//g"`
310 if [ ! -z "$GTKROOT" ]; then
311         echo "Found GTKROOT using pkg-config"
312 elif [ -d /usr/lib/gtk-2.0 ]; then
313         GTKROOT="/usr/lib"
314 elif [ -d /usr/local/lib/gtk-2.0 ]; then
315         GTKROOT="/usr/local/lib"
316 else
317         echo ""
318         echo "!!! ERROR !!! - Unable to locate gtk-2.0 directory. Packager will exit"
319         echo ""
320         exit 1
321 fi
322
323 echo "GTKROOT is ${GTKROOT}"
324 versionDir=`ls ${GTKROOT}/gtk-2.0/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
325
326 num=0
327 for name in $versionDir ; do
328     num=$(($num + 1))
329 done
330
331 if [ $num -eq 1 ]; then
332         GTKLIB=${GTKROOT}/gtk-2.0/$versionDir
333         echo "GTKLIB is ${GTKLIB}"
334 else
335         echo ""
336         echo "!!! ERROR !!! - More than one gtk-2.0 version found in ${GTKROOT}/gtk-2.0/  ( $versionDir ). Packager will exit"
337         echo ""
338         exit 1
339 fi
340
341
342 ### Find pango ###
343 PANGOROOT=`pkg-config --libs-only-L pango | sed -e "s/-L//" -e "s/[[:space:]]//g"`
344 if [ ! -z "$PANGOROOT" ]; then
345         echo "Found PANGOROOT using pkg-config"
346 elif [ -d /usr/lib/pango ]; then
347         PANGOROOT="/usr/lib"
348 elif [ -d /usr/local/lib/pango ]; then
349         PANGOROOT="/usr/local/lib"
350 elif [ -d /usr/lib/x86_64-linux-gnu/pango ]; then
351         PANGOROOT="/usr/lib/x86_64-linux-gnu"
352 else
353         echo ""
354         echo "!!! ERROR !!! - Unable to locate pango directory. Packager will exit"
355         echo ""
356         exit 1
357 fi
358
359 echo "PANGOROOT is ${PANGOROOT}"
360 versionDir=`ls ${PANGOROOT}/pango/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
361
362 num=0
363 for name in $versionDir ; do
364         num=$(($num + 1))
365 done
366
367 if [ $num -eq 1 ]; then
368         PANGOLIB=${PANGOROOT}/pango/$versionDir
369         echo "PANGOLIB is ${PANGOLIB}"
370 else
371         echo ""
372         echo "!!! ERROR !!! - More than one pango version found in ${PANGOROOT}/pango/  ( $versionDir ). Packager will exit"
373         echo ""
374         exit 1
375 fi
376
377
378 ### Find gdk-pixbuf ###
379 GDKPIXBUFROOT=`pkg-config --libs-only-L gdk-pixbuf-2.0 | sed -e "s/-L//" -e "s/[[:space:]]//g"`
380 if [ ! -z "$GDKPIXBUFROOT" ]; then
381         echo "Found GDKPIXBUFROOT using pkg-config"
382 elif [ -d /usr/lib/gdk-pixbuf-2.0 ]; then
383         GDKPIXBUFROOT="/usr/lib"
384 elif [ -d /usr/local/lib/gdk-pixbuf-2.0 ]; then
385         GDKPIXBUFROOT="/usr/local/lib"
386 elif [ -d ${GTKLIB}/loaders ]; then  #odd ball case
387         GDKPIXBUFROOT=${GTKROOT}
388         GDKPIXBUFLIB=${GTKLIB}
389 else
390         echo ""
391         echo "!!! ERROR !!! - Unable to locate gdk-pixbuf-2.0 directory. Packager will exit"
392         echo ""
393         exit 1
394 fi
395
396 echo "GDKPIXBUFROOT is ${GDKPIXBUFROOT}"
397
398 if [ -z ${GDKPIXBUFLIB} ]; then
399         versionDir=`ls ${GDKPIXBUFROOT}/gdk-pixbuf-2.0/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
400
401         num=0
402         for name in $versionDir ; do
403             num=$(($num + 1))
404         done
405
406         if [ $num -eq 1 ]; then
407                 GDKPIXBUFLIB=${GDKPIXBUFROOT}/gdk-pixbuf-2.0/$versionDir
408                 echo "GDKPIXBUFLIB is ${GDKPIXBUFLIB}"
409         else
410                 echo ""
411                 echo "!!! ERROR !!! - More than one gdk-pixbuf-2.0 version found in ${GDKPIXBUFROOT}/pango/  ( $versionDir ). Packager will exit"
412                 echo ""
413                 exit 1
414         fi
415 fi
416
417
418
419 echo "Copying all Pango modules ..."
420 cp -R $PANGOLIB/modules/*.so $Modules
421
422 echo "Copying all GDK Pixbuf loaders ..."
423 cp -R $GDKPIXBUFLIB/loaders/*.so $Loaders
424
425 pango-querymodules | sed "s?$PANGOLIB/?@ROOTDIR@/?" > $Etc/pango.modules.in
426 gdk-pixbuf-query-loaders | sed "s?$GDKPIXBUFLIB/?@ROOTDIR@/?" > $Etc/gdk-pixbuf.loaders.in
427
428 # We sort of rely on clearlooks, so include a version
429 # this one is special - we will set GTK_PATH to $Libraries/clearlooks
430
431 if [ ! -e ${GTKLIB}/engines/libclearlooks.so ]; then
432     if [ ! -e $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.so ] ; then 
433         echo ""
434         echo "!!! ERROR !!! - not able to locate libclearlooks.so"
435         echo ""
436         echo "Packager with exit"
437         exit 1
438     else 
439         clearlooks_so=$BUILD_ROOT/libs/clearlooks-newer/libclearlooks.so
440     fi
441 else
442     clearlooks_so=${GTKLIB}/engines/libclearlooks.so
443 fi
444
445 echo "Copying clearlooks ..."
446 cp $clearlooks_so $Libraries
447 mkdir -p $Libraries/clearlooks/engines
448 (cd $Libraries/clearlooks/engines && ln -s ../../libclearlooks* libclearlooks.so )
449
450 # LADSPA
451 if test x$WITH_LADSPA != x ; then
452         if test x$MIXBUS != x ; then
453                 plugdir=mixbus_ladspa
454         else
455                 plugdir=ladspa
456         fi
457         echo "Copying `ls $plugdir | wc -l` plugins ..."
458         if [ -d $plugdir ] ; then
459                 cp -r $plugdir/* $Plugins
460         fi
461 fi
462
463 # Control Surfaces
464 cp $BUILD_ROOT/libs/surfaces/*/libardour*.so* $Surfaces
465 # hack ... move libardour_cp back into Libraries
466 mv $Surfaces/libardourcp.so* $Libraries
467
468 # MidiMaps
469 # got to be careful with names here
470 for x in $BUILD_ROOT/../midi_maps/*.map ; do
471     cp "$x" $MidiMaps
472     echo Copied MIDI map $x 
473 done
474
475 # MIDNAM Patch Files
476 # got to be careful with names here
477 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
478     cp "$x" $PatchFiles
479     echo Copied MIDNAM file "$x"
480 done
481
482 # MackieControl data
483 # got to be careful with names here
484 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
485     cp "$x" $MackieControl
486     echo Copied Mackie Control file $x 
487 done
488
489 # Templates
490 for f in $BUILD_ROOT/../templates/* ; do 
491     if [ -d "$f" ] ; then
492         echo Template: $f ; cp -r "$f" $Templates ; 
493     fi
494 done
495
496 # ExportFormats
497 # got to be careful with names here
498 for x in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
499     cp "$x" $ExportFormats
500 done
501
502 # Panners
503 cp $BUILD_ROOT/libs/panners/*/lib*.so* $Panners
504
505 # VAMP plugins that we use
506 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.so* $Libraries
507
508 OURLIBDIR=$BUILD_ROOT/libs
509 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:$OURLIBDIR/evoral:$OURLIBDIR/evoral/src/libsmf:$OURLIBDIR/audiographer:$OURLIBDIR/timecode:$OURLIBDIR/taglib:$OURLIBDIR/qm-dsp
510
511 echo $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
512
513 checkedIdx=0
514 deplibs=
515
516 while [ true ] ; do 
517         missing=false
518         filelist=`find $APPLIB/ -type f`
519         filelist="$APPBIN/$MAIN_EXECUTABLE $filelist"
520
521         for file in $filelist  ; do 
522                 if ! file $file | grep -qs ELF ; then
523                         continue
524                 fi
525
526                 # speed this up a bit by not checking things multiple times.
527                 for i in "${depCheckedList[@]}"; do
528                         if [ $i == $file ]; then
529                                 continue 2
530                         fi
531                 done
532                 depCheckedList[$checkIdx]=$file
533                 checkIdx=$(($checkIdx + 1))
534                 
535                 # do not include libjack
536                 deps=`LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | awk '{print $3}'`
537
538                 echo -n "."
539                 for dep in $deps ; do
540                         if test "not" = ${dep}; then 
541                                 echo ""
542                                 echo "!!! ERROR !!! - Missing dependant library for $file."
543                                 echo ""
544                                 (LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file)
545                                 echo ""
546                                 echo "!!! ERROR !!! - See Above"
547                                 exit 1
548                         fi
549
550                         # don't use anything mapped at a specific address
551                         if echo $dep | grep -qs '0x' ; then continue; fi
552                         # don't include /lib
553                         if echo $dep | grep -qs "^/lib/" ; then continue; fi
554                         # don't include jack
555                         if echo $dep | grep -qs libjack ; then continue; fi
556                         # don't include ALSA
557                         if echo $dep | grep -qs libasound ; then continue; fi
558                         # don't include any X Window libraries
559                         if echo $dep | grep -qs libX\. ; then continue; fi  
560                         if echo $dep | grep -qs libxcb ; then continue; fi  
561                         if echo $dep | grep -qs libSM\. ; then continue; fi  
562                         # don't include libc
563                         if echo $dep | grep -qs 'libc\.' ; then continue; fi
564                         # don't include libstdc++
565                         if echo $dep | grep -qs libstdc++ ; then continue; fi
566
567                         base=`basename $dep`
568                         if ! test -f $Libraries/$base; then
569                                 parent=$(basename ${file})
570                                 if echo $dep | grep -sq '^libs' ; then
571                                         echo "Copying dependant lib $BUILD_ROOT/$dep    (required by ${parent})"
572                                         cp $BUILD_ROOT/$dep $Libraries
573                                 else
574                                         echo "Copying dependant lib $dep    (required by ${parent})"
575                                         cp $dep $Libraries
576                                 fi
577                                 if echo $dep | grep -sq '^/' ; then
578                                     # absolute path, candidate for stripping
579                                     deplibs="$deplibs $base"
580                                 fi
581                                 missing=true
582                         fi
583                 done
584         done
585         if test x$missing = xfalse ; then
586                 # everything has been found
587                 break
588         fi
589 done
590 echo
591
592 # strip libraries
593 if test x$STRIP = xall ; then
594     echo Stripping all libraries
595     # Must be writable so that we can strip
596     find $APPLIB/ -name "*.so*" | xargs chmod u+w
597     # and strip ...
598     find $APPLIB/ -name "*.so*" | xargs strip
599 elif test x$STRIP = xsome ; then
600     echo Stripping dependent libraries
601     for l in $deplibs ; do
602         chmod u+w $APPLIB/$l
603         strip $APPLIB/$l
604     done
605 fi
606 find $APPLIB/ -name "*.so*" | xargs chmod a+rx
607
608 echo "Copying other stuff to $APPDIR  ..."
609
610 # these are all generated by waf
611 #cp $BUILD_ROOT/gtk2_ardour/ergonomic-us.bindings       $Etc
612 cp $BUILD_ROOT/gtk2_ardour/mnemonic-us.bindings  $Etc
613 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Etc
614 cp $BUILD_ROOT/ardour_system.rc $Etc/ardour_system.rc
615 cp $BUILD_ROOT/gtk2_ardour/ardour3*.rc $Etc
616
617 # these are copied straight from the source tree
618
619 cp ../../gtk2_ardour/ardour3_ui_default.conf $Etc/ardour3_ui_default.conf
620 cp ../../gtk2_ardour/ardour3_ui_default.conf $Etc/ardour3_ui.conf
621 cp ../../instant.xml $Etc/instant.xml
622 cp ../../gtk2_ardour/step_editing.bindings $Etc
623 cp ../../gtk2_ardour/mixer.bindings $Etc
624 cp -r ../../gtk2_ardour/icons $Shared
625 cp -r ../../gtk2_ardour/pixmaps $Shared
626
627
628 #
629 # put sooper sekrit ingredients here and they will be copied
630 #
631
632 if [ -d specialSauce ] ; then
633         cp -r specialSauce $Etc
634 fi
635
636 # share stuff
637
638 cp -R ../../gtk2_ardour/splash.png $Shared
639
640 # go through and recursively remove any .svn dirs in the bundle
641 for svndir in `find $APPDIR -name .svn -type d`; do
642         rm -rf $svndir
643 done
644
645 #
646 # Add the uninstaller
647 #
648 sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_BUILD%/${svn_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
649 chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
650
651 #Sanity Check file
652 if [ -e $BUILD_ROOT/tools/sanity_check/sanityCheck ]; then
653         cp $BUILD_ROOT/tools/sanity_check/sanityCheck $APPBIN
654 else
655         echo "!!!ERROR !!! sanityCheck program is missing. packager will exit without being complete"
656         exit 1
657 fi
658
659 echo "Building tarball ..."
660
661 rm -f $APPDIR.tar.bz2
662 tar -cjf $APPDIR.tar.bz2 $APPDIR
663
664 echo "Calculating bundle size"
665 du -sb $APPDIR/  | awk '{print $1}' > $APPDIR.size
666
667 rm -rf $APPDIR/
668
669 echo "Done."
670