replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / tools / linux_packaging / stage2.run.in
index 5241e806d4592a33c279ada9782f904c18dccb26..75f48cc1706a42b3dbdd9fce4439482fe5578ad2 100755 (executable)
@@ -31,6 +31,7 @@ USER_NAME=$(logname)
 
 #### Global Variables ####
 HAS_XDG="T"
+MULTABI_BUNDLE=""
 
 ########################
 # Function Definitions
@@ -229,6 +230,42 @@ case `uname -m` in
                ;;
 esac
 
+###################
+# Determine gcc ABI
+###################
+
+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
 ####################
@@ -237,15 +274,15 @@ esac
 # in case they are on different devices
 echo "Checking for required disk space"
 
-if [ ! -e .${PGM_NAME}_${ARCH}-*.size ]; then
+if [ ! -e .${PGM_NAME}_${ARCH}${ABI}-*.size ]; then
        echo ""
-       echo "!!! ERROR !!! Can't locate .size file for ${ARCH} bundle."
-       echo "This package is broken or does not support ${ARCH}."
+       echo "!!! ERROR !!! Can't locate .size file for ${ARCH}${ABI} bundle."
+       echo "This package is broken or does not support ${ARCH}${ABI}."
        echo ""
        read -p "Press ENTER to exit installer:" BLAH
        exit 1
 else
-       REQUIRED_BYTES=$(cat .${PGM_NAME}_${ARCH}-*.size)
+       REQUIRED_BYTES=$(cat .${PGM_NAME}_${ARCH}${ABI}-*.size)
 
        #Installer needs 2x the space since the bundle is unpacked locally and then copied
        REQUIRED_BYTES=$(($REQUIRED_BYTES + $REQUIRED_BYTES))
@@ -281,34 +318,36 @@ fi
 # Determine C11 stdlibc++ ABI
 #############################
 
-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
-               echo ""
-               echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
-               echo ""
-               echo "${PGM_NAME} was compiled with gcc5, your system uses an older version of the"
-               echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
-               echo "may cause crashes."
-               echo ""
-               ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
-               if test "n" = $ANSWER; then
-                       exit 1
+if test -z "$ABI"; then
+       if %REPLACE_GCC5%; then
+               # Ardour was compiled with gcc5, warn on gcc4 systems
+               if ! "${PKG_PATH}/.gcc-glibmm-abi-check" --gcc5; then
+                       echo ""
+                       echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
+                       echo ""
+                       echo "${PGM_NAME} was compiled with gcc5, your system uses an older version of the"
+                       echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
+                       echo "may cause crashes."
+                       echo ""
+                       ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
+                       if test "n" = $ANSWER; then
+                               exit 1
+                       fi
                fi
-       fi
-else
-       # Ardour was compiled with gcc4, warn on gcc5 systems
-       if ! ${NORM_USER} "${PKG_PATH}/.gcc-glibmm-abi-check --gcc4 > /dev/null"; then
-               echo ""
-               echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
-               echo ""
-               echo "${PGM_NAME} was compiled with gcc4, your system uses a newer version of the"
-               echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
-               echo "may cause crashes."
-               echo ""
-               ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
-               if test "n" = $ANSWER; then
-                       exit 1
+       else
+               # Ardour was compiled with gcc4, warn on gcc5 systems
+               if ! "${PKG_PATH}/.gcc-glibmm-abi-check" --gcc4 ; then
+                       echo ""
+                       echo "WARNING: GCC4/5 libstdc++ ABI Mismatch"
+                       echo ""
+                       echo "${PGM_NAME} was compiled with gcc4, your system uses a newer version of the"
+                       echo "standard c++ library. Plugins on your system may not load or plugin-UIs"
+                       echo "may cause crashes."
+                       echo ""
+                       ANSWER=$(VaildateYesNoQuestion "Continue anyway?")
+                       if test "n" = $ANSWER; then
+                               exit 1
+                       fi
                fi
        fi
 fi
@@ -334,19 +373,11 @@ FILESYSTEM_TYPE=$(df -P -T "${PKG_PATH}" | grep / | awk '{print $2}')
 echo "Bundle is on ${FILESYSTEM_TYPE} filesystem"
 
 # untar the correct bundle for us to install
-echo "Unpacking bundle for $ARCH"
+echo "Unpacking bundle for $ARCH${ABI}"
 
-if [ ! -e ${PGM_NAME}_${ARCH}-*.tar.bz2 ]; then
+if ! tar -xf ${PGM_NAME}_${ARCH}${ABI}-*.tar; then
        echo ""
-       echo "!!! ERROR !!! Can't locate ${ARCH} bundle file."
-       echo ""
-       read -p "Press ENTER to exit installer:" BLAH
-       exit 1
-fi
-
-if ! tar -xjf ${PGM_NAME}_${ARCH}-*.tar.bz2; then
-       echo ""
-       echo "!!! ERROR !!! Can't unpack ${ARCH} bundle file."
+       echo "!!! ERROR !!! Can't unpack ${ARCH}${ABI} bundle file."
        echo ""
        read -p "Press ENTER to exit installer:" BLAH
        exit 1
@@ -508,7 +539,7 @@ MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share"
 ################################
 
 # uninstall any older versions
-UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}*.uninstall.sh")
+UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}-*.uninstall.sh")
 if [ ! -z "$UNINSTALLERS" ];
 then
        for i in $UNINSTALLERS; do
@@ -579,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 ""
@@ -633,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?")
@@ -660,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}')