52 lines
1.5 KiB
Bash
52 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# Copyright (c) 2010 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.
|
|
|
|
# Running Chromium via this script makes it possible to set Chromium as the
|
|
# default browser directly out of a compile, without needing to package it.
|
|
|
|
DESKTOP="chromium-devel"
|
|
TITLE="Chromium"
|
|
|
|
# Checks a file to see if it's a 32 or 64-bit.
|
|
check_executable() {
|
|
out=$(file $(readlink -f $1) 2> /dev/null)
|
|
echo $out | grep -qs "ELF 32-bit LSB"
|
|
if [ $? = 0 ]; then
|
|
echo 32
|
|
return
|
|
fi
|
|
echo $out | grep -qs "ELF 64-bit LSB"
|
|
if [ $? = 0 ]; then
|
|
echo 64
|
|
return
|
|
fi
|
|
echo neither
|
|
}
|
|
|
|
# Let the wrapped binary know that it has been run through the wrapper.
|
|
export CHROME_WRAPPER="`readlink -f "$0"`"
|
|
|
|
HERE="`dirname "$CHROME_WRAPPER"`"
|
|
|
|
# We include some xdg utilities next to the binary, and we want to prefer them
|
|
# over the system versions because we know they work correctly for us. But if
|
|
# our path already exists, we leave it where it is, to allow overriding this.
|
|
# (Once distributions have picked up the updated xdg-mime, we can go back to
|
|
# appending $HERE rather than prepending.)
|
|
case ":$PATH:" in
|
|
*:$HERE:*)
|
|
# $PATH already contains $HERE, leave it where it is.
|
|
;;
|
|
*)
|
|
# Prepend $HERE to $PATH.
|
|
export PATH="$HERE:$PATH"
|
|
;;
|
|
esac
|
|
|
|
export LD_LIBRARY_PATH="$HERE:$HERE/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
|
|
exec "$HERE/chrome" "$@"
|