Jump to content
Sign in to follow this  
Clay

Steam is coming to Linux.

Recommended Posts

We have our hands on the bash launcher used by Valve's Steam client for Mac OS X that was recently announced -- along with the Source Engine for OS X -- and is currently in closed beta. While such scripts are usually insignificant, there is something interesting within it and that is explicit support for Linux.

Here's the proof.

#!/bin/bash



# figure out the absolute path to the script being run a bit

# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the

# specified directory, then uses $PWD to figure out where that

# directory lives - and all this in a subshell, so we don't affect

# $PWD



STEAMROOT=$(cd "${0%/*}" && echo $PWD)



#determine platform

UNAME=`uname`

if [ "$UNAME" == "Darwin" ]; then

PLATFORM=osx32

# prepend our lib path to LD_LIBRARY_PATH

export DYLD_LIBRARY_PATH="${STEAMROOT}"/${PLATFORM}:$DYLD_LIBRARY_PATH

elif [ "$UNAME" == "Linux" ]; then

PLATFORM=linux32

# prepend our lib path to LD_LIBRARY_PATH

export LD_LIBRARY_PATH="${STEAMROOT}"/${PLATFORM}:$LD_LIBRARY_PATH

fi

Why would Valve bother writing in support for Linux launching if they aren't porting it there? brb needs new pants.

Source: http://www.phoronix.com/scan.php?page=article&item=steam_linux_script&num=1

Share this post


Link to post
Share on other sites
Guest rw.Sentenced

Anyone actually seen what this does? This does nothing except determine the OS. What proof is there that this is even legit code?

Share this post


Link to post
Share on other sites
Anyone actually seen what this does? This does nothing except determine the OS. What proof is there that this is even legit code?

haha, I was thinking the same thing. It's rather specious, but you never know. Could have just been included to give nerds a boner.

Share this post


Link to post
Share on other sites
Guest rw.Sentenced

So a website said they found something. So What? Until i get a copy of that launcher and see the bash code for myself, i aint believing it

Share this post


Link to post
Share on other sites
So a website said they found something. So What? Until i get a copy of that launcher and see the bash code for myself, i aint believing it

You obviously didn't click the link...

It's all on the Steampowered website. :|

public_all.zip

skins_all.zip

bins_linux.zip

steam_linux.zip

The last two are where the important things are.

Here's the whole bash script:

#!/bin/bash



# figure out the absolute path to the script being run a bit

# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the

# specified directory, then uses $PWD to figure out where that

# directory lives - and all this in a subshell, so we don't affect

# $PWD



STEAMROOT=$(cd "${0%/*}" && echo $PWD)



#determine platform

UNAME=`uname`

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

elif [ "$UNAME" == "Linux" ]; then

PLATFORM=linux32

# prepend our lib path to LD_LIBRARY_PATH

export LD_LIBRARY_PATH="${STEAMROOT}"/${PLATFORM}:$LD_LIBRARY_PATH

fi



if [ -z $STEAMEXE ]; then

STEAMEXE=steam

fi



ulimit -n 2048



# and launch steam

cd "$STEAMROOT"



STATUS=42

while [ $STATUS -eq 42 ]; do

${DEBUGGER} "${STEAMROOT}"/${PLATFORM}/${STEAMEXE} $@

STATUS=$?

# are we running osx?

if [ $STATUS -eq 42 -a ${PLATFORM} == "osx32" -a -f Info.plist ]; then

# are we running from in a bundle?

exec open "${STEAMROOT}"/../..

fi

done

exit $STATUS

Share this post


Link to post
Share on other sites
Here's the proof.

#!/bin/bash



# figure out the absolute path to the script being run a bit

# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the

# specified directory, then uses $PWD to figure out where that

# directory lives - and all this in a subshell, so we don't affect

# $PWD



STEAMROOT=$(cd "${0%/*}" && echo $PWD)



#determine platform

UNAME=`uname`

if [ "$UNAME" == "Darwin" ]; then

PLATFORM=osx32

# prepend our lib path to LD_LIBRARY_PATH

export DYLD_LIBRARY_PATH="${STEAMROOT}"/${PLATFORM}:$DYLD_LIBRARY_PATH

elif [ "$UNAME" == "Linux" ]; then

PLATFORM=linux32

# prepend our lib path to LD_LIBRARY_PATH

export LD_LIBRARY_PATH="${STEAMROOT}"/${PLATFORM}:$LD_LIBRARY_PATH

fi

Why would Valve bother writing in support for Linux launching if they aren't porting it there? brb needs new pants.

Source: http://www.phoronix.com/scan.php?page=article&item=steam_linux_script&num=1

I'll get the bucket clay.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...