Update dependencies and build script.

(cherry picked from commit 0b47e827a6163c9d9a165040fff041439e84b86d)