NO-OP: whitespace & style
[ardour.git] / tools / linux_packaging / build
index 6ed2e13941d7c4cec9bbe00fe5ec748fe274314e..7491ebdf0b227cf87123b26aea2985e72b4047f5 100755 (executable)
@@ -24,7 +24,6 @@ fi
 MIXBUS=
 WITH_HARRISON_LV2=
 WITH_X42_LV2=
-WITH_LADSPA=0
 WITH_HARVID=
 STRIP=all
 PRINT_SYSDEPS=
@@ -36,8 +35,10 @@ GCC5ABI=false
 USEWINE=false
 BUILDTYPE=""
 NOSTRIP="libsuil|libserd|libsord|liblilv|libsratom|liblrdf|libardour|libpbd|libevoral"
-: ${HARRISONCHANNELSTRIP=harrison_channelstrip}
 
+: ${HARRISONCHANNELSTRIP=harrison_channelstrip}
+: ${HARRISONLV2=harrison_lv2s-n}
+: ${HARRISONDSPURL=http://www.harrisonconsoles.com/plugins/releases/public}
 
 if [ $# -eq 0 ] ; then
        echo ""
@@ -61,7 +62,6 @@ while [ $# -gt 0 ] ; do
                WITH_HARRISON_LV2=1 ;
                WITH_X42_LV2=1 ;
                WITH_NLS=1 ;
-               WITH_LADSPA=;
                STRIP=all
                APPNAME=Mixbus ;
                VENDOR=Harrison ;
@@ -72,7 +72,6 @@ while [ $# -gt 0 ] ; do
                WITH_HARRISON_LV2=1 ;
                WITH_X42_LV2=1 ;
                WITH_NLS=1 ;
-               WITH_LADSPA=;
                STRIP=all
                APPNAME=Mixbus32C ;
                VENDOR=Harrison ;
@@ -80,24 +79,22 @@ while [ $# -gt 0 ] ; do
                major_version=""
                shift ;;
        --public)
+               WITH_HARRISON_LV2=1 ;
                WITH_NLS=1 ;
-               WITH_LADSPA=;
                STRIP=all ;
                APPNAME=Ardour ;
                shift ;;
        --allinone)
                WITH_NLS= ;
-               WITH_LADSPA=1;
                STRIP=all;
                shift ;;
-       --test) WITH_LADSPA=; STRIP= ; shift ;;
+       --test) STRIP= ; shift ;;
 
        #
        # specific build flags
        #
 
        --nojack) INTERNAL_JACK= ; shift ;;
-       --noladspa) WITH_LADSPA= ; shift ;;
        --strip) STRIP=$2 ; shift ; shift ;;
        --sysdeps) PRINT_SYSDEPS=1; shift ;;
        --nls) WITH_NLS=1 ; shift ;;
@@ -122,6 +119,7 @@ if test x$STRIP != xall -a x$STRIP != xnone -a x$STRIP != xsome ; then
 fi
 
 . ../define_versions.sh
+lower_case_appname=`echo $APPNAME | tr '[:upper:]' '[:lower:]'`
 
 echo "Version is $release_version"
 if [ "x$commit" != "x" ] ; then
@@ -194,6 +192,7 @@ MidiMaps=$Shared/midi_maps
 PatchFiles=$Shared/patchfiles
 LuaScripts=$Shared/scripts
 MackieControl=$Shared/mcp
+OSC=$Shared/osc
 
 if [ x$PRINT_SYSDEPS != x ] ; then
 #
@@ -228,6 +227,7 @@ mkdir -p $MidiMaps
 mkdir -p $PatchFiles
 mkdir -p $LuaScripts
 mkdir -p $MackieControl
+mkdir -p $OSC
 mkdir -p $ExportFormats
 mkdir -p $Panners
 mkdir -p $Backends
@@ -360,20 +360,6 @@ cp $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.so $Libraries
 cp $GTKSTACK_ROOT/lib/gtk-2.0/2.10.0/engines/libpixmap.so $Libraries
 (cd $GTK_ENGINE_DIR && ln -s ../../libpixmap.so . )
 
-# LADSPA
-if test x$WITH_LADSPA != x ; then
-       if test x$MIXBUS != x ; then
-               plugdir=mixbus_ladspa
-       else
-               plugdir=ladspa
-       fi
-       echo "Copying `ls $plugdir | wc -l` plugins ..."
-       if [ -d $plugdir ] ; then
-               mkdir -p $Plugins
-               cp -r $plugdir/* $Plugins
-       fi
-fi
-
 # Control Surfaces
 cp $BUILD_ROOT/libs/surfaces/*/libardour_*.so* $Surfaces
 cp $BUILD_ROOT/libs/surfaces/control_protocol/libardourcp.so* $Libraries
