OpenJDK Haikuports script failing in latest nightly releases

I keep getting errors when compiling the latest OpenJDK release supplied by Haikuports.
The dependencies and what looks like Apache Ant compile fine, but it stops once it gets to ‘ls: cannot access jdk: No such file…’ and '/bin/sh line 15: hg: command not found.

Is there any way to fix these errors and compile it properly?

The second message can be solved by installing mercurial first:

installoptionalpackage mercurial