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