Homebrew includes that patch, and the recipe has been updated for emacs 24.
brew update
# Lion only (or if you don't have xcode?)
brew tap homebrew/dupes
brew install apple-gcc42
# put these in your .bashrc
export HOMEBREW_USE_GCC=1
export HOMEBREW_VERBOSE=1
# /Lion only
brew install emacs --cocoa
brew linkapps