Sunday, September 13, 2009

playing with freebies

oh... so... i might have forgotten to introduce myself. i'm arrogant cyberstar, a second life avatar. there's not too much to say about me. i live in california, i work in software and i think second life is pretty cool. well... the things you can do with it are cool, SL itself probably needs a bit of polish. i spend my time in SL wandering around mostly. but i like to chat about software and about adding bits of functionality to the SL viewer; that's why i've been playing around with the snowglobe viewer.

most of this blog is about software experiments, but from time to time i just wander around and look around, trying to get ideas for cool things. if you're new to SL, you'll probably want to grab some freebies. there are several freebie spots in world, but the one that seems to be high on the search list is the freebie warehouse in Burns. i was able to load up on several knick-knacks... clothes... animations... etc.

as a homeless deadbeat, i don't have a place to go to rez my new freebies. fortunately, there are "sandboxes" that cater to people like me. the IBM sandbox is one such place. so.. even if you're a n00b homeless drifter like myself, you an still play around.

script to download and build snowglobe on MacOS X

so i started monkeying with things i shouldn't have monkeyed with, and very quickly decided i should probably just re-check-out the snowglobe source and start afresh. but i got a little crafty and wrote a quick script to automate this process for me. if it's useful for you, great! if not, don't blame me.

the script is available up on the second life wiki at https://wiki.secondlife.com/wiki/User:Arrogant_Cyberstar/Compiling_Snowglobe_on_MacOSX

Tuesday, August 25, 2009

Compiling Snowglobe on MacOS-X

Downloading and compiling the Snowglobe source isn't supposed to be that big of a deal. And for the most part it's not, but I figured I would blog my experiences anyway. I've been hitting my head against the wall for a while on Snowglobe; it's not difficult, it's just occasionally under-documented. 

So you might think the first step would be to check out the Snowglobe source and start compiling. Not so fast. Check to see if you have the right tools first. If you look on the Compiling the Viewer (Mac OS X) page, it'll give you a list of things to check. First, check to see that XCode is installed. I'm building on an intel Mac running 10.5.8. At the time i'm writing this, XCode 3.0 is the most recent version. You can download it from Apple at http://developer.apple.com/technology/Xcode.html . You'll also want to check your version of cmake is recent. I ran `cmake --version` and was told i have "cmake version 2.6-patch 4". The wiki page says you're supposed to have 2.6.2, but I like to live dangerously. You can go to http://www.cmake.org/cmake/resources/software.html to download the latest copy. They even put together a .dmg image with an installer. nice!

Next I checked out the source from the SVN repository with the command:

svn co https://svn.secondlife.com/svn/linden/projects/2009/snowglobe/trunk snowglobe


It might ask you a question about the server certificate; I was a complete fool and just hit the 'p' key to accept the cert permanently.

Now that you've checked out the source, you can get the libraries needed to compile. Fortunately there's a script for this. Change directories to the "snowglobe" directory the checkout command created, then execute the command:

./scripts/public_fetch_tarballs.py

Depending on your network, this can take a while.

But wait, some libraries can't be distributed by Linden. The process is documented at http://wiki.secondlife.com/wiki/Compiling_the_viewer_(Mac_OS_X)#Installing_Proprietary_Libraries , but the exact sequence of commands seems to be for the previous viewer (not Snowglobe.) So, I went to the FMOD Site, downloaded version 3.75 of FMOD (you don't want the latest version, you have to scroll down 'til you see the "FMOD 3 Programmers API" heading. Look closely at the table below it and you should see the MacOS-X download button. My browser is setup to download and extract files into the ~/Downloads directory, I cd'd into the snowglobe directory and used the following commands to put FMOD in the right place:

mkdir -p libraries/include
mkdir -p libraries/universal-darwin/lib_debug
mkdir -p libraries/universal-darwin/lib_release
cp -p ~/Downloads/fmodapi375mac/api/inc/*.h libraries/include
lipo -create ~/Downloads/fmodapi375mac/api/lib/libfmod.a ~/Downloads/fmodapi375mac/api/lib/libfmodx86.a -output libraries/universal-darwin/lib_debug/libfmod.a
touch -r ~/Downloads/fmodapi375mac/api/lib/libfmodx86.a libraries/universal-darwin/lib_debug/libfmod.a
cp -p libraries/universal-darwin/lib_debug/libfmod.a libraries/universal-darwin/lib_release/libfmod.a

Now, I'm kind of old school, so I like to do build things on the command line. So cd'd into the indra directory and used the following command to configure things:

./develop.py

Then I used this command to kick off the build:

./develop.py build

And then I went to grab a drink at the corner bar. When I came back, I found a copy of the Snowglobe application in the "build-darwin-i386/newview/RelWithDebInfo" directory. I'm a command line kinda joe, so i launched it with the command:

./build-darwin-i386/newview/RelWithDebInfo/Snowglobe.app/Contents/MacOS/Snowglobe --grid agni --channel "Arrogant Cyberstar"

And have been happy ever since.