summaryrefslogtreecommitdiff
path: root/tools/linux_packaging/ardour.sh.in
blob: 7b3f51dbec62a6e08c87bdec581d0b4735fef9cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh

# This is Linux-specific startup script for a bundled version of Ardour

ARGS=""

while [ $# -gt 0 ] ; do
	case $1 in

	--debug)
		DEBUG="T";
		shift ;;
	*)
		ARGS=$ARGS$1" ";
		shift; ;;
	esac
done

#LD_LIBRARY_PATH needs to be set (empty) so that epa can swap between the original and the bundled version
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

# this is edited by the build script to include relevant environment variables

%ENV%

export GTK_PATH=$INSTALL_DIR/libs/clearlooks${GTK_PATH:+:$GTK_PATH}
export GTK_MODULES=""		# Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
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


# Hack to fix i18n issue where the grid button gets translated even when translations are disabled.

if [ ! -e $USER_ARDOUR_DIR/.love_is_the_language_of_audio ]; then
	# Translations are disabled. Force english, except for numerics and time/date
        if [ x$LANG != x ] ; then 
            if [ x$LC_NUMERIC = x ] ; then
                export LC_NUMERIC=$LANG
            fi
            if [ x$LC_TIME = x ] ; then
                export LC_TIME=$LANG
            fi
        fi
	export LANG=C
fi


if [ "T" = "$DEBUG" ]; then
	export ARDOUR_INSIDE_GDB=1
	exec gdb $INSTALL_DIR/bin/ardour-%VER%
else
	exec $INSTALL_DIR/bin/ardour-%VER% $ARGS
fi