X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Flinux_packaging%2Fardour.sh.in;h=a6bd679b94266656dd07a16fa4068395b8a71931;hb=b9ba91ac1d20fb57eb19a6639080ae45244436b8;hp=c36e91bc246eee778536a45b0718075adafd63fe;hpb=1fb74e6818c6f19f27ef36ab351da36c0e5b0e26;p=ardour.git diff --git a/tools/linux_packaging/ardour.sh.in b/tools/linux_packaging/ardour.sh.in index c36e91bc24..a6bd679b94 100644 --- a/tools/linux_packaging/ardour.sh.in +++ b/tools/linux_packaging/ardour.sh.in @@ -1,34 +1,51 @@ #!/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:+:$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 -USER_ARDOUR_DIR=$HOME/.ardour2 - -if [ ! -d $USER_ARDOUR_DIR ] ; then - mkdir -p $USER_ARDOUR_DIR || exit 1 -fi # 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% -export GTK_PATH=$INSTALL_DIR${GTK_PATH:+:$GTK_PATH} +# 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} -# create install-location-dependent config files for Pango and GDK image loaders -# We have to do this every time because its possible that BIN_DIR has changed - -sed "s?@ROOTDIR@/modules?$LIB_DIR/modules?" < $ETC_DIR/pango.modules.in > $USER_ARDOUR_DIR/pango.modules -sed "s?@ROOTDIR@/loaders?$LIB_DIR/loaders?" < $ETC_DIR/gdk-pixbuf.loaders.in > $USER_ARDOUR_DIR/gdk-pixbuf.loaders - -exec $INSTALL_DIR/bin/ardour-2.8.11 "$@" - - - +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