Add some lua scripts
[ardour.git] / tools / linux_packaging / ardour.sh.in
1 #!/bin/sh
2
3 # This is Linux-specific startup script for a bundled version of Ardour
4
5 checkdebug(){
6     for arg in "$@"
7         do
8             case "$arg" in
9                 --gdb )
10                     DEBUG="T"
11             esac
12         done
13 }
14
15 checkdebug "$@"
16
17
18 # LD_LIBRARY_PATH needs to be set here so that epa can swap between the original and the bundled version
19 # (the original one will be stored in PREBUNDLE_ENV)
20 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
21 export PREBUNDLE_ENV="$(env)"
22
23 BIN_DIR=$(dirname $(readlink -f $0))
24 INSTALL_DIR=$(dirname $BIN_DIR)
25 LIB_DIR=$INSTALL_DIR/lib
26 ETC_DIR=$INSTALL_DIR/etc
27
28 # this triggers code in main() that will reset runtime environment variables
29 # to point to directories inside the ardour package
30
31 export ARDOUR_BUNDLED=true
32
33 # NSM needs a path to this script
34 export ARDOUR_SELF=`basename "$0"`
35
36
37 # this is edited by the build script to include relevant environment variables
38
39 %ENV%
40
41 # Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
42 export GTK_MODULES=""
43 # Set this so that the executable will find all the right libraries inside the bundle
44 export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
45
46 if [ "T" = "$DEBUG" ]; then
47         export ARDOUR_INSIDE_GDB=1
48         exec gdb $INSTALL_DIR/bin/%EXENAME%-%VER%
49 else
50         exec %WINE% $INSTALL_DIR/bin/%EXENAME%-%VER% "$@"
51 fi