replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / tools / linux_packaging / stage2.run.in
index 2d8d08dc853f52cf51aaeab970fe64c1e4137f4b..75f48cc1706a42b3dbdd9fce4439482fe5578ad2 100755 (executable)
@@ -234,16 +234,38 @@ esac
 # Determine gcc ABI
 ###################
 
-if -n "$MULTABI_BUNDLE"; then
-       if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc5 > /dev/null"; then
+if test -n "$MULTABI_BUNDLE"; then
+       if ! "${PKG_PATH}/.gcc-glibmm-abi-check" --fail --gcc5; then
                ABI=-gcc4
        else
                ABI=-gcc5
        fi
+  # allow to manually override
+       if test "$1" = "--gcc4"; then
+               ABI=-gcc4
+       fi
+       if test "$1" = "--gcc5"; then
+               ABI=-gcc5
+       fi
 else
        ABI=
 fi
 
+####################################
+# Check if bundle is for this system
+####################################
+
+if [ ! -e ${PGM_NAME}_${ARCH}${ABI}-*.tar ]; then
+       echo ""
+       echo "!!! ERROR !!! Can't locate ${ARCH}${ABI} bundle file."
+       echo "The installer detected the system as ${ARCH}${ABI}, but this bundle"
+       echo "does not contain the files needed for that configuration."
+       echo ""
+       read -p "Press ENTER to exit installer:" BLAH
+       exit 1
+fi
+
+
 ####################
 # Check disk space
 ####################
@@ -296,10 +318,10 @@ fi
 # Determine C11 stdlibc++ ABI
 #############################
 
-if -z "$ABI"; then
+if test -z "$ABI"; then
        if %REPLACE_GCC5%; then
                # Ardour was compiled with gcc5, warn on gcc4 systems
-               if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc5 > /dev/null"; then
+               if ! "${PKG_PATH}/.gcc-glibmm-abi-check" --gcc5; then
                        echo ""
                        echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
                        echo ""
@@ -314,7 +336,7 @@ if -z "$ABI"; then
                fi
        else
                # Ardour was compiled with gcc4, warn on gcc5 systems
-               if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc4 > /dev/null"; then
+               if ! "${PKG_PATH}/.gcc-glibmm-abi-check" --gcc4 ; then
                        echo ""
                        echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
                        echo ""
@@ -353,14 +375,6 @@ echo "Bundle is on ${FILESYSTEM_TYPE} filesystem"
 # untar the correct bundle for us to install
 echo "Unpacking bundle for $ARCH${ABI}"
 
-if [ ! -e ${PGM_NAME}_${ARCH}${ABI}-*.tar ]; then
-       echo ""
-       echo "!!! ERROR !!! Can't locate ${ARCH}${ABI} bundle file."
-       echo ""
-       read -p "Press ENTER to exit installer:" BLAH
-       exit 1
-fi
-
 if ! tar -xf ${PGM_NAME}_${ARCH}${ABI}-*.tar; then
        echo ""
        echo "!!! ERROR !!! Can't unpack ${ARCH}${ABI} bundle file."
@@ -371,7 +385,7 @@ else
        echo "Bundle unpacked"
 fi
 
-BUNDLE_DIR=$(basename `find -maxdepth 1 -type d -name "${PGM_NAME}_${ARCH}${ABI}-*"`)
+BUNDLE_DIR=$(basename `find -maxdepth 1 -type d -name "${PGM_NAME}_${ARCH}-*"`)
 
 
 #######################
@@ -596,13 +610,13 @@ then
        
        echo ""
        echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
-       cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
-       chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
+       cp ${MENU_FILE_PATH}/${MENU_FILE} "${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}"
+       chmod ugo+rwx "${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}"
 else
        echo ""
        echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
-       cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
-       chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
+       cp ${MENU_FILE_PATH}/${MENU_FILE} "${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}"
+       chmod ugo+rwx "${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}"
 fi
 
 echo ""
@@ -650,7 +664,10 @@ elif which jackdbus > /dev/null; then
        JACK_INSTALLED="i"
 else
        echo ""
-       echo "The program Jack is missing from this system. Jack is a required component of $PGM_NAME."
+       echo "The program Jack is missing from this system."
+       echo ""
+       echo "Jack is a very useful utility to allow you to interconnect $PGM_NAME and other audio/MIDI applications."
+       echo "You can use $PGM_NAME without it, but you may find it useful to have around."
        echo ""
 
        ANSWER=$(VaildateYesNoQuestion "Install jack using system software repository?")
@@ -677,7 +694,7 @@ then
        JACK_VERSION_OK="f"
        JACK_VER_STRING=$(jackd --version | grep -e "jackd.*protocol")
        JACK_NAME=$(echo $JACK_VER_STRING | awk '{print $1}')
-       JACK_VERSION=$(echo $JACK_VER_STRING | awk '{print $3}')
+       JACK_VERSION=$(echo $JACK_VER_STRING | awk '{print $3}' | sed 's/-.*$//')
        JACK_VERSION_MAJOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $1}')
        JACK_VERSION_MIDDLE=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $2}')
        JACK_VERSION_MINOR=$(echo $JACK_VERSION | awk 'BEGIN{FS="."}{print $3}')