The rest of the patch from FreeBSD ports should be reviewed by the maintainer, I'm not sure how far this is reasonable ...