only disable text translations, not numerics or time
[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 ARGS=""
6
7 while [ $# -gt 0 ] ; do
8         case $1 in
9
10         --debug)
11                 DEBUG="T";
12                 shift ;;
13         *)
14                 ARGS=$ARGS$1" ";
15                 shift; ;;
16         esac
17 done
18
19 #LD_LIBRARY_PATH needs to be set (empty) so that epa can swap between the original and the bundled version
20 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
21
22 export PREBUNDLE_ENV="$(env)"
23
24 BIN_DIR=$(dirname $(readlink -f $0))
25 INSTALL_DIR=$(dirname $BIN_DIR)
26 LIB_DIR=$INSTALL_DIR/lib
27 ETC_DIR=$INSTALL_DIR/etc
28 USER_ARDOUR_DIR=$HOME/.ardour2
29
30 if [ ! -d $USER_ARDOUR_DIR ] ; then
31     mkdir -p $USER_ARDOUR_DIR || exit 1
32 fi
33
34 # this triggers code in main() that will reset runtime environment variables
35 # to point to directories inside the ardour package
36
37 export ARDOUR_BUNDLED=true
38
39 # this is edited by the build script to include relevant environment variables
40
41 %ENV%
42
43 export GTK_PATH=$INSTALL_DIR/libs/clearlooks${GTK_PATH:+:$GTK_PATH}
44 export GTK_MODULES=""           # Disable extra modules from being loaded by gtk (example, libcanberra-gtk-module.so)
45 export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
46
47 # create install-location-dependent config files for Pango and GDK image loaders
48 # We have to do this every time because its possible that BIN_DIR has changed
49
50 sed "s?@ROOTDIR@/modules?$LIB_DIR/modules?" < $ETC_DIR/pango.modules.in > $USER_ARDOUR_DIR/pango.modules
51 sed "s?@ROOTDIR@/loaders?$LIB_DIR/loaders?" < $ETC_DIR/gdk-pixbuf.loaders.in > $USER_ARDOUR_DIR/gdk-pixbuf.loaders
52
53
54 # Hack to fix i18n issue where the grid button gets translated even when translations are disabled.
55
56 if [ ! -e $USER_ARDOUR_DIR/.love_is_the_language_of_audio ]; then
57         # Translations are disabled. Force english, except for numerics and time/date
58         if [ x$LANG != x ] ; then 
59             if [ x$LC_NUMERIC = x ] ; then
60                 export LC_NUMERIC=$LANG
61             fi
62             if [ x$LC_TIME = x ] ; then
63                 export LC_TIME=$LANG
64             fi
65         fi
66         export LANG=C
67 fi
68
69
70 if [ "T" = "$DEBUG" ]; then
71         export ARDOUR_INSIDE_GDB=1
72         exec gdb $INSTALL_DIR/bin/ardour-%VER%
73 else
74         exec $INSTALL_DIR/bin/ardour-%VER% $ARGS
75 fi
76
77
78