X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Flinux_packaging%2Fstage2.run.in;h=75f48cc1706a42b3dbdd9fce4439482fe5578ad2;hb=927a33c5f3a0f67adea222aad34bbf435c61f6ca;hp=445643b573b2705d82b3e02a31658ecac958c83a;hpb=f0d40fb34a8975972fad9b196808c667fe323a8d;p=ardour.git diff --git a/tools/linux_packaging/stage2.run.in b/tools/linux_packaging/stage2.run.in index 445643b573..75f48cc170 100755 --- a/tools/linux_packaging/stage2.run.in +++ b/tools/linux_packaging/stage2.run.in @@ -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 @@ -500,7 +531,7 @@ else fi PGM_EXEC_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/${PGM_EXEC_FILE}" -ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share/icons" +ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share/resources" MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share" ################################ @@ -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 @@ -563,15 +594,15 @@ ${SUPER} mv /tmp/${MENU_FILE} ${MENU_FILE_PATH}/. if [ "T" = ${HAS_XDG} ]; then echo "Adding ${PGM_NAME} to the applications menu" - ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_16px.png ${ICON_NAME} - ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_22px.png ${ICON_NAME} - ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_32px.png ${ICON_NAME} - ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_48px.png ${ICON_NAME} - ${SUPER} xdg-icon-resource install --context apps --size 256 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_256px.png ${ICON_NAME} + ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME}-icon_16px.png ${ICON_NAME} + ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME}-icon_22px.png ${ICON_NAME} + ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME}-icon_32px.png ${ICON_NAME} + ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME}-icon_48px.png ${ICON_NAME} + ${SUPER} xdg-icon-resource install --context apps --size 256 ${ICON_PATH}/${PGM_NAME}-icon_256px.png ${ICON_NAME} - if [ -e ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ]; + if [ -e ${ICON_PATH}/${PGM_NAME}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ]; then - ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg + ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME}_icon.svg /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg fi ${SUPER} xdg-desktop-menu install ${MENU_FILE_PATH}/${MENU_FILE} @@ -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}')