get and deploy harrison binaries.
[ardour.git] / tools / linux_packaging / build
index 3bddd16b6bb745cf214a872971a725e6a23285f5..7539cbc794bd92701247a51d75b62347d850c32c 100755 (executable)
@@ -14,6 +14,8 @@ ARDOURSTACK_ROOT=$HOME/a3/inst
 # the waf build tree to use when copying built/generated files
 BUILD_ROOT=../../build
 
+. ../define_versions.sh
+
 # where harvid and xjadeo binaries are cached
 if test -z "$CACHEDIR" -o ! -d "$CACHEDIR"; then
        CACHEDIR=`pwd`
@@ -111,6 +113,7 @@ case `uname -m` in
                echo "Architecture is x86"
                ARCH='x86'
                WARCH='i386'
+               HARCH='linux32'
                ARCH_BITS='32-bit'
                MULTIARCH='i386-linux-gnu'
                ;;
@@ -118,6 +121,7 @@ case `uname -m` in
                echo "Architecture is x86_64"
                ARCH='x86_64'
                WARCH='x86_64'
+               HARCH='linux64'
                ARCH_BITS='64-bit'
                MULTIARCH='x86_64-linux-gnu'
                ;;
@@ -233,8 +237,8 @@ echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT
 
 # create startup helper script
 
-sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour3
-rm $ENVIRONMENT && chmod 775 $APPBIN/ardour3
+sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour${major_version}
+rm $ENVIRONMENT && chmod 775 $APPBIN/ardour${major_version}
 MAIN_EXECUTABLE=ardour-${release_version}
 
 echo "Copying ardour executable ...."
