13
0
livetrax/tools/linux_packaging/ardour.sh.in
nickolas360 8bc7154130 Fix LD_LIBRARY_PATH in GNU/Linux startup script
Currently, the startup script for GNU/Linux adds the current working directory
to LD_LIBRARY_PATH if LD_LIBRARY_PATH is not empty or unset.

For example, if LD_LIBRARY_PATH is set to "/lib" when the current script is
run, it will be set to "<install-dir>/lib::/lib", which includes the current
working directory as one of the paths.

This commit removes the extra colon added to LD_LIBRARY_PATH (without changing
the script's behavior of setting LD_LIBRARY_PATH to an empty string when it is
unset).
2017-07-18 19:11:18 +02:00

52 lines
1.3 KiB
Bash

#!/bin/sh
# This is Linux-specific startup script for a bundled version of Ardour
checkdebug(){
for arg in "$@"
do
case "$arg" in
--gdb )
DEBUG="T"
esac
done
}
checkdebug "$@"
# LD_LIBRARY_PATH needs to be set here so that epa can swap between the original and the bundled version
# (the original one will be stored in PREBUNDLE_ENV)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export PREBUNDLE_ENV="$(env)"
BIN_DIR=$(dirname $(readlink -f $0))
INSTALL_DIR=$(dirname $BIN_DIR)
LIB_DIR=$INSTALL_DIR/lib
ETC_DIR=$INSTALL_DIR/etc
# this triggers code in main() that will reset runtime environment variables
# to point to directories inside the ardour package
export ARDOUR_BUNDLED=true
# NSM needs a path to this script
export ARDOUR_SELF=`basename "$0"`
# this is edited by the build script to include relevant environment variables
%ENV%
# Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
export GTK_MODULES=""
# Set this so that the executable will find all the right libraries inside the bundle
export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
if [ "T" = "$DEBUG" ]; then
export ARDOUR_INSIDE_GDB=1
exec gdb $INSTALL_DIR/bin/%EXENAME%-%VER%
else
exec %WINE% $INSTALL_DIR/bin/%EXENAME%-%VER% "$@"
fi