-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AppImage: Don't set LD_LIBRARY_PATH (LMMS#7686)
Don't set LD_LIBRARY_PATH Move launch_lmms.sh to dedicated apprun-hooks
- Loading branch information
Showing
10 changed files
with
99 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
# 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_NAME="libcarla_native-plugin.so" | ||
KNOWN_LOCATIONS=("lib" "lib64") | ||
unset CARLA_LIB_FILE | ||
|
||
# Check for carla at "known" locations | ||
if command -v carla > /dev/null 2>&1; then | ||
CARLA_PATH="$(command -v carla)" | ||
CARLA_PREFIX="${CARLA_PATH%/bin*}" | ||
|
||
# Look for libcarla_native-plugin.so in adjacent lib directory | ||
for lib in "${KNOWN_LOCATIONS[@]}"; do | ||
if [ -e "$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME" ]; then | ||
# Add directory to LD_LIBRARY_PATH so libcarlabase.so can find it | ||
CARLA_LIB_FILE="$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME" | ||
export LD_LIBRARY_PATH="$CARLA_PREFIX/$lib/carla/:$LD_LIBRARY_PATH" | ||
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 "[$ME] Carla does not appear to be installed. That's OK, please ignore any related library errors." >&2 | ||
fi | ||
|
||
# Additional workarounds for library conflicts | ||
# libgobject has been versioned "2.0" for over 20 years, but the ABI is constantly changing | ||
KNOWN_CONFLICTS=("libgobject-2.0.so.0") | ||
if [ -n "$CARLA_LIB_FILE" ]; then | ||
for conflict in "${KNOWN_CONFLICTS[@]}"; do | ||
# Only prepend LD_PRELOAD if we bundle the same version | ||
if [ -e "$DIR/usr/lib/$conflict" ]; then | ||
conflict_sys="$(ldd "$CARLA_LIB_FILE" | grep "$conflict" | awk '{print $3}')" | ||
if [ -e "$conflict_sys" ]; then | ||
# Add library to LD_PRELOAD so lmms can find it over its bundled version | ||
echo "[$ME] Preferring the system's \"$conflict\" over the version bundled." >&2 | ||
export LD_PRELOAD="$conflict_sys:$LD_PRELOAD" | ||
fi | ||
fi | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# 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 "[$ME] Jack appears to be installed on this system, so we'll use it." >&2 | ||
else | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Workaround Unity desktop menubar integration | ||
# - Unity's menubar relocation breaks Qt's MDI window handling in Linux | ||
# - Unity was default in Ubuntu 11.04 - 18.04 | ||
if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]; then | ||
export QT_X11_NO_NATIVE_MENUBAR=1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Workaround libraries being incorrectly placed in usr/lib (e.g. instead of usr/lib/lmms, etc) | ||
# FIXME: Remove when linuxdeploy supports subfolders https://github.com/linuxdeploy/linuxdeploy/issues/305 | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" | ||
export LMMS_PLUGIN_DIR="$DIR/usr/lib/" | ||
export LADSPA_PATH="$DIR/usr/lib/" | ||
export SUIL_MODULE_DIR="$DIR/usr/lib/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 "[$ME] VirtualBox detected. Forcing libgl software rendering." >&2 | ||
export LIBGL_ALWAYS_SOFTWARE=1; | ||
fi |
This file was deleted.
Oops, something went wrong.