@@ -310,22 +314,6 @@ fi
 # 
 
 cp -R $GTKSTACK_ROOT/etc/* $Etc
-echo "Copying all Pango modules ..."
-cp -R $GTKSTACK_ROOT/lib/pango/1.8.0/modules/*.so $Modules
-echo "Copying all GDK Pixbuf loaders ..."
-cp -R $GTKSTACK_ROOT/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.so $Loaders
-
-# Generate a pango module file using the actual Pango that we're going to bundle
-
-cat > pangorc <<EOF 
-[Pango]
-ModulesPath=$GTKSTACK_ROOT/lib/pango/1.8.0/modules
-EOF
-env PANGO_RC_FILE=pangorc $GTKSTACK_ROOT/bin/pango-querymodules | sed "s?$GTKSTACK_ROOT/lib/pango/1.8.0/?@ROOTDIR@/?" > $Etc/pango.modules.in
-rm pangorc
-
-# Ditto for gdk-pixbuf loaders
-gdk-pixbuf-query-loaders | sed "s?$GTKSTACK_ROOT/lib/gdk-pixbuf-2.0/2.10.0/?@ROOTDIR@/?" > $Etc/gdk-pixbuf.loaders.in
 
 # We rely on clearlooks, so include a version from our own build tree
 # this one is special - we will set GTK_PATH to $Libraries/gtkengines
@@ -527,17 +515,17 @@ echo
 if test x$STRIP = xall ; then
     echo Stripping all libraries
     # Must be writable so that we can strip
-    find $APPLIB/ -name "*.so*" | xargs chmod u+w
+    find $APPLIB/ -name "*.so*" -print0 | xargs -0 chmod u+w
     # and strip ...
-    find $APPLIB/ -name "*.so*" | xargs strip
+    find $APPLIB/ -name "*.so*" -print0 | xargs -0 strip -s
 elif test x$STRIP = xsome ; then
     echo Stripping dependent libraries
     for l in $deplibs ; do
         chmod u+w $APPLIB/$l
-        strip $APPLIB/$l
+        strip -s $APPLIB/$l
     done
 fi
-find $APPLIB/ -name "*.so*" | xargs chmod a+rx
+find $APPLIB/ -name "*.so*" -print0 | xargs -0 chmod a+rx
 
 echo "Copying other stuff to $APPDIR  ..."
 
@@ -589,23 +577,33 @@ done
 if test -n "$MIXBUS"; then
 
        mkdir -p $APPLIB/LV2
+       mkdir -p $APPLIB/ladspa/strip/
+
+       # TODO find a good way to cache those locally
+       curl -s -S -o "${CACHEDIR}/harrison_lv2s.${HARCH}.zip" \
+               http://www.harrisonconsoles.com/mixbus/mb3/${HARCH}/harrison_lv2s.zip 
+       unzip -d "$APPLIB/LV2/" "${CACHEDIR}/harrison_lv2s.${HARCH}.zip"
+
+       curl -s -S -o $APPLIB/ladspa/strip/harrison_channelstrip.so \
+               http://www.harrisonconsoles.com/mixbus/mb3/${HARCH}/harrison_channelstrip.so
+
        METERS_VERSION=$(curl -s -S http://gareus.org/x42/linux/x42-meters.latest.txt)
        rsync -a -q --partial \
                rsync://gareus.org/x42/linux/x42-meters-lv2-${WARCH}-${METERS_VERSION}.zip \
-               "${SRCDIR}/x42-meters-lv2-linux-${WARCH}-${METERS_VERSION}.zip"
-       unzip -d "$APPLIB/LV2/" "${SRCDIR}/x42-meters-lv2-linux-${WARCH}-${METERS_VERSION}.zip"
+               "${CACHEDIR}/x42-meters-lv2-linux-${WARCH}-${METERS_VERSION}.zip"
+       unzip -d "$APPLIB/LV2/" "${CACHEDIR}/x42-meters-lv2-linux-${WARCH}-${METERS_VERSION}.zip"
 
        SETBFREE_VERSION=$(curl -s -S http://gareus.org/x42/linux/setBfree.latest.txt)
        rsync -a -q --partial \
                rsync://gareus.org/x42/linux/setBfree-lv2-linux-${WARCH}-${SETBFREE_VERSION}.zip \
-               "${SRCDIR}/setBfree-lv2-linux-${WARCH}-${SETBFREE_VERSION}.zip"
-       unzip -d "$APPLIB/LV2/" "${SRCDIR}/setBfree-lv2-linux-${WARCH}-${SETBFREE_VERSION}.zip"
+               "${CACHEDIR}/setBfree-lv2-linux-${WARCH}-${SETBFREE_VERSION}.zip"
+       unzip -d "$APPLIB/LV2/" "${CACHEDIR}/setBfree-lv2-linux-${WARCH}-${SETBFREE_VERSION}.zip"
 
        MIDIFILTER_VERSION=$(curl -s -S http://gareus.org/x42/linux/x42-midifilter.latest.txt)
        rsync -a -q --partial \
                rsync://gareus.org/x42/linux/x42-midifilter-lv2-linux-${WARCH}-${MIDIFILTER_VERSION}.zip \
-               "${SRCDIR}/x42-midifilter-lv2-linux-${WARCH}-${MIDIFILTER_VERSION}.zip"
-       unzip -d "$APPLIB/LV2/" "${SRCDIR}/x42-midifilter-lv2-linux-${WARCH}-${MIDIFILTER_VERSION}.zip"
+               "${CACHEDIR}/x42-midifilter-lv2-linux-${WARCH}-${MIDIFILTER_VERSION}.zip"
+       unzip -d "$APPLIB/LV2/" "${CACHEDIR}/x42-midifilter-lv2-linux-${WARCH}-${MIDIFILTER_VERSION}.zip"
 
 fi
 ################################################################################
@@ -638,9 +636,16 @@ fi
 #
 # Add the uninstaller
 #
-sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
+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
 chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
 
+#
+# Add the stage2.run script
+#
+sed -e "s/%REPLACE_MAJOR_VERSION%/${major_version}/" < stage2.run.in > stage2.run
+chmod a+x stage2.run
+
+
 #Sanity Check file
 if [ -e $BUILD_ROOT/tools/sanity_check/sanityCheck ]; then
        cp $BUILD_ROOT/tools/sanity_check/sanityCheck $APPBIN