From 55b65527c3858fb82bf465de8786071752146e4d Mon Sep 17 00:00:00 2001 From: Shmuel H Date: Fri, 1 Nov 2019 07:26:38 +0200 Subject: [PATCH] appimage: move launcher code into launch_lmms.sh. --- cmake/linux/launch_lmms.sh | 24 ++++++++++++++++++++++++ cmake/linux/package_linux.sh.in | 31 +++---------------------------- 2 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 cmake/linux/launch_lmms.sh diff --git a/cmake/linux/launch_lmms.sh b/cmake/linux/launch_lmms.sh new file mode 100644 index 000000000..4a0eb30e2 --- /dev/null +++ b/cmake/linux/launch_lmms.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export PATH="$PATH:/sbin" +if which carla > /dev/null 2>&1; then + CARLAPATH="$(which carla)" + CARLAPREFIX="${CARLAPATH%/bin*}" + echo "Carla appears to be installed on this system at $CARLAPREFIX/lib[64]/carla so we'll use it." + export LD_LIBRARY_PATH=$CARLAPREFIX/lib/carla:$CARLAPREFIX/lib64/carla:$LD_LIBRARY_PATH +else + echo "Carla does not appear to be installed. That's OK, please ignore any related library errors." +fi +export LD_LIBRARY_PATH=$DIR/usr/lib/:$DIR/usr/lib/lmms:$LD_LIBRARY_PATH +# Prevent segfault on VirualBox +if lsmod |grep vboxguest > /dev/null 2>&1; then + echo "VirtualBox detected. Forcing libgl software rendering." + export LIBGL_ALWAYS_SOFTWARE=1; +fi +if ldconfig -p | grep libjack.so.0 > /dev/null 2>&1; then + echo "Jack appears to be installed on this system, so we'll use it." +else + echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." + export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH +fi +QT_X11_NO_NATIVE_MENUBAR=1 $DIR/usr/bin/lmms.real "$@" \ No newline at end of file diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index 7c0e2593b..cb3764dcb 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -96,37 +96,12 @@ cp -R /usr/share/stk/rawwaves/ "${APPDIR}usr/share/stk/" # Create a wrapper script which calls the lmms executable mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real" -# shellcheck disable=SC1083 -cat >"${APPDIR}usr/bin/lmms" < /dev/null 2>&1; then - CARLAPATH="\$(which carla)" - CARLAPREFIX="\${CARLAPATH%/bin*}" - echo "Carla appears to be installed on this system at \$CARLAPREFIX/lib[64]/carla so we'll use it." - export LD_LIBRARY_PATH=\$CARLAPREFIX/lib/carla:\$CARLAPREFIX/lib64/carla:\$LD_LIBRARY_PATH -else - echo "Carla does not appear to be installed. That's OK, please ignore any related library errors." -fi -export LD_LIBRARY_PATH=\$DIR/usr/lib/:\$DIR/usr/lib/lmms:\$LD_LIBRARY_PATH -# Prevent segfault on VirualBox -if lsmod |grep vboxguest > /dev/null 2>&1; then - echo "VirtualBox detected. Forcing libgl software rendering." - export LIBGL_ALWAYS_SOFTWARE=1; -fi -if ldconfig -p | grep libjack.so.0 > /dev/null 2>&1; then - echo "Jack appears to be installed on this system, so we'll use it." -else - echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." - export LD_LIBRARY_PATH=\$DIR/usr/lib/lmms/optional:\$LD_LIBRARY_PATH -fi -QT_X11_NO_NATIVE_MENUBAR=1 \$DIR/usr/bin/lmms.real "\$@" -EOL + +cp "@CMAKE_CURRENT_SOURCE_DIR@/launch_lmms.sh" "${APPDIR}usr/bin/lmms" chmod +x "${APPDIR}usr/bin/lmms" -# Per https://github.com/probonopd/linuxdeployqt/issues/129 +# Per https://github.com/probonopd/linuxdeployqt/issues/129 unset LD_LIBRARY_PATH # Ensure linuxdeployqt can find shared objects