-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgoogle-chrome
70 lines (56 loc) · 2.67 KB
/
google-chrome
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
#!/bin/sh
#
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Let the wrapped binary know that it has been run through the wrapper.
export CHROME_WRAPPER="`readlink -f "$0"`"
ROOT_DIR="`dirname "$CHROME_WRAPPER"`"
CHROME_DIR="$ROOT_DIR/opt/google/chrome"
exec 2>&1 >> "$ROOT_DIR/google-chrome.log"
# Common library are not provided by OpenElec. Add our lib directory
# to LD_LIBRARY_PATH
if [[ -n "$LD_LIBRARY_PATH" ]]; then
LD_LIBRARY_PATH="$ROOT_DIR/usr/lib:/usr/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="$ROOT_DIR/usr/lib:/usr/lib"
fi
export PANGO_RC_FILE="$ROOT_DIR/etc/pango/pangorc"
export GDK_PIXBUF_MODULE_FILE="$ROOT_DIR/etc/gdk_pixbuf-2.0/gdk-pixbuf.loaders"
# Since Google Chrome is not installed in default location, the path to the
# sandbox must be define
export CHROME_DEVEL_SANDBOX="$CHROME_DIR/chrome-sandbox"
# To Flash to use hardware acceleration, a file is required in /etc/adobe/
# So let create the file and use bbe to simulate the path
bbe -e "s#/etc/adobe/#/tmp/adobe/#" "$LIBFLASHPLAYER_SO" -o "$ADDON_HOME/plugins/flash.tmp"
mv "$ADDON_HOME/plugins/flash.tmp" "$LIBFLASHPLAYER_SO"
mkdir -p /tmp/adobe/
echo -e "EnableLinuxHWVideoDecode=1\nOverrideGPUValidation=true" >/tmp/adobe/mms.cfg
# We include some xdg utilities next to the binary, and we want to prefer them
# over the system versions when we know the system versions are very old. We
# detect whether the system xdg utilities are sufficiently new to be likely to
# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
# so that the system xdg utilities (including any distro patches) will be used.
if ! which xdg-settings &> /dev/null; then
# Old xdg utilities. Prepend $CHROME_DIR to $PATH to use ours instead.
export PATH="$CHROME_DIR:$PATH"
else
# Use system xdg utilities. But first create mimeapps.list if it doesn't
# exist; some systems have bugs in xdg-mime that make it fail without it.
xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
mkdir -p "$xdg_app_dir"
[ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
fi
# Always use our versions of ffmpeg libs.
# This also makes RPMs find the compatibly-named NSS3/NSPR symlinks.
if [[ -n "$LD_LIBRARY_PATH" ]]; then
LD_LIBRARY_PATH="$CHROME_DIR:$CHROME_DIR/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="$CHROME_DIR:$CHROME_DIR/lib"
fi
export LD_LIBRARY_PATH
export CHROME_VERSION_EXTRA="stable"
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
echo $LD_LIBRARY_PATH
exec "$CHROME_DIR/chrome" "$@"