Steam on Mac, case-sensitive workaround

So, Steam for OS X just went live.


Then they announce Portal is FREE! (until May 24th, 2010 at least).


So I download the Steam .dmg to my Mac, copy Steam over to /Applications, try to run it, and promptly get:

Steam requires that be created on a case-insensitive file system, with read-write access.



(I mean, why couldn’t they have ported the thing properly and made sure the paths/file names in the code were all lower case or something?)

You know—there are people who like case-sensitive file systems because it forces them to be more careful with how they code. You know—not every file system is like, FAT32 where “readme.txt”, “README.TXT” and “ReadMe.tXt” all refer to the same file!

Anyway—while I love to rant, I also like to fix things. So here goes:

1. Create a new partition, formatted simply as Mac OS Extended (Journaled)

Note—NOT case-sensitive. I made mine 10GB, and labeled it steam. Fortunately, Disk Utility lets us play around with partitions. Who needs Partition Magic?

2. Copy to the new partition

But wait, there’s more! If you try to run Steam now, it’ll complain about ~/Library/Application Support/Steam (and later, ~/Documents/Steam Content). Hang in there with me for a second.

3. Create the necessary folders on your new partition

I ended up creating /Application Support/Steam and /Documents/Steam Content on the steam volume.

4. Create symbolic links to these new folders from where Steam looks for them

First make sure that the folders ~/Library/Application Support/Steam and ~/Documents/Steam Content don’t exist yet (the Steam app will try to create these for you). If they do, just delete them.

Time for some Terminal magic. Run Terminal, and go

cd ~/Library/Application\ Support/
ln -ns /Volumes/steam/Application\ Support/Steam/ Steam
cd ~/Documents
ln -ns /Volumes/steam/Documents/Steam\ Content/ "Steam Content"
sudo ln -s /Volumes/ /volumes

The last line will require you to enter your administrator password. I just added that in courtesy of Josh Anderson’s own post. Without that other symbolic link, it seems Steam will have trouble finding the content/games it’s already downloaded.

5. Run Steam.

6. Download Portal

7. …

8. Profit!

You’re welcome.

Added: Also, here’s another workaround by Josh Anderson that doesn’t require you to create a new partition, but uses a case-insensitive disk image instead.

Shell script to uninstall ports with dependents

Before we begin, I seem to be getting a lot of people visiting this post when searching for “uninstall macports”. Read 2.5 Uninstall from the MacPorts Guide you want to uninstall MacPorts itself.

EDIT: steve k wrote in and opened my eyes to:

sudo port uninstall --follow-dependents portname

So use that instead, and read on only if you like bash.

(I have another script that does the inverse—traverses up the dependency chain removing ‘leaf’ nodes—that is, ports with no further dependencies. Maybe I’ll make a new post on that one—after making sure it’s also not already available as some hidden option. :p )
Continue reading

Querying an XML document using XMLStarlet

I use Maven to manage my Java build process. Maven, like Ant, uses XML to store information about your project and how to build it.

Yesterday, a thought occurred to me – What if I wanted to write a script that would do post-packaging of the Maven-built artifact(s)?

For example, what if I wanted to take the Maven-built artifact and distribute it via an OS X disk image? Or even something as simple as packaging the source into a tar.gz?

A simple shell script would be easy enough to cook up – but without repeating myself, how could I do it such that the subsequent packages are named according to the same version declared in the Maven pom.xml file?

This got me to thinking about how to query XML, possibly using XPath from a shell script or the command line. I thought I might have to roll out my own XML-XPath command line processor, but fortunately somebody else beat me to it (thanks, God for all the wonderful people on teh internets) with XMLStarlet.

Continue reading

Using the Subversion Ruby Bindings

I work with a distributed team of Ruby (on Rails) developers, and we use Subversion as our repository of choice. Just recently, I wanted to find out which files were recently changed or added to a particular directory of our project.

Doing it manually would’ve been tedious. I also wanted to do it with code so that maybe sometime in the future we might be able to script some behavior depending on the last changed date of a file or group of files in our repository.

I could’ve resorted to merely calling svn info and parsing its output, but I thought maybe this was a good excuse to sharpen my Ruby chops and figure out the Subversion Ruby bindings.
Continue reading

Building db44 using MacPorts

MacPorts provides an extremely convenient way to install/uninstall various open-source software packages that have been ported to the Mac. It’s sort of like apt-get for Debian or yum for RH/CentOS/Fedora. For a developer like me who uses (and likes to use) open-source software on the Mac, MacPorts is a godsend.

If you were brought to this article, chances are you’ve encountered the same problem as I have when trying to install certain packages that depend on db44 (Version 4.4 of the Berkeley Data Base library). (Chances are, you’re also running on an Intel Mac like me – as I haven’t seen any complaints from people on PPC Macs)
Continue reading