diff --git a/cmake/linux/apprun-hooks/README.md b/cmake/linux/apprun-hooks/README.md index b6a6a7ae8d7..2bac9f1cb8b 100644 --- a/cmake/linux/apprun-hooks/README.md +++ b/cmake/linux/apprun-hooks/README.md @@ -1,3 +1,11 @@ -When placed in `LMMS.AppDir/apprun-hooks`, linuxdeploy will automatically add scripts to startup. +# AppRun Hooks + +Scripts placed in this directory will automatically be bundled into AppImages +(e.g. `LMMS.AppDir/apprun-hooks`) and executed immediately before lmms. + +Quoting: + +> "Sometimes it's important to perform actions before running the actual app. Some plugins might have to set e.g., +> environment variables to work properly." See also: https://github.com/linuxdeploy/linuxdeploy/wiki/Plugin-system#apprun-hooks \ No newline at end of file diff --git a/cmake/linux/apprun-hooks/carla-hook.sh b/cmake/linux/apprun-hooks/carla-hook.sh index c7930a127c7..c006ce7ba5f 100644 --- a/cmake/linux/apprun-hooks/carla-hook.sh +++ b/cmake/linux/apprun-hooks/carla-hook.sh @@ -2,6 +2,7 @@ # Workaround nuances with carla being an optional-yet-hard-linked plugin DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +ME="$( basename "${BASH_SOURCE[0]}")" CARLA_LIB="libcarla_native-plugin.so" KNOWN_LOCATIONS=("lib" "lib64") @@ -17,12 +18,12 @@ if command -v carla > /dev/null 2>&1; then # Add library to LD_PRELOAD so libcarlabase.so can find it carla_lib_found=true export LD_PRELOAD="$CARLA_PREFIX/$lib/carla/${CARLA_LIB}:$LD_PRELOAD" - echo "Carla appears to be installed on this system at $CARLA_PREFIX/$lib so we'll use it." >&2 + echo "[$ME] Carla appears to be installed on this system at $CARLA_PREFIX/$lib/carla so we'll use it." >&2 break fi done else - echo "Carla does not appear to be installed. That's OK, please ignore any related library errors." >&2 + echo "[$ME] Carla does not appear to be installed. That's OK, please ignore any related library errors." >&2 fi # Additional workarounds for library conflicts @@ -43,13 +44,13 @@ if [ "$carla_lib_found" = true ]; then conflict_sys="$("$cmd" -p |grep "$(arch)" |grep "$conflict" |head -n 1 |awk '{print $4}')" if [ -e "$conflict_sys" ]; then # Add library to LD_PRELOAD so lmms can find it over its bundled version - echo "Preferring the system's $conflict over the version we bundle." >&2 + echo "[$ME] Preferring the system's $conflict over the version we bundle." >&2 export LD_PRELOAD="$conflict_sys:$LD_PRELOAD" fi fi fi done else - echo "Unable to locate ldconfig, skipping workaround for" "${KNOWN_CONFLICTS[@]}" >&2 + echo "[$ME] Unable to locate ldconfig, skipping workaround for" "${KNOWN_CONFLICTS[@]}" >&2 fi fi \ No newline at end of file diff --git a/cmake/linux/apprun-hooks/jack-hook.sh b/cmake/linux/apprun-hooks/jack-hook.sh index 6367cda46b3..54cef19ec53 100644 --- a/cmake/linux/apprun-hooks/jack-hook.sh +++ b/cmake/linux/apprun-hooks/jack-hook.sh @@ -2,9 +2,10 @@ # Workaround crash when jack is missing by providing a dummy version DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +ME="$( basename "${BASH_SOURCE[0]}")" 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." >&2 + echo "[$ME] Jack appears to be installed on this system, so we'll use it." >&2 else - echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2 + echo "[$ME] Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2 export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH fi \ No newline at end of file diff --git a/cmake/linux/apprun-hooks/vbox-hook.sh b/cmake/linux/apprun-hooks/vbox-hook.sh index fbc93dfe9c9..aeab4d138d8 100644 --- a/cmake/linux/apprun-hooks/vbox-hook.sh +++ b/cmake/linux/apprun-hooks/vbox-hook.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash - +ME="$( basename "${BASH_SOURCE[0]}")" # Workaround crash in VirtualBox when hardware rendering is enabled if lsmod |grep vboxguest > /dev/null 2>&1; then - echo "VirtualBox detected. Forcing libgl software rendering." >&2 + echo "[$ME] VirtualBox detected. Forcing libgl software rendering." >&2 export LIBGL_ALWAYS_SOFTWARE=1; fi \ No newline at end of file