Code
# Temporary bandaid until everyone has the new libsteam_api.so
rm -f ~/.steampath && ln -s "$STEAMCONFIG/bin32/steam" ~/.steampath
rm -f ~/.steampid && ln -s "$PIDFILE" ~/.steampid
rm -f ~/.steam/bin && ln -s "$STEAMBIN32LINK" ~/.steam/bin
# Uncomment this line when you want to remove the bandaid
#rm -f ~/.steampath ~/.steampid ~/.steam/bin
fi
# Show what we detect for distribution and release
echo "Running Steam on $(distro_description)"
# The Steam runtime is a complete set of libraries for running
# Steam games, and is intended to continue to work going forward.
#
# The runtime is open source and the scripts used to build it are
# available on GitHub:
# https://github.com/ValveSoftware/steam-runtime
#
# We would like this runtime to work on as many Linux distributions
# as possible, so feel free to tinker with it and submit patches and
# bug reports.
#
if [ "$STEAM_RUNTIME" = "debug" ]; then
# Use the debug runtime if it's available, and the default if not.
export STEAM_RUNTIME="$STEAMROOT/$PLATFORM/steam-runtime"
if unpack_runtime; then
if [ -z "$STEAM_RUNTIME_DEBUG" ]; then
STEAM_RUNTIME_DEBUG="$(cat "$STEAM_RUNTIME/version.txt" | sed 's,-release,-debug,')"
fi
if [ -z "$STEAM_RUNTIME_DEBUG_DIR" ]; then
STEAM_RUNTIME_DEBUG_DIR="$STEAMROOT/$PLATFORM"
fi
if [ ! -d "$STEAM_RUNTIME_DEBUG_DIR/$STEAM_RUNTIME_DEBUG" ]; then
# Try to download the debug runtime
STEAM_RUNTIME_DEBUG_URL=$(grep "$STEAM_RUNTIME_DEBUG" "$STEAM_RUNTIME/README.txt")
mkdir -p "$STEAM_RUNTIME_DEBUG_DIR"
STEAM_RUNTIME_DEBUG_ARCHIVE="$STEAM_RUNTIME_DEBUG_DIR/$(basename "$STEAM_RUNTIME_DEBUG_URL")"
if [ ! -f "$STEAM_RUNTIME_DEBUG_ARCHIVE" ]; then
echo $"Downloading debug runtime: $STEAM_RUNTIME_DEBUG_URL"
(cd "$STEAM_RUNTIME_DEBUG_DIR" && \
download_archive $"Downloading debug runtime..." "$STEAM_RUNTIME_DEBUG_URL")
fi
if ! extract_archive $"Unpacking debug runtime..." "$STEAM_RUNTIME_DEBUG_ARCHIVE" "$STEAM_RUNTIME_DEBUG_DIR"; then
rm -rf "$STEAM_RUNTIME_DEBUG" "$STEAM_RUNTIME_DEBUG_ARCHIVE"
fi
fi
if [ -d "$STEAM_RUNTIME_DEBUG_DIR/$STEAM_RUNTIME_DEBUG" ]; then
echo "STEAM_RUNTIME debug enabled, using $STEAM_RUNTIME_DEBUG"
export STEAM_RUNTIME="$STEAM_RUNTIME_DEBUG_DIR/$STEAM_RUNTIME_DEBUG"
# Set up the link to the source code
ln -sf "$STEAM_RUNTIME/source" /tmp/source
else
echo $"STEAM_RUNTIME couldn't download and unpack $STEAM_RUNTIME_DEBUG_URL, falling back to $STEAM_RUNTIME"
fi
fi
elif [ "$STEAM_RUNTIME" = "1" ]; then
echo "STEAM_RUNTIME is enabled by the user"
export STEAM_RUNTIME="$STEAMROOT/$PLATFORM/steam-runtime"
elif [ "$STEAM_RUNTIME" = "0" ]; then
echo "STEAM_RUNTIME is disabled by the user"
elif [ -z "$STEAM_RUNTIME" ]; then
if runtime_supported; then
echo "STEAM_RUNTIME is enabled automatically"
export STEAM_RUNTIME="$STEAMROOT/$PLATFORM/steam-runtime"
else
echo "STEAM_RUNTIME is disabled automatically"
fi
else
echo "STEAM_RUNTIME has been set by the user to: $STEAM_RUNTIME"
fi
if [ "$STEAM_RUNTIME" -a "$STEAM_RUNTIME" != "0" ]; then
# Unpack the runtime if necessary
if unpack_runtime; then
case $(uname -m) in
*64)
export PATH="$STEAM_RUNTIME/amd64/bin:$STEAM_RUNTIME/amd64/usr/bin:$PATH"
;;
*)
export PATH="$STEAM_RUNTIME/i386/bin:$STEAM_RUNTIME/i386/usr/bin:$PATH"
;;
esac
export LD_LIBRARY_PATH="$STEAM_RUNTIME/i386/lib/i386-linux-gnu:$STEAM_RUNTIME/i386/lib:$STEAM_RUNTIME/i386/usr/lib/i386-linux-gnu:$STEAM_RUNTIME/i386/usr/lib:$STEAM_RUNTIME/amd64/lib/x86_64-linux-gnu:$STEAM_RUNTIME/amd64/lib:$STEAM_RUNTIME/amd64/usr/lib/x86_64-linux-gnu:$STEAM_RUNTIME/amd64/usr/lib:$LD_LIBRARY_PATH"
else
echo "Unpack runtime failed, error code $?"
show_message --error $"Couldn't set up the Steam Runtime. Are you running low on disk space?\nContinuing..."
fi
fi
# Need to add /usr/lib32 to the library path to pick up libvdpau_nvidia.so on Ubuntu 12.04
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib32"
# prepend our lib path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH"
# Check to make sure the user will be able to run steam...
if [ -z "$STEAMOS" ]; then
check_shared_libraries
fi
# disable SDL1.2 DGA mouse because we can't easily support it in the overlay
export SDL_VIDEO_X11_DGAMOUSE=0
else # if [ "$UNAME" == "Darwin" ]; then
PLATFORM=osx32
# prepend our lib path to LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$DYLD_LIBRARY_PATH"
# make sure our architecture is sane
ARCH=`arch`
case "$ARCH" in
ppc* )
osascript -e 'tell application "Dock"
display dialog "Steam is only supported on Intel-based Macs." buttons "Exit" default button 1 with title "Unsupported Architecture" with icon stop
activate
end tell'
exit -1
;;
esac
# make sure we're running >= 10.5.0
OSXVER=`sw_vers -productVersion`
case "$OSXVER" in
10.0.* | 10.1.* | 10.2.* | 10.3.* | 10.4.* )
osascript -e 'tell application "Dock"
display dialog "Steam Requires OSX 10.5 or greater" buttons "Exit" default button 1 with title "Unsupported Operating System" with icon stop
activate
end tell'
exit -1
;;
esac
fi
ulimit -n 2048 2>/dev/null
# Touch our startup file so we can detect bootstrap launch failure
if [ "$UNAME" = "Linux" ]; then
: >"$STEAMSTARTING"
fi
MAGIC_RESTART_EXITCODE=42
SEGV_EXITCODE=139
# and launch steam
STEAM_DEBUGGER=$DEBUGGER
unset DEBUGGER # Don't use debugger if Steam launches itself recursively
if [ "$STEAM_DEBUGGER" == "gdb" ] || [ "$STEAM_DEBUGGER" == "cgdb" ]; then
ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)
# Set the LD_PRELOAD varname in the debugger, and unset the global version.
if [ "$LD_PRELOAD" ]; then
echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
echo show env LD_PRELOAD >> "$ARGSFILE"
unset LD_PRELOAD
fi
$STEAM_DEBUGGER -x "$ARGSFILE" --args "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
rm "$ARGSFILE"
elif [ "$STEAM_DEBUGGER" == "valgrind" ]; then
DONT_BREAK_ON_ASSERT=1 G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --error-limit=no --undef-value-errors=no --suppressions=$PLATFORM/steam.supp $STEAM_VALGRIND "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@" 2>&1 | tee steam_valgrind.txt
elif [ "$STEAM_DEBUGGER" == "callgrind" ]; then
valgrind --tool=callgrind --instr-atstart=no "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
elif [ "$STEAM_DEBUGGER" == "strace" ]; then
strace -osteam.strace "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
else
$STEAM_DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
fi
STATUS=$?
# Restore paths before unpacking the bootstrap if we need to.
export PATH="$SYSTEM_PATH"
export LD_LIBRARY_PATH="$SYSTEM_LD_LIBRARY_PATH"
if [ "$UNAME" = "Linux" ]; then
if [ "$INITIAL_LAUNCH" -a \
$STATUS -ne $MAGIC_RESTART_EXITCODE -a \
-f "$STEAMSTARTING" -a \
-z "$STEAM_INSTALLED_BOOTSTRAP" -a \
-z "$STEAMSCRIPT_OUTOFDATE" ]; then
# Launching the bootstrap failed, try reinstalling
if reset_steam; then
# We were able to reinstall the bootstrap, try again
export STEAM_INSTALLED_BOOTSTRAP=1
STATUS=$MAGIC_RESTART_EXITCODE
fi
fi
fi
# If steam requested to restart, then restart
RESTART=0
if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ] ; then
echo "Restarting Steam by request..."
RESTART=1
fi
if [ $RESTART -ne 0 ] ; then
# are we running running from a bundle on osx?
if [ $PLATFORM == "osx32" -a -f Info.plist ]; then
STEAMAPP="$(cd "${0%/*}/../.." && echo $PWD)"
OSXVER=`sw_vers -productVersion`
case "$OSXVER" in
10.5.* )
exec open -n "$STEAMAPP"
;;
* )
exec open -n "$STEAMAPP" --args "$@"
;;
esac
else
exec "$0" "$@"
fi
fi
Alles anzeigen
ende