When head is provied consider adding this ;

Dir.chdir "riak-#{version}" unless build.head?

see https://github.com/josegonzalez/homebrew-php/blob/master/Formula/php53-riak.rb?source=c#L15