LCXL: some more small tweaks
[ardour.git] / tools / linux_packaging / build
index e032dd0796c210a3663de0300fc18e714727c32b..d2750c54e529f7d59976f1b99b5ed5b519374794 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 ;
@@ -82,23 +81,20 @@ while [ $# -gt 0 ] ; do
        --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 ;;
@@ -123,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
@@ -189,12 +186,14 @@ Backends=$APPLIB/backends
 
 Themes=$Shared/themes
 Templates=$Shared/templates
+PluginMetadata=$Shared/plugin_metadata
 ExportFormats=$Shared/export
 Locale=$Shared/locale
 MidiMaps=$Shared/midi_maps
 PatchFiles=$Shared/patchfiles
 LuaScripts=$Shared/scripts
 MackieControl=$Shared/mcp
+OSC=$Shared/osc
 
 if [ x$PRINT_SYSDEPS != x ] ; then
 #
@@ -229,10 +228,10 @@ mkdir -p $MidiMaps
 mkdir -p $PatchFiles
 mkdir -p $LuaScripts
 mkdir -p $MackieControl
+mkdir -p $OSC
 mkdir -p $ExportFormats
 mkdir -p $Panners
 mkdir -p $Backends
-mkdir -p $Templates
 mkdir -p $Shared/doc
 
 # maybe set variables
@@ -254,7 +253,7 @@ fi
 # jack in the places where it might be
 #
 
-echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT
+echo export 'PATH="/usr/local/bin:/opt/bin:$PATH"' >> $ENVIRONMENT
 
 # create startup helper script
 if test -d $BUILD_ROOT/vst; then
@@ -361,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
@@ -394,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
 
@@ -403,12 +392,17 @@ for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
     cp "$x" $MackieControl
 done
 
-# Templates
-#for f in $BUILD_ROOT/../templates/* ; do
-#    if [ -d "$f" ] ; then
-#      echo Template: $f ; cp -r "$f" $Templates ;
-#    fi
-#done
+# OSC data
+# got to be careful with names here
+for x in $BUILD_ROOT/../osc/*.preset ; do
+    cp "$x" $OSC
+done
+
+#Session templates
+cp -av $BUILD_ROOT/../templates $Templates
+
+# PluginMetadata
+cp -av $BUILD_ROOT/../plugin_metadata $PluginMetadata
 
 # ExportFormats
 # got to be careful with names here
@@ -464,8 +458,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/temporal:$OURLIBDIR/libltc:$OURLIBDIR/qm-dsp:$OURLIBDIR/ardouralsautil:$OURLIBDIR/ptformat:$BUILD_ROOT/gtk2_ardour
 
 echo $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 
@@ -500,7 +526,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}'`
@@ -535,8 +561,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
@@ -600,14 +628,12 @@ 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:]'`
 cp ../../gtk2_ardour/themes/*-${lower_case_appname}.colors $Themes
 
 #
@@ -643,10 +669,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
@@ -656,7 +682,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
@@ -672,19 +698,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 x42-whirl x42-limiter; 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 \
@@ -692,8 +733,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
@@ -719,6 +760,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
 #