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