..and another packaging typo
[ardour.git] / tools / linux_packaging / build
index 0915beba3a720c9c842311b00adfb276f91c0655..80025d1f101e6d2faab51962ce8fdc2d47343d4d 100755 (executable)
@@ -32,15 +32,16 @@ WITH_NLS=
 EXTERNAL_JACK=
 VENDOR=Ardour ;
 EXENAME=ardour
+GCC5ABI=false
 BUILDTYPE=""
 
 
 if [ $# -eq 0 ] ; then
-       echo ""  
+       echo ""
        echo "ERROR - Please specify build type"
        echo "    --public"
        echo "    --mixbus"
-       echo ""  
+       echo ""
        exit 1
 fi
 
@@ -53,26 +54,26 @@ while [ $# -gt 0 ] ; do
        #
 
        --mixbus)
-               MIXBUS=1; 
+               MIXBUS=1;
                WITH_HARRISON_LV2=1 ;
                WITH_X42_LV2=1 ;
-               WITH_NLS=1 ; 
-               WITH_LADSPA=; 
+               WITH_NLS=1 ;
+               WITH_LADSPA=;
                STRIP=all
                APPNAME=Mixbus ;
                VENDOR=Harrison ;
                EXENAME=mixbus ;
                shift ;;
        --public)
-               WITH_NLS=1 ; 
-               WITH_LADSPA=; 
-               STRIP=all ; 
+               WITH_NLS=1 ;
+               WITH_LADSPA=;
+               STRIP=all ;
                APPNAME=Ardour ;
                shift ;;
        --allinone)
-               WITH_NLS= ; 
-               WITH_LADSPA=1; 
-               STRIP=all; 
+               WITH_NLS= ;
+               WITH_LADSPA=1;
+               STRIP=all;
                shift ;;
        --test) WITH_LADSPA=; STRIP= ; shift ;;
 
@@ -86,6 +87,7 @@ while [ $# -gt 0 ] ; do
        --sysdeps) PRINT_SYSDEPS=1; shift ;;
        --nls) WITH_NLS=1 ; shift ;;
        --harvid) WITH_HARVID=1 ; shift ;;
+       --gcc5abi) GCC5ABI=true ; shift ;;
 
        *)
                #catch all for unknown arguments
@@ -168,27 +170,23 @@ Surfaces=$APPLIB/surfaces
 Panners=$APPLIB/panners
 Backends=$APPLIB/backends
 
-Modules=$Libraries/modules
-Loaders=$Libraries/loaders
-
 Templates=$Shared/templates
 ExportFormats=$Shared/export
 Locale=$Shared/locale
 MidiMaps=$Shared/midi_maps
 PatchFiles=$Shared/patchfiles
 MackieControl=$Shared/mcp
-VFork=$Libraries/vfork
 
 if [ x$PRINT_SYSDEPS != x ] ; then
 #
 # print system dependencies
 #
 
