Ported from fixes in https://github.com/artcom/homebrew/blob/master/Library/Formula/tuio_cpp.rb