add code from heroku-buildpac-c