@@ -393,6 +379,10 @@ done
 # Lua Scripts Files
 # got to be careful with names here
 for x in $BUILD_ROOT/../scripts/*.lua ; do
+               BN=$(basename $x)
+         if test "${BN:0:1}" = "_"; then
+                       continue;
+               fi
     cp "$x" $LuaScripts
 done
 
@@ -402,6 +392,12 @@ for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
     cp "$x" $MackieControl
 done
 
+# OSC data
+# got to be careful with names here
+for x in $BUILD_ROOT/../osc/*.preset ; do
+    cp "$x" $OSC
+done
+
 # Templates
 #for f in $BUILD_ROOT/../templates/* ; do
 #    if [ -d "$f" ] ; then
@@ -463,8 +459,40 @@ if test -f $BUILD_ROOT/libs/ardouralsautil/ardour-request-device; then
     fi
 fi
 
+# session-utils
+HAVE_SESSION_UTILS=false
+for file in $BUILD_ROOT/session_utils/${lower_case_appname}${major_version}-*; do
+       BN=$(basename $file)
+       cp -v $file $APPLIB/
+       if test x$STRIP = xall ; then
+               strip -s $APPLIB/${BN}
+       fi
+       ln -s ../lib/ardour-util.sh $APPBIN/${BN}
+       HAVE_SESSION_UTILS=true
+done
+
+if test "$HAVE_SESSION_UTILS" = true ; then
+       cat >> $APPLIB/ardour-util.sh << EOF
+#!/bin/sh
+
+BIN_DIR=\$(dirname \$(readlink -f \$0))
+INSTALL_DIR=\$(dirname \$BIN_DIR)
+
+export LD_LIBRARY_PATH=\$INSTALL_DIR/lib\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
+
+export ARDOUR_DATA_PATH=\$INSTALL_DIR/share
+export ARDOUR_CONFIG_PATH=\$INSTALL_DIR/etc
+export ARDOUR_DLL_PATH=\$INSTALL_DIR/lib
+export VAMP_PATH=\$INSTALL_DIR/lib\${VAMP_PATH:+:\$VAMP_PATH}
+
+SELF=\$(basename \$0)
+exec "\$INSTALL_DIR/lib/\$SELF" "\$@"
+EOF
+       chmod +x $APPLIB/ardour-util.sh
+fi
+
 OURLIBDIR=$BUILD_ROOT/libs
-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:$BUILD_ROOT/gtk2_ardour
+OURLIBS=$OURLIBDIR/surfaces/control_protocol:$OURLIBDIR/ardour:$OURLIBDIR/midi++2:$OURLIBDIR/pbd:$OURLIBDIR/gtkmm2ext:$OURLIBDIR/glibmm2:$OURLIBDIR/canvas:$OURLIBDIR/widgets:$OURLIBDIR/waveview:$OURLIBDIR/evoral:$OURLIBDIR/evoral/src/libsmf:$OURLIBDIR/audiographer:$OURLIBDIR/timecode:$OURLIBDIR/libltc:$OURLIBDIR/qm-dsp:$OURLIBDIR/ardouralsautil:$OURLIBDIR/ptformat:$BUILD_ROOT/gtk2_ardour
 
 echo $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 
@@ -499,7 +527,7 @@ while [ true ] ; do
                checkIdx=$(($checkIdx + 1))
 
                # ignore suil/qt wrappers - the plugin will pull in QT4.
-               if echo $file | grep -qs 'libsuil_.*qt4' ; then continue; fi
+               if echo $file | grep -qs 'libsuil_.*qt[45]' ; then continue; fi
 
                # do not include libjack, nor libwine
                deps=`LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | grep -v libwine.so | awk '{print $3}'`
@@ -534,8 +562,10 @@ while [ true ] ; do
                        if echo $dep | grep -qs 'libc\.' ; then continue; fi
                        # don't include libstdc++
                        if echo $dep | grep -qs libstdc++ ; then continue; fi
-                        # don't include libdbus
+                       # don't include libdbus (alsa request device)
                        if echo $dep | grep -qs libdbus ; then continue; fi
+                       # nor libudev (hidapi)
+                       if echo $dep | grep -qs libudev ; then continue; fi
 
                        base=`basename $dep`
                        if ! test -f $Libraries/$base; then
@@ -599,20 +629,13 @@ cp $BUILD_ROOT/gtk2_ardour/default_ui_config $Etc
 mkdir ${Shared}/icons
 mkdir ${Shared}/resources
 cp ../../system_config $Etc/system_config
-cp ../../instant.xml $Shared/instant.xml
 cp ../../gtk2_ardour/icons/*.png ${Shared}/icons
 cp -r ../../gtk2_ardour/icons/cursor_* ${Shared}/icons/
 cp ../../gtk2_ardour/ArdourMono.ttf $Shared
 cp ../../gtk2_ardour/resources/${APPNAME}-* ${Shared}/resources/
 
 # Themes: only install those named for this app
-lower_case_appname=`echo $APPNAME | tr '[:upper:]' '[:lower:]'`
-for colorfile in `echo ../../gtk2_ardour/themes/*-${lower_case_appname}.colors`
-do
-    cf=`basename $colorfile`
-    cf=`echo $cf | sed -e "s/-${lower_case_appname}//"`
-    cp $colorfile $Themes/$cf
-done
+cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
 
 #
 # put sooper sekrit ingredients here and they will be copied
@@ -647,10 +670,10 @@ if test x$WITH_HARRISON_LV2 != x ; then
        mkdir -p $APPLIB/LV2
 
        curl -s -S --fail -# \
-               -z "${CACHEDIR}/harrison_lv2s.${HARCH}.zip" \
-               -o "${CACHEDIR}/harrison_lv2s.${HARCH}.zip" \
-               "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_lv2s.${HARCH}.zip"
-       unzip -q -d "$APPLIB/LV2/" "${CACHEDIR}/harrison_lv2s.${HARCH}.zip"
+               -z "${CACHEDIR}/${HARRISONLV2}.${HARCH}.zip" \
+               -o "${CACHEDIR}/${HARRISONLV2}.${HARCH}.zip" \
+               "${HARRISONDSPURL}/${HARRISONLV2}.${HARCH}.zip"
+       unzip -q -d "$APPLIB/LV2/" "${CACHEDIR}/${HARRISONLV2}.${HARCH}.zip"
 fi
 
 if test -n "$MIXBUS"; then
@@ -660,7 +683,7 @@ if test -n "$MIXBUS"; then
        curl -s -S --fail -# \
                -z "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${HARCH}.so" \
                -o "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${HARCH}.so" \
-               "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/${HARRISONCHANNELSTRIP}.${HARCH}.so"
+               "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${HARCH}.so"
 
        cp "${CACHEDIR}/${HARRISONCHANNELSTRIP}.${HARCH}.so" \
                $APPLIB/ladspa/strip/${HARRISONCHANNELSTRIP}.so
@@ -676,19 +699,34 @@ if test -n "$MIXBUS"; then
        curl -s -S --fail -# \
                -z "${CACHEDIR}/harrison_vamp.${VAMPARCH}.so" \
                -o "${CACHEDIR}/harrison_vamp.${VAMPARCH}.so" \
-               "http://www.harrisonconsoles.com/mixbus/mb3/beta/harrison-dsp/harrison_vamp.${VAMPARCH}.so"
+               "${HARRISONDSPURL}/harrison_vamp.${VAMPARCH}.so"
 
        cp "${CACHEDIR}/harrison_vamp.${VAMPARCH}.so" \
                $APPLIB/harrison_vamp.so
        chmod +x $APPLIB/harrison_vamp.so
 fi
 
+if true ; then
+       mkdir -p $APPLIB/LV2
+
+       echo "Adding General MIDI Synth LV2"
+
+       for proj in x42-gmsynth ; do
+               X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/linux/${proj}.latest.txt)
+               rsync -a -q --partial \
+                       rsync://x42-plugins.com/x42/linux/${proj}-lv2-linux-${WARCH}-${X42_VERSION}.zip \
+                       "${CACHEDIR}/${proj}-lv2-linux-${WARCH}-${X42_VERSION}.zip"
+               unzip -q -d "$APPLIB/LV2/" "${CACHEDIR}/${proj}-lv2-linux-${WARCH}-${X42_VERSION}.zip"
+       done
+fi
+
+
 if test x$WITH_X42_LV2 != x ; then
        mkdir -p $APPLIB/LV2
 
        echo "Adding x42 Plugins"
 
-       for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree; do
+       for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums; do
                X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/linux/${proj}.latest.txt)
                rsync -a -q --partial \
                        rsync://x42-plugins.com/x42/linux/${proj}-lv2-linux-${WARCH}-${X42_VERSION}.zip \
@@ -696,8 +734,8 @@ if test x$WITH_X42_LV2 != x ; then
                unzip -q -d "$APPLIB/LV2/" "${CACHEDIR}/${proj}-lv2-linux-${WARCH}-${X42_VERSION}.zip"
        done
 fi
-################################################################################
 
+################################################################################
 
 if test x$WITH_HARVID != x ; then
        cd $APPBIN
@@ -723,6 +761,18 @@ if test x$WITH_HARVID != x ; then
        cd -
 fi
 
+################################################################################
+
+if test x$DEMO_SESSION_URL != x ; then
+       mkdir -p $Shared/sessions
+       DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
+       for demo in $DEMO_SESSIONS; do
+               curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
+       done
+fi
+
+################################################################################
+
 #
 # Add the uninstaller
 #
@@ -746,8 +796,8 @@ fi
 
 echo "Building tarball ..."
 
-rm -f $APPDIR.tar.bz2
-tar -cjf $APPDIR.tar.bz2 $APPDIR
+rm -f $APPDIR.tar
+tar -cf $APPDIR.tar $APPDIR
 
 echo "Calculating bundle size"
 du -sb $APPDIR/  | awk '{print $1}' > $APPDIR.size