Josh Ruehlig proposed the following patch:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=172812&action=diff
I'm no ports committer, so I need review and then approval.
NOTE: this is very similar to https://reviews.freebsd.org/D7304
Thanks!