~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/chromium-browser.sh.in

  • Committer: Chad MILLER
  • Date: 2015-03-27 00:56:55 UTC
  • Revision ID: chad.miller@canonical.com-20150327005655-j4hcr8bscbjjjjyu
Prepare for snappy building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
usage () {
64
64
  echo "$APPNAME [-h|--help] [-g|--debug] [--temp-profile] [--no-touch-pinch] [options] [URL]"
65
65
  echo
66
 
  echo "        --verbose               Events logged to stderr."
67
66
  echo "        -g or --debug           Start within $GDB"
68
67
  echo "        -h or --help            This help screen"
69
68
  echo "        --temp-profile          Start with a new and temporary profile"
74
73
  echo " See 'man chromium-browser' for more details"
75
74
}
76
75
 
 
76
# Work around crbug.com/415681
 
77
lsmod |grep ^i915\  >/dev/null && export LIBGL_DRI3_DISABLE=1
 
78
 
77
79
if [ -f /etc/$APPNAME/default ] ; then
78
80
  . /etc/$APPNAME/default
79
81
fi
80
82
 
 
83
 
81
84
if test -d /etc/$APPNAME/customizations; then
82
85
        while read f; do
83
86
                . "$f"
85
88
fi
86
89
test -f ~/.chromium-browser.init && . ~/.chromium-browser.init
87
90
 
88
 
FLASH_GOOD_PACKAGE="adobe-flashplugin"
89
 
if test "$FLASH_GOOD_PACKAGE"; then
90
 
        PREVIOUS_CANDIDATE=""
91
 
        CANDIDATE="$CHROMIUM_FLAGS"
92
 
        while test "$PREVIOUS_CANDIDATE" != "$CANDIDATE"; do  # Strip ppapi-flash-xxxx params off that are outside our known good params, for as long as we still make progress.
93
 
                PREVIOUS_CANDIDATE="$CANDIDATE"
94
 
                CANDIDATE=$(echo "$CANDIDATE" |sed -e "s,--ppapi-flash-\w*=\S*\s\(.*--ppapi-flash-path=/usr/lib/${FLASH_GOOD_PACKAGE}/libpepflashplayer.so --ppapi-flash-version=\),\1,")
95
 
                CANDIDATE=$(echo "$CANDIDATE" |sed -e "s,\(.*--ppapi-flash-path=/usr/lib/${FLASH_GOOD_PACKAGE}/libpepflashplayer.so --ppapi-flash-version=.*\) --ppapi-flash-\w*=\S*,\1,")
96
 
        done
97
 
        CHROMIUM_FLAGS="$CANDIDATE"
98
 
fi
99
 
 
100
 
if test -x /usr/bin/python3 -a -f "/usr/lib/adobe-flashplugin/manifest.json"; then
101
 
        if echo "$CHROMIUM_FLAGS" |grep -E -- "--ppapi-flash-version=( |\$)"; then
102
 
                ver=$(python -c 'import json,sys; print(json.load(open("/usr/lib/adobe-flashplugin/manifest.json"))["version"]);')
103
 
                CHROMIUM_FLAGS=${CHROMIUM_FLAGS/--ppapi-flash-version=/--ppapi-flash-version="${ver}" }
104
 
        fi
105
 
fi
106
 
 
107
91
# Prefer user defined CHROMIUM_USER_FLAGS (fron env) over system
108
92
# default CHROMIUM_FLAGS (from /etc/$APPNAME/default)
109
93
if test -n "$CHROMIUM_USER_FLAGS"; then
114
98
        CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS}
115
99
fi
116
100
 
 
101
# FFmpeg needs to know where its libs are located
 
102
if [ "Z$LD_LIBRARY_PATH" != Z ] ; then
 
103
  LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/libs:$LD_LIBRARY_PATH
 
104
else
 
105
  LD_LIBRARY_PATH=$LIBDIR:$LIBDIR/libs
 
106
fi
 
107
 
 
108
export LD_LIBRARY_PATH
 
109
 
117
110
# For the Default Browser detection to work, we need to give access
118
111
# to xdg-settings if it's not present on the system (ensures that the system
119
112
# xdg-utils is recent enough). Also set CHROME_WRAPPER in case xdg-settings is
147
140
want_touch_pinch=1
148
141
want_debug=0
149
142
want_temp_profile=0
150
 
want_verbose=0
151
143
while [ $# -gt 0 ]; do
152
144
  case "$1" in
153
145
    -h | --help | -help )
154
146
      usage
155
147
      exit 0 ;;
156
 
    --verbose )
157
 
      want_verbose=1
158
 
      shift ;;
159
148
    -g | --debug )
160
149
      want_debug=1
161
150
      shift ;;
177
166
 
178
167
CHROMIUM_FLAGS="${CHROMIUM_FLAGS} ${PLUGIN_PARAMETERS}"
179
168
 
180
 
if [ $want_verbose -eq 1 ] ; then
181
 
  CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-logging=stderr --v=${want_verbose}"
182
 
fi
183
 
 
184
169
if [ $want_temp_profile -eq 1 ] ; then
185
170
  TEMP_PROFILE=`mktemp -d`
186
171
  CHROMIUM_FLAGS="$CHROMIUM_FLAGS --user-data-dir=$TEMP_PROFILE"