-       for file in $APPBIN/* $Libraries/* $Modules/* $Plugins/*.so ; do 
+       for file in $APPBIN/* $Libraries/* $Plugins/*.so ; do
                if ! file $file | grep -qs Mach-O ; then
                        continue
                fi
-               otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)" 
+               otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)"
        done | sort | uniq
        exit 0
 fi
@@ -204,9 +202,6 @@ mkdir -p $APPDIR
 mkdir -p $APPBIN
 mkdir -p $APPLIB
 mkdir -p $Etc
-mkdir -p $Plugins
-mkdir -p $Modules
-mkdir -p $Loaders
 mkdir -p $Shared
 mkdir -p $Locale
 mkdir -p $Surfaces
@@ -218,7 +213,6 @@ mkdir -p $Panners
 mkdir -p $Backends
 mkdir -p $Templates
 mkdir -p $Shared/doc
-mkdir -p $VFork
 
 # maybe set variables
 ENVIRONMENT=environment
@@ -260,7 +254,7 @@ if test x$WITH_NLS != x ; then
        echo "I hope you remembered to run scons msgupdate!"
        LINGUAS=
 
-        for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do 
+        for pkg in gtk2_ardour libs/ardour libs/gtkmm2ext ; do
            files=`find ../../$pkg -name "*.mo"`
 
             #
@@ -277,8 +271,8 @@ if test x$WITH_NLS != x ; then
                echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$pkg"
                echo ""
            fi
-           for file in $files 
+
+           for file in $files
            do
                echo $file
                lang=`basename $file | sed 's/\.mo//'`
@@ -287,7 +281,7 @@ if test x$WITH_NLS != x ; then
                echo copy $file to $Locale/$lang/LC_MESSAGES/`basename $pkg`$vsuffix.mo
                 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
                     :
-                else 
+                else
                    LINGUAS="$LINGUAS $lang"
                 fi
            done
@@ -298,7 +292,7 @@ if test x$WITH_NLS != x ; then
 
        for l in $LINGUAS ; do
                echo "Copying GTK i18n files for $l..."
-               for MO in $GTK_MESSAGES ; do 
+               for MO in $GTK_MESSAGES ; do
                        if [ -f $LOCALEROOT/$l/LC_MESSAGES/$MO ] ; then
                                cp $LOCALEROOT/$l/LC_MESSAGES/$MO $Locale/$l/LC_MESSAGES
                        else
@@ -316,7 +310,7 @@ fi
 
 #
 # Copy stuff that may be dynamically loaded
-# 
+#
 
 cp -R $GTKSTACK_ROOT/etc/* $Etc
 
@@ -342,6 +336,7 @@ if test x$WITH_LADSPA != x ; then
        fi
        echo "Copying `ls $plugdir | wc -l` plugins ..."
        if [ -d $plugdir ] ; then
+               mkdir -p $Plugins
                cp -r $plugdir/* $Plugins
        fi
 fi
@@ -369,9 +364,9 @@ for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
 done
 
 # Templates
-#for f in $BUILD_ROOT/../templates/* ; do 
+#for f in $BUILD_ROOT/../templates/* ; do
 #    if [ -d "$f" ] ; then
-#      echo Template: $f ; cp -r "$f" $Templates ; 
+#      echo Template: $f ; cp -r "$f" $Templates ;
 #    fi
 #done
 
@@ -428,12 +423,12 @@ echo $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 checkedIdx=0
 deplibs=
 
-while [ true ] ; do 
+while [ true ] ; do
        missing=false
        filelist=`find $APPLIB/ -type f`
        filelist="$APPBIN/${EXENAME}-${release_version} $filelist"
 
-       for file in $filelist  ; do 
+       for file in $filelist  ; do
                if ! file $file | grep -qs ELF ; then
                        continue
                fi
@@ -449,13 +444,13 @@ while [ true ] ; do
 
                # ignore suil/qt wrappers - the plugin will pull in QT4.
                if echo $file | grep -qs 'libsuil_.*qt4' ; then continue; fi
-               
+
                # do not include libjack
                deps=`LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | awk '{print $3}'`
 
                echo -n "."
                for dep in $deps ; do
-                       if test "not" = ${dep}; then 
+                       if test "not" = ${dep}; then
                                echo ""
                                echo "!!! ERROR !!! - Missing dependant library for $file."
                                echo "Searched: " $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
@@ -475,10 +470,10 @@ while [ true ] ; do
                        # don't include ALSA
                        if echo $dep | grep -qs libasound ; then continue; fi
                        # don't include any X Window libraries
-                       if echo $dep | grep -qs libX\. ; then continue; fi  
-                       if echo $dep | grep -qs libxcb ; then continue; fi  
-                       if echo $dep | grep -qs libICE\. ; then continue; fi  
-                       if echo $dep | grep -qs libSM\. ; then continue; fi  
+                       if echo $dep | grep -qs libX\. ; then continue; fi
+                       if echo $dep | grep -qs libxcb ; then continue; fi
+                       if echo $dep | grep -qs libICE\. ; then continue; fi
+                       if echo $dep | grep -qs libSM\. ; then continue; fi
                        # don't include libc
                        if echo $dep | grep -qs 'libc\.' ; then continue; fi
                        # don't include libstdc++
@@ -566,9 +561,11 @@ cp -R $BUILD_ROOT/libs/LV2 $APPLIB/
 
 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
 if test -d $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
-       cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2 $APPLIB/LV2/
+       mkdir -p $APPLIB/LV2/lv2core.lv2
+       cp -R $ARDOURSTACK_ROOT/lib/lv2/lv2core.lv2/*.ttl $APPLIB/LV2/lv2core.lv2/
 elif test -d $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 ; then
-       cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2 $APPLIB/LV2/
+       mkdir -p $APPLIB/LV2/lv2core.lv2
+       cp -R $GTKSTACK_ROOT/lib/lv2/lv2core.lv2/*.ttl $APPLIB/LV2/lv2core.lv2/
 fi
 
 # go through and recursively remove any .svn dirs in the bundle
@@ -586,7 +583,7 @@ if test x$WITH_HARRISON_LV2 != x ; then
        curl -s -S --fail -# \
                -z "${CACHEDIR}/harrison_lv2s.${HARCH}.zip" \
                -o "${CACHEDIR}/harrison_lv2s.${HARCH}.zip" \
-               http://www.harrisonconsoles.com/mixbus/mb3/${HARCH}/harrison_lv2s.zip 
+               http://www.harrisonconsoles.com/mixbus/mb3/${HARCH}/harrison_lv2s.zip
        unzip -q -d "$APPLIB/LV2/" "${CACHEDIR}/harrison_lv2s.${HARCH}.zip"
 fi
 
@@ -660,10 +657,18 @@ chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
 #
 # Add the stage2.run script
 #
-sed -e "s/%REPLACE_MAJOR_VERSION%/${major_version}/;s/%REPLACE_PGM%/${APPNAME}/;s/%REPLACE_VENDOR%/${VENDOR}/;s/%REPLACE_EXE%/${EXENAME}/" < stage2.run.in > stage2.run
+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
 chmod a+x stage2.run
 
 
+# gcc4/5 ABI test tool
+if [ -e $BUILD_ROOT/tools/gccabicheck/gcc-glibmm-abi-check ]; then
+       cp $BUILD_ROOT/tools/gccabicheck/gcc-glibmm-abi-check $APPBIN
+else
+       echo "!!!ERROR !!! gcc-glibmm-abi-check program is missing. packager will exit without being complete"
+       exit 1
+fi
+
 #Sanity Check file
 if [ -e $BUILD_ROOT/tools/sanity_check/sanityCheck ]; then
        cp $BUILD_ROOT/tools/sanity_check/sanityCheck $APPBIN