summaryrefslogtreecommitdiffstats
path: root/build/linux/AppRun
blob: 2a12f6bdaabd7934efcb65c8ec03fc952eddd826 (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
#!/bin/sh
#
# Copyright (C) Tristan Van Berkom <tristan@upstairslabs.com>
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public 
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Authors:
#   Tristan Van Berkom <tristan@upstairslabs.com>
#

# This is setup by PrepareAppDir.sh
INSTALL_PREFIX=@APP_DIR_ROOT@

# Base environment variables
LD_LIBRARY_PATH=${APPDIR}${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
PATH=${APPDIR}${INSTALL_PREFIX}/bin:${PATH}
XDG_DATA_DIRS=${APPDIR}${INSTALL_PREFIX}/share:${XDG_DATA_DIRS}
export LD_LIBRARY_PATH PATH XDG_DATA_DIRS

# D-Bus, silence fatal warnings, libdbus is in the mix but we don't need a D-Bus environment for Glade
DBUS_FATAL_WARNINGS=0
export DBUS_FATAL_WARNINGS

# Pango environment variables
PANGO_RC_FILE=${APPDIR}/pangorc
export PANGO_RC_FILE

# GTK+/GIO/GdkPixbuf environment variables
# http://askubuntu.com/questions/251712/how-can-i-install-a-gsettings-schema-without-root-privileges
GSETTINGS_SCHEMA_DIR=${APPDIR}${INSTALL_PREFIX}/share/glib-2.0/schemas/:${GSETTINGS_SCHEMA_DIR}
GDK_PIXBUF_MODULE_FILE=${APPDIR}${INSTALL_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
GTK_PATH=${APPDIR}${INSTALL_PREFIX}/lib/gtk-3.0
GTK_DATA_PREFIX=${APPDIR}${INSTALL_PREFIX}
GTK_THEME=Adwaita
export GSETTINGS_SCHEMA_DIR GDK_PIXBUF_MODULE_FILE GTK_PATH GTK_DATA_PREFIX GTK_THEME

# Glade environment variables
GLADE_CATALOG_SEARCH_PATH=${APPDIR}${INSTALL_PREFIX}/share/glade/catalogs
GLADE_MODULE_SEARCH_PATH=${APPDIR}${INSTALL_PREFIX}/lib/glade/modules
GLADE_PIXMAP_DIR=${APPDIR}${INSTALL_PREFIX}/share/glade/pixmaps
GLADE_BUNDLED=1
export GLADE_CATALOG_SEARCH_PATH GLADE_MODULE_SEARCH_PATH GLADE_PIXMAP_DIR GLADE_BUNDLED

# Currently we change into the APPDIR directory, this only because of gdk-pixbuf
# and pango cache files which need to specify relative paths.
cd ${APPDIR}

if test -z ${APP_IMAGE_TEST}; then
# Invoke Glade with the arguments passed
    ${APPDIR}${INSTALL_PREFIX}/bin/glade $*
else
# Run a shell in test mode
    bash;
fi