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